Closed Bug 1145910 Opened 10 years ago Closed 10 years ago

Shadow DOM prevents :active pseudo class from matching on the shadow host

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla39
Tracking Status
firefox39 --- fixed

People

(Reporter: mikehenrty, Assigned: wchen, NeedInfo)

References

Details

Attachments

(2 files, 1 obsolete file)

Attached file [HTML page] test case
Attached test case. In the test case there is a blue box, which is the shadow host, that turns red on :active state. Inside that box is a shadow DOM box with a black border. Then inside that is a non-shadow span with the text "Text" inside of it. Clicking on the blue box, or word "Text" triggers the :active pseudo selector. However, clicking withing the black border (ie. the shadow DOM box) and not on the "Text" will not trigger the :active class, and the host box stays blue. The shadow DOM must be preventing the :active state from propagating to normal web content.
William, any idea what's going on here?
User Story: (updated)
Flags: needinfo?(wchen)
Could be related to bug 1117535. I'm not sure.
See Also: → 1117535
The code to update the event state of content in the shadow DOM currently doesn't use the flattened tree when traversing ancestors so it stops at the shadow root.
Flags: needinfo?(wchen)
Now with test. Here is the relevant text in the selector spec: http://dev.w3.org/csswg/selectors-4/#active-pseudo Seems to be missing from the HTML spec: https://html.spec.whatwg.org/multipage/scripting.html#selector-active
Attachment #8581017 - Attachment is obsolete: true
Attachment #8582028 - Flags: review?(bugs)
Attachment #8582028 - Flags: review?(bugs) → review+
Assignee: nobody → wchen
Flags: in-testsuite+
OS: Mac OS X → All
Hardware: x86 → All
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla39
Thanks William! Any chance we could request uplift to 37? This will help us improve the web components we are using for the lightsaber project, and I believe we want that working with b2g 2.2.
Flags: needinfo?(wchen)
Nevermind, I just checked and we don't care about having lightsaber work on 2.2.
Flags: needinfo?(wchen)
Doesn't FindCommonAncestor need to be changed too? Otherwise the optimization story for moving the mouse into/out of a component will kinda suck in terms of updating the :hover state, I'd think.
Flags: needinfo?(wchen)
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: