Bug 1575138 - Do not schedule reconstruction for <slot> if there's no fallback. r=smaug
Just realized that we probably want this too. Differential Revision: https://phabricator.services.mozilla.com/D46898
This commit is contained in:
@@ -638,7 +638,8 @@ void ShadowRoot::MaybeSlotHostChild(nsIContent& aChild) {
|
||||
}
|
||||
|
||||
// Fallback content will go away, let layout know.
|
||||
if (assignment.mSlot->AssignedNodes().IsEmpty()) {
|
||||
if (assignment.mSlot->AssignedNodes().IsEmpty() &&
|
||||
assignment.mSlot->HasChildren()) {
|
||||
InvalidateStyleAndLayoutOnSubtree(assignment.mSlot);
|
||||
}
|
||||
|
||||
|
||||
@@ -2860,7 +2860,7 @@ void PresShell::SlotAssignmentWillChange(Element& aElement,
|
||||
if (aNewSlot) {
|
||||
// If the new slot will stop showing fallback content, we need to reframe it
|
||||
// altogether.
|
||||
if (aNewSlot->AssignedNodes().IsEmpty()) {
|
||||
if (aNewSlot->AssignedNodes().IsEmpty() && aNewSlot->HasChildren()) {
|
||||
DestroyFramesForAndRestyle(aNewSlot);
|
||||
// Otherwise we just care about the element, but we need to ensure that
|
||||
// something takes care of traversing to the relevant slot, if needed.
|
||||
|
||||
Reference in New Issue
Block a user