This algorithm is the meat of firing the NavigateEvent at navigation.
In order to implement it, we also need to add some getters/setters on
NavigateEvent. The implemetentation deviates from the spec in when
exactly the NavigateEvent is created. In following the pattern for other
events. we construct the event from the NavigateEventInit structure from
our native code. This makes the code a lot simpler than adding 10
getters to the NavigateEvent that are only ever used just after
construction. I'm not 100% conviced the promise resolution code is
correct, but we can add tests for that later :^).
These Navigation API Method Tracker AOs are called by the inner navigate
event firing algorithm. Implement them beforehand to make the diff look
pretty :^).
The potentially scroll/focus and finish AOs are called by the inner
navigate event firing algorithm. Implement them beforehand to make the
diff look pretty :^).
For now, part of this is commented-out. Our current implementations of
`<mask>` and `<symbol>` rely on creating layout nodes, so they can't be
`display: none`.
It does not currently handle any of the actual scripting, but this
should at least allow us to create an instance of the element.
The test being added here isn't actually testing much, but before the
previous commit we used to crash parsing the page due to a TODO().
These allow accessing embeds, forms, images and objects with a given
name attribute, and any element with a given id attribute, as top level
properties on the global object.
It also allows accessing NavigableContainers by target name as top level
properties on the global object.
The current implementation feels very expensive. It's likely that
these values will need smarter caching in the future.
And implement WindowProperties, the "named properties object" for Window
according to the spec.
This involves moving an AO out of LegacyPlatformObject and into a common
place that the WindowProperties class can access.
This doesn't implement the AOs on Window that actually name lookup for
the unenumerable named properties on the window yet, just the
scaffolding.
And remove assorted spec FIXMEs along the way. Also align
populate_session_history_entry_document to the spec, with a bonus spec
bug to be filed.
This involves creating a new NonFetchSchemeNavigationParams spec, and
having the associated AOs take a Variant rather than Optional to
accomodate the fact that this extra struct could be returned by the
algorithm. We don't actually *do* anything with these params, but the
scaffolding is there now, with less TODOs.
Before, we only ensured that boxes establishing BFC did not overlap
with floats because that is what CSS 2.2 specification says. However,
we should also apply the same for boxes establishing FFC or GFC as this
aligns with the behavior of other browsers.
Fixes https://github.com/SerenityOS/serenity/issues/21095
This was a remnant from the AST/BC hybrid interpreter times. We've had
a VERIFY in here for weeks now that would catch anything depending on
this behavior, and nothing has hit it, so let's remove the unnecessary
code (but leave the VERIFY) :^)
Our implementation of environment.CreateImmutableBinding(name, true)
in this AO was not correctly initializing const variables in strict
mode. This would mean that constant declarations in for loop bodies
would not throw if they were modified.
To fix this, add a new parameter to CreateVariable to set strict mode.
Also remove the vm.is_strict mode check here, as it doesn't look like
anywhere in the spec will change strict mode depending on whether the
script itself is running in script mode or not.
This fixes two of our test-js tests, no change to test262.
Otherwise `attr(|name, "fallback")` becomes `attr(| name , "fallback")`
The test here is slightly aspirational. There are other rules for
serialization we don't follow (like stripping whitespace entirely from
many places) so these are marked with FIXMEs.
The `to_string()` for this is modified a little from the original,
because we have to calculate what the layer-count is then, instead of
having it already calculated.