Closed Bug 1383985 Opened 7 years ago Closed 7 years ago

stylo: Mutation observer is not invoked when anonymous child is added via changing display value

Categories

(Core :: CSS Parsing and Computation, defect, P2)

defect

Tracking

()

RESOLVED FIXED
mozilla57
Tracking Status
firefox57 --- fixed

People

(Reporter: xidorn, Assigned: hiro)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

See test dom/base/test/test_mutateobserver_anonymous.html. This test fails on the subtest "testAddedDueToDisplay", in which it waits for the mutation notification for creation of the pseudo elements after switching their parent from display: none to block.
This test needs MutationObserverInit.nativeAnonymousChildList, which is a ChromeOnly feature, so I suppose this doesn't affect web content. But I can see usage of this inside devtools, so I'm less sure whether this is something would block shipping, since it could regress devtools functionality.

ni? jryans for how important it is.
Flags: needinfo?(jryans)
(In reply to Xidorn Quan [:xidorn] UTC+10 from comment #1)
> This test needs MutationObserverInit.nativeAnonymousChildList, which is a
> ChromeOnly feature, so I suppose this doesn't affect web content. But I can
> see usage of this inside devtools, so I'm less sure whether this is
> something would block shipping, since it could regress devtools
> functionality.

(To clarify, the DOM test is actually named "dom/base/test/test_mutationobserver_anonymous.html".)

Hmm, this DOM test appears to pass for me locally with Stylo enabled on macOS (based on rev https://hg.mozilla.org/integration/autoland/rev/c4d89120f88d33aea7d41b217da5b79dfd376cb0).

Does it pass for you as well now?

DevTools does use `nativeAnonymousChildList` starting with bug 1208544 (~2 years ago) to watch pseudo mutations.  There is a DevTools test "devtools/client/markupview/test/browser_markupview_mutation_01.js" that was updated in that bug (since renamed to "devtools/client/inspector/markup/test/browser_markup_mutation_01.js"), and the test passes in Stylo.

It looks like most use cases are also covered by other mutation notifications to DevTools, such as "attribute" mutations.  DevTools also watches for reflows and manually scans for display changes, so it will send "display-changed" mutations of its own.  If there's still something wrong with `nativeAnonymousChildList`, let's investigate more deeply which cases in DevTools aren't covered by other mutation notifications.  (I tried to test locally, but I can't test accurately since I appear to have `nativeAnonymousChildList` working with Stylo.)
Flags: needinfo?(jryans) → needinfo?(xidorn+moz)
Priority: -- → P2
Yeah, it passes now. I think I could reproduce that failure locally, but today it passes. Probably it has been fixed somehow.
Status: NEW → RESOLVED
Closed: 7 years ago
Flags: needinfo?(xidorn+moz)
Resolution: --- → WORKSFORME
Well, it passes locally, but still doesn't on CI.

See https://treeherder.mozilla.org/#/jobs?repo=try&revision=b1f9504fbc383472969fd12d06f3017d635c0bfe&selectedJob=121303751

And it happens on both Linux and Mac.
Status: RESOLVED → REOPENED
Resolution: WORKSFORME → ---
Comment on attachment 8901713 [details]
Bug 1383985 - Enable test_mutationobserver_anonymous.html on stylo.

https://reviewboard.mozilla.org/r/173146/#review178794

r=me as far as it passes.
Attachment #8901713 - Flags: review?(xidorn+moz) → review+
Pushed by xquan@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/e64539ca6dbd
Enable test_mutationobserver_anonymous.html on stylo. r=xidorn
Assignee: nobody → hikezoe
https://hg.mozilla.org/mozilla-central/rev/e64539ca6dbd
Status: REOPENED → RESOLVED
Closed: 7 years ago7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla57
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: