The :scope pseudo-class inside :has(), :is(), :where(), and :not()
selectors was not receiving the scoping root from outer selector
contexts like Element.closest().
This fix passes the scope parameter through matches_has_pseudo_class(),
matches_relative_selector(), and the :is()/:where()/:not() cases so
that :scope correctly refers to the scoping root element.
This fixes WPT tests for Element.closest() with selector
':has(> :scope)' and for comparing :has(:scope) with :is(:scope)
selectors.
Previously, click handling for labels was handled in layout and
painting code. This change implements activation_behavior on
HTMLLabelElement, which clicks and focuses the element.
The WebIDL spec requires that attributes marked [LegacyUnforgeable]
share the same getter and setter function objects across all instances
within the same Realm.
Previously, we were creating new JS::NativeFunction wrappers during
every instance initialization, which caused identity checks to fail.
This change moves these functions into Bindings::Intrinsics so they
are created once per Realm and reused.
Make WindowProxy implement the EventTarget interface. Add a new method
current_target_for_bindings() that returns a WindowProxy object instead
of directly exposing the Window object.
These changes fixes several WPT tests that contain `window ===
currentTarget`.
As `node->parent()` was being called before comparing `node` with
`stay_within`, the code was incorrectly allowing traversal to the
parent node even when it should not have.
This change ensures that the parent is only checked after
confirming that the current node is not the `stay_within` node.
All `dom/traversal/NodeIterator.html` WPT tests get fixed after this
change.
Regressed in 036327332f.
This commit moves the optimization a little later in replaceData(),
still avoiding relayout (the important part).
Recovers 480 points on WPT. :^)
The focus chain always consists of newly created GC::Root objects, so
the condition always produced `false`. The fix is to use GC::Root's
overloaded operator== method, which compares the pointers of the stored
type.
This fixes Figma dropdowns and context menus instantly disappearing
upon opening them. This is because they become focused when they insert
them. Because of this bug, it would fire blur events all the way up to
and including the window. Figma listens for the blur event on the
window, and when received, it will instantly hide dropdowns and context
menus. The intention behind this seems to be hiding them when the user
clicks off the browser window, or switches tab.
Several interfaces that return a high resolution time require that
time to be coarsened, in order to prevent timing attacks. This
implementation simply reduces the resolution of the returned timestamp
to the minimum values given in the specification. Further work may be
needed to make our implementation more robust to the kind of attacks
that this mechanism is designed to prevent.
PlatformObjects with named properties does not qualify as 'has own
property' just by virtue of a named property existing.
This fixes at least one WPT test, which is imported.
This allows us to disable test output, which performs expensive assert
tracking. This was making our imported tests run significantly slower
than tests run via `WPT.sh`.
Formatting the output ourselves also allows us to remove unnecessary
information from the test output.
This commit also rebaselines all existing imported WPT tests to follow
the new format.