Add reference target to shadow root#1353
Conversation
- Add the concept of a "source" for an Event. - Modify shadow root's "get the parent" algorithm such that events propagate into the event's source's tree where appropriate.
|
@annevk , @smaug---- , this is ready for another review along with whatwg/html#10995. For context on the event propagation change, see WICG/webcomponents#1098. Thanks! |
|
What is the current testing situation? alice added several tests, but this is a rather complicated feature (at least from implementation point of view) so we need to ensure testing coverage is particularly good. But are we testing all the complicated cases? |
|
I've tried to ensure that the WPTs for this are thorough; I and other contributors added quite a few during work on the Chromium prototype. E.g. https://wpt.fyi/results/shadow-dom/reference-target/tentative/property-reflection.html and https://wpt.fyi/results/shadow-dom/reference-target/tentative/property-reflection-idl-setters.html test reflection behavior for all the properties affected by reference target, with references pointing to and from every HTML element type. https://github.com/web-platform-tests/wpt/blob/master/shadow-dom/reference-target/tentative/event-path.html covers all the interesting event propagation scenarios discussed in WICG/webcomponents#1098, plus some others I thought of. All of the platform features testable in WPTs that can be affected by reference target (form submission, There are a few other ARIA properties affected by reference target that aren't yet testable in WPTs; there are tests for those in the Chromium source tree at https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/web_tests/shadow-dom/reference-target/tentative/. For some reason it doesn't seem like the Mozilla CI results are including the full set of tests. There are a larger number of tests in https://wpt.fyi/results/shadow-dom/reference-target/tentative that Gecko is shown as failing that don't appear in the linked Mozilla CI results. |
|
The pref in Gecko isn't enabled in Nightly, so wpt.fyi still shows many tests as failing. The pref is enabled in Mozilla CI. |
smaug----
left a comment
There was a problem hiding this comment.
Looks reasonable, with the nits annevk has mentioned
…ent. Fix grammar.
Reference Target is a feature to enable using IDREF attributes such as
forandaria-labelledbyto refer to elements inside a component's shadow DOM, while maintaining encapsulation of the internal details of the shadow DOM. The main goal of this feature is to enable ARIA to work across shadow root boundaries.In this change, add the
referenceTargetproperty toShadowRootand add a definition ofreference targetthat's exported for use in other specs.See the reference target explainer.
Preview | Diff