Bug 1740534 Comment 23 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

Replicating some of my comments to :annevk in slack here too, but I think the key thing is that I mis-characterized these failures as indicating this would be a major regression in our behavior, when the reality is that there are two tests that seem to be broken per spec.

(In reply to Andrew Sutherland [:asuth] (he/him) from comment #20)
> 2. https://searchfox.org/mozilla-central/source/testing/web-platform/tests/dom/traversal/TreeWalker-acceptNode-filter-cross-realm-null-browsing-context.html fails with: `TEST-UNEXPECTED-FAIL | /dom/traversal/TreeWalker-acceptNode-filter-cross-realm-null-browsing-context.html | TreeWalker: NodeFilter from detached iframe works as expected - NodeIterator.nextNode: Refusing to execute function from global in which script is disabled.`

For the TreeWalker case, it seems like the situation is that the NodeIterator is created in the iframe, which is then immediately removed, then a test is done to use the NodeIterator which is very definitely created inside the iframe's global (via a helper in the iframe's source file).  That's [these lines](https://searchfox.org/mozilla-pine/rev/180c581b0f823473f7681d1a6c73aaf7f9d048cf/browser/components/companion/services/workshop/src/clientapi/mail_folder.js#49-50).

And it seems like maybe the NodeIterator actually wants to try and work in that case, but because the node iterator takes the [filter function](https://searchfox.org/mozilla-central/rev/9028b0458cc1f432870d2996b186b0938dda734a/testing/web-platform/tests/dom/traversal/support/TreeWalker-acceptNode-filter-cross-realm-null-browsing-context-subframe.html#5-8) we need to run code in the not fully active document, and we fail there.  This also seems like the fix is likely correctly forbidding that.
Replicating some of my comments to :annevk in slack here too, but I think the key thing is that I mis-characterized these failures as indicating this would be a major regression in our behavior, when the reality is that there are two tests that seem to be broken per spec.

(In reply to Andrew Sutherland [:asuth] (he/him) from comment #20)
> 2. https://searchfox.org/mozilla-central/source/testing/web-platform/tests/dom/traversal/TreeWalker-acceptNode-filter-cross-realm-null-browsing-context.html fails with: `TEST-UNEXPECTED-FAIL | /dom/traversal/TreeWalker-acceptNode-filter-cross-realm-null-browsing-context.html | TreeWalker: NodeFilter from detached iframe works as expected - NodeIterator.nextNode: Refusing to execute function from global in which script is disabled.`

For the TreeWalker case, it seems like the situation is that the NodeIterator is created in the iframe, which is then immediately removed, then a test is done to use the NodeIterator which is very definitely created inside the iframe's global (via a helper in the iframe's source file).  That's [these lines](https://searchfox.org/mozilla-pine/rev/180c581b0f823473f7681d1a6c73aaf7f9d048cf/browser/components/companion/services/workshop/src/clientapi/mail_folder.js#49-50).

And it seems like maybe the NodeIterator actually wants to try and work in that case, but because the node iterator takes the [filter function that's definitely created in the iframe global and definitely executed in the iframe global](https://searchfox.org/mozilla-central/rev/9028b0458cc1f432870d2996b186b0938dda734a/testing/web-platform/tests/dom/traversal/support/TreeWalker-acceptNode-filter-cross-realm-null-browsing-context-subframe.html#5-8) we need to run code in the not fully active document, and we fail there.  This also seems like the fix is likely correctly forbidding that.

Back to Bug 1740534 Comment 23