Title: [279721] trunk
- Revision
- 279721
- Author
- [email protected]
- Date
- 2021-07-08 07:47:34 -0700 (Thu, 08 Jul 2021)
Log Message
Shadow host stops rendering after removing a slot, updating style, then its assigned node
https://bugs.webkit.org/show_bug.cgi?id=227652
Reviewed by Alan Bujtas.
Source/WebCore:
Test: fast/shadow-dom/remove-slot-and-host-child.html
* dom/SlotAssignment.cpp:
(WebCore::SlotAssignment::didChangeSlot):
When we tear down the render tree we also need to request its rebuild unconditionally.
LayoutTests:
* fast/shadow-dom/remove-slot-and-host-child-expected.html: Added.
* fast/shadow-dom/remove-slot-and-host-child.html: Added.
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (279720 => 279721)
--- trunk/LayoutTests/ChangeLog 2021-07-08 11:46:21 UTC (rev 279720)
+++ trunk/LayoutTests/ChangeLog 2021-07-08 14:47:34 UTC (rev 279721)
@@ -1,3 +1,13 @@
+2021-07-08 Antti Koivisto <[email protected]>
+
+ Shadow host stops rendering after removing a slot, updating style, then its assigned node
+ https://bugs.webkit.org/show_bug.cgi?id=227652
+
+ Reviewed by Alan Bujtas.
+
+ * fast/shadow-dom/remove-slot-and-host-child-expected.html: Added.
+ * fast/shadow-dom/remove-slot-and-host-child.html: Added.
+
2021-07-08 Arcady Goldmints-Orlov <[email protected]>
[GLIB] Skip WebGL 2.0.y tests explicitly
Added: trunk/LayoutTests/fast/shadow-dom/remove-slot-and-host-child-expected.html (0 => 279721)
--- trunk/LayoutTests/fast/shadow-dom/remove-slot-and-host-child-expected.html (rev 0)
+++ trunk/LayoutTests/fast/shadow-dom/remove-slot-and-host-child-expected.html 2021-07-08 14:47:34 UTC (rev 279721)
@@ -0,0 +1 @@
+<div style="width: 100px; height: 100px; background: green;">
Added: trunk/LayoutTests/fast/shadow-dom/remove-slot-and-host-child.html (0 => 279721)
--- trunk/LayoutTests/fast/shadow-dom/remove-slot-and-host-child.html (rev 0)
+++ trunk/LayoutTests/fast/shadow-dom/remove-slot-and-host-child.html 2021-07-08 14:47:34 UTC (rev 279721)
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<html>
+<body>
+<style> div { width: 100px; height: 100px; } </style>
+<div id="container" style="background: red;">
+<div id="host" style="background: blue;"><div id="child">Some content (DOM)</div></div>
+</div>
+<script>
+
+const slotted = document.querySelector('#slotted');
+
+const shadowRoot = host.attachShadow({mode: 'closed'});
+shadowRoot.innerHTML = '<div style="width: 100px; height: 100px; background: green;"><slot></slot></div>';
+shadowRoot.querySelector('slot').remove();
+
+document.body.getBoundingClientRect();
+
+child.remove();
+
+document.body.getBoundingClientRect();
+
+</script>
+</body>
+</html>
Modified: trunk/Source/WebCore/ChangeLog (279720 => 279721)
--- trunk/Source/WebCore/ChangeLog 2021-07-08 11:46:21 UTC (rev 279720)
+++ trunk/Source/WebCore/ChangeLog 2021-07-08 14:47:34 UTC (rev 279721)
@@ -1,3 +1,17 @@
+2021-07-08 Antti Koivisto <[email protected]>
+
+ Shadow host stops rendering after removing a slot, updating style, then its assigned node
+ https://bugs.webkit.org/show_bug.cgi?id=227652
+
+ Reviewed by Alan Bujtas.
+
+ Test: fast/shadow-dom/remove-slot-and-host-child.html
+
+ * dom/SlotAssignment.cpp:
+ (WebCore::SlotAssignment::didChangeSlot):
+
+ When we tear down the render tree we also need to request its rebuild unconditionally.
+
2021-07-08 Per Arne <[email protected]>
Set Caption preferences in the UI process
Modified: trunk/Source/WebCore/dom/SlotAssignment.cpp (279720 => 279721)
--- trunk/Source/WebCore/dom/SlotAssignment.cpp 2021-07-08 11:46:21 UTC (rev 279720)
+++ trunk/Source/WebCore/dom/SlotAssignment.cpp 2021-07-08 14:47:34 UTC (rev 279721)
@@ -308,6 +308,7 @@
return;
RenderTreeUpdater::tearDownRenderers(*shadowRoot.host());
+ shadowRoot.host()->invalidateStyleAndRenderersForSubtree();
slot->assignedNodes.clear();
m_slotAssignmentsIsValid = false;
@@ -316,8 +317,6 @@
if (!slotElement)
return;
- shadowRoot.host()->invalidateStyleAndRenderersForSubtree();
-
if (shadowRoot.shouldFireSlotchangeEvent())
slotElement->enqueueSlotChangeEvent();
}
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes