Title: [201312] trunk
Revision
201312
Author
[email protected]
Date
2016-05-23 18:53:17 -0700 (Mon, 23 May 2016)

Log Message

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: trunk/LayoutTests/ChangeLog (201311 => 201312)


--- trunk/LayoutTests/ChangeLog	2016-05-24 01:50:42 UTC (rev 201311)
+++ trunk/LayoutTests/ChangeLog	2016-05-24 01:53:17 UTC (rev 201312)
@@ -1,3 +1,16 @@
+2016-05-23  Zalan Bujtas  <[email protected]>
+
+        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-23  Jiewen Tan  <[email protected]>
 
         Null popstate event fired when navigating back to a cached page with a stateless history entry

Added: trunk/LayoutTests/fast/table/neighboring-cells-when-collapsed-border-changes-expected.html (0 => 201312)


--- trunk/LayoutTests/fast/table/neighboring-cells-when-collapsed-border-changes-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/table/neighboring-cells-when-collapsed-border-changes-expected.html	2016-05-24 01:53:17 UTC (rev 201312)
@@ -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 padding/content box of 'foo'.
+<table style="border-collapse: collapse;">
+<tr><td>foo</td><td id="topCell">bar</td></tr></table>
+</body>
+</html>

Added: trunk/LayoutTests/fast/table/neighboring-cells-when-collapsed-border-changes.html (0 => 201312)


--- trunk/LayoutTests/fast/table/neighboring-cells-when-collapsed-border-changes.html	                        (rev 0)
+++ trunk/LayoutTests/fast/table/neighboring-cells-when-collapsed-border-changes.html	2016-05-24 01:53:17 UTC (rev 201312)
@@ -0,0 +1,28 @@
+<!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 padding/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";
+    document.body.offsetWidth;
+    if (window.testRunner)
+        testRunner.notifyDone();
+}, 10);
+</script>
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (201311 => 201312)


--- trunk/Source/WebCore/ChangeLog	2016-05-24 01:50:42 UTC (rev 201311)
+++ trunk/Source/WebCore/ChangeLog	2016-05-24 01:53:17 UTC (rev 201312)
@@ -1,3 +1,19 @@
+2016-05-23  Zalan Bujtas  <[email protected]>
+
+        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-23  Chris Dumez  <[email protected]>
 
         Avoid unnecessary call to Document::completeURL() in HTMLLinkElement::process()

Modified: trunk/Source/WebCore/rendering/RenderTable.cpp (201311 => 201312)


--- trunk/Source/WebCore/rendering/RenderTable.cpp	2016-05-24 01:50:42 UTC (rev 201311)
+++ trunk/Source/WebCore/rendering/RenderTable.cpp	2016-05-24 01:53:17 UTC (rev 201312)
@@ -594,6 +594,14 @@
     clearNeedsLayout();
 }
 
+static inline void markCellDirtyWhenCollapsedBorderChanges(RenderTableCell* cell)
+{
+    if (!cell)
+        return;
+    cell->invalidateHasEmptyCollapsedBorders();
+    cell->setNeedsLayoutAndPrefWidthsRecalc();
+}
+
 void RenderTable::invalidateCollapsedBorders(RenderTableCell* cellWithStyleChange)
 {
     m_collapsedBordersValid = false;
@@ -608,14 +616,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
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to