Title: [243444] trunk
Revision
243444
Author
[email protected]
Date
2019-03-25 11:27:55 -0700 (Mon, 25 Mar 2019)

Log Message

Toggling "display: contents" to "display: none" fails to hide the element
https://bugs.webkit.org/show_bug.cgi?id=188259
<rdar://problem/42886896>

Reviewed by Simon Fraser.

Source/WebCore:

Test: fast/css/display-contents-to-none.html

* style/StyleTreeResolver.cpp:
(WebCore::Style::affectsRenderedSubtree):

An element with 'display:contents' has a rendered subtree.

LayoutTests:

* fast/css/display-contents-to-none-expected.html: Added.
* fast/css/display-contents-to-none.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (243443 => 243444)


--- trunk/LayoutTests/ChangeLog	2019-03-25 18:26:10 UTC (rev 243443)
+++ trunk/LayoutTests/ChangeLog	2019-03-25 18:27:55 UTC (rev 243444)
@@ -1,3 +1,14 @@
+2019-03-25  Antti Koivisto  <[email protected]>
+
+        Toggling "display: contents" to "display: none" fails to hide the element
+        https://bugs.webkit.org/show_bug.cgi?id=188259
+        <rdar://problem/42886896>
+
+        Reviewed by Simon Fraser.
+
+        * fast/css/display-contents-to-none-expected.html: Added.
+        * fast/css/display-contents-to-none.html: Added.
+
 2019-03-25  Diego Pino Garcia  <[email protected]>
 
         [GTK] Gardening, update expected results for several smart-delete-paragraph tests 

Added: trunk/LayoutTests/fast/css/display-contents-to-none-expected.html (0 => 243444)


--- trunk/LayoutTests/fast/css/display-contents-to-none-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css/display-contents-to-none-expected.html	2019-03-25 18:27:55 UTC (rev 243444)
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+<body>
+<p>This test passes if it doesn't say FAIL below.</p>
+</body>
+</html>

Added: trunk/LayoutTests/fast/css/display-contents-to-none.html (0 => 243444)


--- trunk/LayoutTests/fast/css/display-contents-to-none.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css/display-contents-to-none.html	2019-03-25 18:27:55 UTC (rev 243444)
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html>
+<body>
+<p>This test passes if it doesn't say FAIL below.</p>
+<div style="display: contents"><span>FAIL</span></div>
+<div style="display: contents">FAIL</div>
+<script>
+for (const div of document.querySelectorAll('div')) {
+    div.getBoundingClientRect();
+    div.style.display = 'none';
+}
+</script>
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (243443 => 243444)


--- trunk/Source/WebCore/ChangeLog	2019-03-25 18:26:10 UTC (rev 243443)
+++ trunk/Source/WebCore/ChangeLog	2019-03-25 18:27:55 UTC (rev 243444)
@@ -1,3 +1,18 @@
+2019-03-25  Antti Koivisto  <[email protected]>
+
+        Toggling "display: contents" to "display: none" fails to hide the element
+        https://bugs.webkit.org/show_bug.cgi?id=188259
+        <rdar://problem/42886896>
+
+        Reviewed by Simon Fraser.
+
+        Test: fast/css/display-contents-to-none.html
+
+        * style/StyleTreeResolver.cpp:
+        (WebCore::Style::affectsRenderedSubtree):
+
+        An element with 'display:contents' has a rendered subtree.
+
 2019-03-25  Justin Fan  <[email protected]>
 
         Update WebGPU class names based on sketch.idl

Modified: trunk/Source/WebCore/style/StyleTreeResolver.cpp (243443 => 243444)


--- trunk/Source/WebCore/style/StyleTreeResolver.cpp	2019-03-25 18:26:10 UTC (rev 243443)
+++ trunk/Source/WebCore/style/StyleTreeResolver.cpp	2019-03-25 18:27:55 UTC (rev 243444)
@@ -158,10 +158,10 @@
 
 static bool affectsRenderedSubtree(Element& element, const RenderStyle& newStyle)
 {
-    if (element.renderer())
-        return true;
     if (newStyle.display() != DisplayType::None)
         return true;
+    if (element.renderOrDisplayContentsStyle())
+        return true;
     if (element.rendererIsNeeded(newStyle))
         return true;
     return false;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to