Title: [204761] releases/WebKitGTK/webkit-2.12
Revision
204761
Author
carlo...@webkit.org
Date
2016-08-22 23:22:58 -0700 (Mon, 22 Aug 2016)

Log Message

Merge r201296 - Changing border color and size simultaneously fails to repaint.
https://bugs.webkit.org/show_bug.cgi?id=157967
<rdar://problem/26423918>

Reviewed by David Hyatt.

This patch ensures that the neighboring tables cells are dirtied when collapsed border change requires layout.

Source/WebCore:

Test: fast/table/neighboring-cells-when-collapsed-border-changes.html

* rendering/RenderTable.cpp:
(WebCore::markCellDirtyWhenCollapsedBorderChanges):
(WebCore::RenderTable::invalidateCollapsedBorders):

LayoutTests:

* fast/table/neighboring-cells-when-collapsed-border-changes-expected.html: Added.
* fast/table/neighboring-cells-when-collapsed-border-changes.html: Added.

Modified Paths

Added Paths

Diff

Modified: releases/WebKitGTK/webkit-2.12/LayoutTests/ChangeLog (204760 => 204761)


--- releases/WebKitGTK/webkit-2.12/LayoutTests/ChangeLog	2016-08-23 06:19:01 UTC (rev 204760)
+++ releases/WebKitGTK/webkit-2.12/LayoutTests/ChangeLog	2016-08-23 06:22:58 UTC (rev 204761)
@@ -1,3 +1,16 @@
+2016-05-23  Zalan Bujtas  <za...@apple.com>
+
+        Changing border color and size simultaneously fails to repaint.
+        https://bugs.webkit.org/show_bug.cgi?id=157967
+        <rdar://problem/26423918>
+
+        Reviewed by David Hyatt.
+
+        This patch ensures that the neighboring tables cells are dirtied when collapsed border change requires layout.
+
+        * fast/table/neighboring-cells-when-collapsed-border-changes-expected.html: Added.
+        * fast/table/neighboring-cells-when-collapsed-border-changes.html: Added.
+
 2016-05-20  Zalan Bujtas  <za...@apple.com>
 
         `width: 1%` on nested table cell causes its table to hog horizontal space

Added: releases/WebKitGTK/webkit-2.12/LayoutTests/fast/table/neighboring-cells-when-collapsed-border-changes-expected.html (0 => 204761)


--- releases/WebKitGTK/webkit-2.12/LayoutTests/fast/table/neighboring-cells-when-collapsed-border-changes-expected.html	                        (rev 0)
+++ releases/WebKitGTK/webkit-2.12/LayoutTests/fast/table/neighboring-cells-when-collapsed-border-changes-expected.html	2016-08-23 06:22:58 UTC (rev 204761)
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>This tests that we relayout neighboring cells when collapsed border changes.</title>
+<style>
+#topCell { 
+    border-left-width: 150px;
+    border-left-style: solid;
+    border-left-color: blue;
+}
+</style>
+</head>
+<body>
+PASS if the blue border does not cover the paddin/content box of 'foo'.
+<table style="border-collapse: collapse;">
+<tr><td>foo</td><td id="topCell">bar</td></tr></table>
+</body>
+</html>

Added: releases/WebKitGTK/webkit-2.12/LayoutTests/fast/table/neighboring-cells-when-collapsed-border-changes.html (0 => 204761)


--- releases/WebKitGTK/webkit-2.12/LayoutTests/fast/table/neighboring-cells-when-collapsed-border-changes.html	                        (rev 0)
+++ releases/WebKitGTK/webkit-2.12/LayoutTests/fast/table/neighboring-cells-when-collapsed-border-changes.html	2016-08-23 06:22:58 UTC (rev 204761)
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>This tests that we relayout neighboring cells when collapsed border changes.</title>
+<style>
+#topCell { 
+    border-left-width: 100px;
+    border-left-style: solid;
+    border-left-color: blue;
+}
+</style>
+</head>
+<body>
+PASS if the blue border does not cover the paddin/content box of 'foo'.
+<table style="border-collapse: collapse;">
+<tr><td>foo</td><td id="topCell">bar</td></tr></table>
+<script>
+if (window.testRunner)
+    testRunner.waitUntilDone();
+setTimeout(function() {
+    document.getElementById('topCell').style.borderLeftWidth = "150px";
+    if (window.testRunner)
+        testRunner.notifyDone();
+}, 10);
+</script>
+</body>
+</html>

