mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-23 12:51:06 +00:00
Bug 1927714 - Missing style invalidation in ShadowRoot::AddSlot(). r=smaug, a=dmeehan
Usually RemoveSlot takes care of this, but if it's not the first slot it doesn't. Differential Revision: https://phabricator.services.mozilla.com/D227334
This commit is contained in:
parent
94aee03af5
commit
f8c0802719
@ -253,6 +253,8 @@ void ShadowRoot::AddSlot(HTMLSlotElement* aSlot) {
|
||||
return;
|
||||
}
|
||||
|
||||
InvalidateStyleAndLayoutOnSubtree(aSlot);
|
||||
|
||||
HTMLSlotElement* oldSlot = currentSlots->SafeElementAt(1);
|
||||
if (SlotAssignment() == SlotAssignmentMode::Named) {
|
||||
if (oldSlot) {
|
||||
|
@ -0,0 +1,15 @@
|
||||
<!doctype html>
|
||||
<div id="host">
|
||||
<template shadowrootmode="open">
|
||||
<slot></slot>
|
||||
<slot></slot>
|
||||
</template>
|
||||
<div id="child1">Child1</div>
|
||||
<div id="child2" slot="named-slot">Child2</div>
|
||||
</div>
|
||||
<script>
|
||||
host.getBoundingClientRect();
|
||||
host.shadowRoot.querySelectorAll("slot")[1].name = "named-slot";
|
||||
host.style.display = "flex";
|
||||
host.getBoundingClientRect();
|
||||
</script>
|
@ -0,0 +1,6 @@
|
||||
<!doctype html>
|
||||
<title>CSS Test Reference</title>
|
||||
<div id="host">
|
||||
<div>Child1</div>
|
||||
<div>Child2</div>
|
||||
</div>
|
@ -0,0 +1,20 @@
|
||||
<!doctype html>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Scoping: Dynamic reassignment of a named slot child.</title>
|
||||
<link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io">
|
||||
<link rel="help" href="https://drafts.csswg.org/css-scoping/#selectors-data-model">
|
||||
<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1927714">
|
||||
<link rel="match" href="shadow-reassign-dynamic-006-ref.html">
|
||||
<div id="host">
|
||||
<template shadowrootmode="open">
|
||||
<slot></slot>
|
||||
<slot></slot>
|
||||
</template>
|
||||
<div id="child1">Child1</div>
|
||||
<div id="child2" slot="named-slot">Child2</div>
|
||||
</div>
|
||||
<script>
|
||||
host.getBoundingClientRect();
|
||||
host.shadowRoot.querySelectorAll("slot")[1].name = "named-slot";
|
||||
host.getBoundingClientRect();
|
||||
</script>
|
Loading…
Reference in New Issue
Block a user