Closed Bug 1027315 Opened 8 years ago Closed 8 years ago

ChildAtPoint() Does not work within web component shadow dom

Categories

(Core :: Disability Access APIs, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla33

People

(Reporter: eeejay, Assigned: eeejay)

Details

Attachments

(1 file)

This seems to be because of another use of IsInDoc().
we have a bunch of IsInDoc() checks, it's quite possible that all(some?) of them should be replaced to the new check. would you be interested to run through it?
Comment on attachment 8442504 [details] [diff] [review]
GetAccessibleOrContainer should check across shadow root for document.

Review of attachment 8442504 [details] [diff] [review]:
-----------------------------------------------------------------

::: accessible/tests/mochitest/hittest/test_shadowroot.html
@@ +18,5 @@
> +    function doTest()
> +    {
> +      var componentAcc = getAccessible('component1');
> +      testChildAtPoint(componentAcc, 1, 1,
> +        componentAcc.firstChild, componentAcc.firstChild);

fix indentation

@@ +21,5 @@
> +      testChildAtPoint(componentAcc, 1, 1,
> +        componentAcc.firstChild, componentAcc.firstChild);
> +      componentAcc = getAccessible('component2');
> +      testChildAtPoint(componentAcc, 1, 1,
> +        componentAcc.firstChild, componentAcc.firstChild);

new line pls

@@ +33,5 @@
> +</head>
> +<body>
> +
> +  <a target="_blank"
> +    title="Test getChildAtPoint works for shadow DOM content"

wrong indentation

@@ +35,5 @@
> +
> +  <a target="_blank"
> +    title="Test getChildAtPoint works for shadow DOM content"
> +    href="https://bugzilla.mozilla.org/show_bug.cgi?id=1027315">
> +     Mozilla Bug 1027315

two char indent

@@ +49,5 @@
> +         style="width: 100px; height: 100px; background-color: pink;">
> +    </div>
> +  -->
> +  </div>
> +  <div role="group" class="components"  id="component2" style="display: inline-block;">

two spaces between attributes
why do you need that style?

@@ +55,5 @@
> +    <button>Hello world</button>
> +  -->
> +  </div>
> +  <script>
> +    var components = document.querySelectorAll('.components');

a small comment might be good to say that it adds commented HTML to shadow content

i'm curious to see how shadow and explicit content coexist, do you have any data?
Attachment #8442504 - Flags: review?(surkov.alexander) → review+
(In reply to alexander :surkov from comment #3)
> Comment on attachment 8442504 [details] [diff] [review]
> > +  <div role="group" class="components"  id="component2" style="display: inline-block;">
> 
> two spaces between attributes
> why do you need that style?

It helps make the container fit the size of its children. Otherwise, the height is smaller than the shadow dom content, and the width is %100 of the page.
Giving it a try before landing:
https://tbpl.mozilla.org/?tree=Try&rev=d47d5f17811b
Finally green after changing the pref setting. Apparently it web components is enabled by default in tests.
https://tbpl.mozilla.org/?tree=Try&rev=80facce756ca
https://hg.mozilla.org/mozilla-central/rev/20c1266e6a23
Status: NEW → RESOLVED
Closed: 8 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla33
You need to log in before you can comment on or make changes to this bug.