Modified: releases/WebKitGTK/webkit-2.12/Source/WebCore/ChangeLog (204760 => 204761)


--- releases/WebKitGTK/webkit-2.12/Source/WebCore/ChangeLog	2016-08-23 06:19:01 UTC (rev 204760)
+++ releases/WebKitGTK/webkit-2.12/Source/WebCore/ChangeLog	2016-08-23 06:22:58 UTC (rev 204761)
@@ -1,3 +1,19 @@
+2016-05-23  Zalan Bujtas  <za...@apple.com>
+
+        Changing border color and size simultaneously fails to repaint.
+        https://bugs.webkit.org/show_bug.cgi?id=157967
+        <rdar://problem/26423918>
+
+        Reviewed by David Hyatt.
+
+        This patch ensures that the neighboring tables cells are dirtied when collapsed border change requires layout.
+
+        Test: fast/table/neighboring-cells-when-collapsed-border-changes.html
+
+        * rendering/RenderTable.cpp:
+        (WebCore::markCellDirtyWhenCollapsedBorderChanges):
+        (WebCore::RenderTable::invalidateCollapsedBorders):
+
 2016-05-20  Zalan Bujtas  <za...@apple.com>
 
         `width: 1%` on nested table cell causes its table to hog horizontal space

Modified: releases/WebKitGTK/webkit-2.12/Source/WebCore/rendering/RenderTable.cpp (204760 => 204761)


--- releases/WebKitGTK/webkit-2.12/Source/WebCore/rendering/RenderTable.cpp	2016-08-23 06:19:01 UTC (rev 204760)
+++ releases/WebKitGTK/webkit-2.12/Source/WebCore/rendering/RenderTable.cpp	2016-08-23 06:22:58 UTC (rev 204761)
@@ -597,6 +597,14 @@
     clearNeedsLayout();
 }
 
+static inline void markCellDirtyWhenCollapsedBorderChanges(RenderTableCell* cell)
+{
+    if (!cell)
+        return;
+    cell->invalidateHasEmptyCollapsedBorders();
+    cell->setNeedsLayoutAndPrefWidthsRecalc();
+}
+
 void RenderTable::invalidateCollapsedBorders(RenderTableCell* cellWithStyleChange)
 {
     m_collapsedBordersValid = false;
@@ -611,14 +619,10 @@
     if (cellWithStyleChange) {
         // It is enough to invalidate just the surrounding cells when cell border style changes.
         cellWithStyleChange->invalidateHasEmptyCollapsedBorders();
-        if (auto* below = cellBelow(cellWithStyleChange))
-            below->invalidateHasEmptyCollapsedBorders();
-        if (auto* above = cellAbove(cellWithStyleChange))
-            above->invalidateHasEmptyCollapsedBorders();
-        if (auto* before = cellBefore(cellWithStyleChange))
-            before->invalidateHasEmptyCollapsedBorders();
-        if (auto* after = cellAfter(cellWithStyleChange))
-            after->invalidateHasEmptyCollapsedBorders();
+        markCellDirtyWhenCollapsedBorderChanges(cellBelow(cellWithStyleChange));
+        markCellDirtyWhenCollapsedBorderChanges(cellAbove(cellWithStyleChange));
+        markCellDirtyWhenCollapsedBorderChanges(cellBefore(cellWithStyleChange));
+        markCellDirtyWhenCollapsedBorderChanges(cellAfter(cellWithStyleChange));
         return;
     }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to