Skip to content

script: Mark disabled elements pointed at and elements targets of touch events as :active#42935

Merged
mrobinson merged 3 commits into
servo:mainfrom
webbeef:pointed-element-active
Mar 2, 2026
Merged

script: Mark disabled elements pointed at and elements targets of touch events as :active#42935
mrobinson merged 3 commits into
servo:mainfrom
webbeef:pointed-element-active

Conversation

@webbeef
Copy link
Copy Markdown
Contributor

@webbeef webbeef commented Mar 1, 2026

This implements the "If the element is being actively pointed at" part of https://html.spec.whatwg.org/multipage/semantics-other.html#selector-active

Also added support for activation of controls tied to a <label for=...> element as this is part of the same /html/semantics/selectors/pseudo-classes/active-disabled.html WPT test. We still fail the <input disabled> one because the hit test ends up in a <div> of the input shadow DOM.

Testing: New WPT tests are passing
Fixes: Partial fix for #7333 and #20284 (I think we still lack support for the focusable elements).

@webbeef webbeef requested a review from gterzian as a code owner March 1, 2026 16:34
@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Mar 1, 2026
Signed-off-by: webbeef <[email protected]>
Comment thread components/script/dom/document_event_handler.rs Outdated
Comment thread components/script/dom/document_event_handler.rs Outdated
Comment thread components/script/dom/document_event_handler.rs Outdated
[Clicking on a child of a disabled button should make the button match the :active selector.]
expected: FAIL

[Clicking on a disabled input should make it match the :active selector.]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any idea why this is still failing?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We still fail the one because the hit test ends up in a <div> of the <input> shadow DOM.

@mrobinson mrobinson changed the title script: mark elements that are pointed at as :active script: Mark disabled elements pointed at and elements the target of touch events as :active Mar 1, 2026
@mrobinson mrobinson changed the title script: Mark disabled elements pointed at and elements the target of touch events as :active script: Mark disabled elements pointed at and elements targets of touch events as :active Mar 1, 2026
@webbeef webbeef force-pushed the pointed-element-active branch from 91954a8 to 4730def Compare March 1, 2026 19:02
@servo-highfive servo-highfive removed the S-awaiting-review There is new code that needs to be reviewed. label Mar 2, 2026
@mrobinson mrobinson added this pull request to the merge queue Mar 2, 2026
@servo-highfive servo-highfive added the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Mar 2, 2026
Merged via the queue into servo:main with commit 4487e02 Mar 2, 2026
30 checks passed
@servo-highfive servo-highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Mar 2, 2026
simonwuelker pushed a commit to simonwuelker/servo that referenced this pull request Mar 3, 2026
…ch events as `:active` (servo#42935)

This implements the "If the element is [being actively pointed
at](https://html.spec.whatwg.org/multipage/semantics-other.html#being-actively-pointed-at)"
part of
https://html.spec.whatwg.org/multipage/semantics-other.html#selector-active

Also added support for activation of controls tied to a `<label
for=...>` element as this is part of the same
`/html/semantics/selectors/pseudo-classes/active-disabled.html` WPT
test. We still fail the `<input disabled>` one because the hit test ends
up in a `<div>` of the input shadow DOM.

Testing: New WPT tests are passing
Fixes: Partial fix for servo#7333 and
servo#20284 (I think we still lack
support for the focusable elements).

---------

Signed-off-by: webbeef <[email protected]>
offline-ant pushed a commit to offline-ant/havi that referenced this pull request Jun 4, 2026
…ch events as `:active` (servo#42935)

This implements the "If the element is [being actively pointed
at](https://html.spec.whatwg.org/multipage/semantics-other.html#being-actively-pointed-at)"
part of
https://html.spec.whatwg.org/multipage/semantics-other.html#selector-active

Also added support for activation of controls tied to a `<label
for=...>` element as this is part of the same
`/html/semantics/selectors/pseudo-classes/active-disabled.html` WPT
test. We still fail the `<input disabled>` one because the hit test ends
up in a `<div>` of the input shadow DOM.

Testing: New WPT tests are passing
Fixes: Partial fix for servo#7333 and
servo#20284 (I think we still lack
support for the focusable elements).

---------

Signed-off-by: webbeef <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants