Title: [222168] trunk
Revision
222168
Author
[email protected]
Date
2017-09-18 11:26:57 -0700 (Mon, 18 Sep 2017)

Log Message

Always update display: contents styles in RenderTreeUpdater.
https://bugs.webkit.org/show_bug.cgi?id=177065

Patch by Emilio Cobos Álvarez <[email protected]> on 2017-09-18
Reviewed by Antti Koivisto.

Source/WebCore:

Otherwise we keep an old style around, making following style updates wrong.

Test: fast/css/display-contents-style-update.html

* style/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::updateElementRenderer):

LayoutTests:

* fast/css/display-contents-style-update-expected.html: Added.
* fast/css/display-contents-style-update.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (222167 => 222168)


--- trunk/LayoutTests/ChangeLog	2017-09-18 18:23:22 UTC (rev 222167)
+++ trunk/LayoutTests/ChangeLog	2017-09-18 18:26:57 UTC (rev 222168)
@@ -1,3 +1,13 @@
+2017-09-18  Emilio Cobos Álvarez  <[email protected]>
+
+        Always update display: contents styles in RenderTreeUpdater.
+        https://bugs.webkit.org/show_bug.cgi?id=177065
+
+        Reviewed by Antti Koivisto.
+
+        * fast/css/display-contents-style-update-expected.html: Added.
+        * fast/css/display-contents-style-update.html: Added.
+
 2017-09-18  Antti Koivisto  <[email protected]>
 
         Avoid style resolution when clearing focused element.

Modified: trunk/LayoutTests/editing/execCommand/justify-right-then-indent-with-problematic-body-expected.txt (222167 => 222168)


--- trunk/LayoutTests/editing/execCommand/justify-right-then-indent-with-problematic-body-expected.txt	2017-09-18 18:23:22 UTC (rev 222167)
+++ trunk/LayoutTests/editing/execCommand/justify-right-then-indent-with-problematic-body-expected.txt	2017-09-18 18:26:57 UTC (rev 222168)
@@ -1,3 +1,2 @@
 Pass.
 WebKit didn't Crash.
-

Added: trunk/LayoutTests/fast/css/display-contents-style-update-expected.html (0 => 222168)


--- trunk/LayoutTests/fast/css/display-contents-style-update-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css/display-contents-style-update-expected.html	2017-09-18 18:26:57 UTC (rev 222168)
@@ -0,0 +1,4 @@
+<!doctype html>
+<div style="color: green;">
+  Passes if the text is green and there's no border.
+</div>

Added: trunk/LayoutTests/fast/css/display-contents-style-update.html (0 => 222168)


--- trunk/LayoutTests/fast/css/display-contents-style-update.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css/display-contents-style-update.html	2017-09-18 18:26:57 UTC (rev 222168)
@@ -0,0 +1,15 @@
+<!doctype html>
+<div id="contents" style="display: contents; color: green; border: 10px solid red;">
+  <div>
+    Passes if the text is green and there's no border.
+  </div>
+</div>
+<script>
+document.body.offsetTop;
+
+let contents = document.getElementById("contents");
+
+contents.style.color = "red";
+document.body.offsetTop;
+contents.style.color = "green";
+</script>

Modified: trunk/Source/WebCore/ChangeLog (222167 => 222168)


--- trunk/Source/WebCore/ChangeLog	2017-09-18 18:23:22 UTC (rev 222167)
+++ trunk/Source/WebCore/ChangeLog	2017-09-18 18:26:57 UTC (rev 222168)
@@ -1,3 +1,17 @@
+2017-09-18  Emilio Cobos Álvarez  <[email protected]>
+
+        Always update display: contents styles in RenderTreeUpdater.
+        https://bugs.webkit.org/show_bug.cgi?id=177065
+
+        Reviewed by Antti Koivisto.
+
+        Otherwise we keep an old style around, making following style updates wrong.
+
+        Test: fast/css/display-contents-style-update.html
+
+        * style/RenderTreeUpdater.cpp:
+        (WebCore::RenderTreeUpdater::updateElementRenderer):
+
 2017-09-18  Antti Koivisto  <[email protected]>
 
         Avoid style resolution when clearing focused element.

Modified: trunk/Source/WebCore/style/RenderTreeUpdater.cpp (222167 => 222168)


--- trunk/Source/WebCore/style/RenderTreeUpdater.cpp	2017-09-18 18:23:22 UTC (rev 222167)
+++ trunk/Source/WebCore/style/RenderTreeUpdater.cpp	2017-09-18 18:26:57 UTC (rev 222168)
@@ -314,12 +314,10 @@
     }
 
     bool hasDisplayContents = update.style->display() == CONTENTS;
-    if (hasDisplayContents != element.hasDisplayContents()) {
-        if (!hasDisplayContents)
-            element.resetComputedStyle();
-        else
-            element.storeDisplayContentsStyle(RenderStyle::clonePtr(*update.style));
-    }
+    if (hasDisplayContents)
+        element.storeDisplayContentsStyle(RenderStyle::clonePtr(*update.style));
+    else
+        element.resetComputedStyle();
 
     bool shouldCreateNewRenderer = !element.renderer() && !hasDisplayContents;
     if (shouldCreateNewRenderer) {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to