Closed Bug 1548848 Opened 5 years ago Closed 5 years ago

Doesn't update assigned node for slots correctly in certain case

Categories

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

defect

Tracking

()

RESOLVED FIXED
mozilla68
Tracking Status
firefox68 --- fixed

People

(Reporter: edgar, Assigned: edgar)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

I found this issue while reviewing https://github.com/whatwg/dom/pull/695.

Here is the test script: https://software.hixie.ch/utilities/js/live-dom-viewer/?saved=6885

Expected result:
We should assign p with slot="assigned1" to slot with id="slot3"
after p in shadowRoot1 is removed.

Actual result:
We fall back to slotable child of slot3.

Blocks: shadowdom

And I got this assertion in debug build.

Assertion failure: content->GetFlattenedTreeParentNodeForStyle() (Node not in the flattened tree still has a frame?), at /Users/edgarchen/Workspace/mercurial/mozilla-central/layout/base/PresShell.cpp:3985
#01: AssertFrameSubtreeIsSane(nsIFrame const&)[/Users/edgarchen/Workspace/mercurial/mozilla-central/objdir-debug/dist/NightlyDebug.app/Contents/MacOS/XUL +0x663ecc1]
#02: AssertFrameSubtreeIsSane(nsIFrame const&)[/Users/edgarchen/Workspace/mercurial/mozilla-central/objdir-debug/dist/NightlyDebug.app/Contents/MacOS/XUL +0x663ed93]
#03: AssertFrameSubtreeIsSane(nsIFrame const&)[/Users/edgarchen/Workspace/mercurial/mozilla-central/objdir-debug/dist/NightlyDebug.app/Contents/MacOS/XUL +0x663ed93]
#04: AssertFrameSubtreeIsSane(nsIFrame const&)[/Users/edgarchen/Workspace/mercurial/mozilla-central/objdir-debug/dist/NightlyDebug.app/Contents/MacOS/XUL +0x663ed93]
#05: AssertFrameSubtreeIsSane(nsIFrame const&)[/Users/edgarchen/Workspace/mercurial/mozilla-central/objdir-debug/dist/NightlyDebug.app/Contents/MacOS/XUL +0x663ed93]
#06: AssertFrameSubtreeIsSane(nsIFrame const&)[/Users/edgarchen/Workspace/mercurial/mozilla-central/objdir-debug/dist/NightlyDebug.app/Contents/MacOS/XUL +0x663ed93]
#07: AssertFrameSubtreeIsSane(nsIFrame const&)[/Users/edgarchen/Workspace/mercurial/mozilla-central/objdir-debug/dist/NightlyDebug.app/Contents/MacOS/XUL +0x663ed93]
#08: AssertFrameSubtreeIsSane(nsIFrame const&)[/Users/edgarchen/Workspace/mercurial/mozilla-central/objdir-debug/dist/NightlyDebug.app/Contents/MacOS/XUL +0x663ed93]
#09: AssertFrameSubtreeIsSane(nsIFrame const&)[/Users/edgarchen/Workspace/mercurial/mozilla-central/objdir-debug/dist/NightlyDebug.app/Contents/MacOS/XUL +0x663ed93]
#10: AssertFrameTreeIsSane(mozilla::PresShell const&)[/Users/edgarchen/Workspace/mercurial/mozilla-central/objdir-debug/dist/NightlyDebug.app/Contents/MacOS/XUL +0x660362d]
...

Assignee: nobody → echen
Attached file reduced testcase

It looks like we probably need something similar like bug 1435632.

Pushed by echen@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/d6bc3bde65d6
Moving assigned nodes caused by slot removal should properly invalidate layout; r=emilio
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla68
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/16878 for changes under testing/web-platform/tests
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: