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

Log Message

Merge r201346 - fast/table/neighboring-cells-when-collapsed-border-changes.html is flaky.
https://bugs.webkit.org/show_bug.cgi?id=158009

Reviewed by David Hyatt.

RenderTable::invalidateCollapsedBorders() early returns on m_collapsedEmptyBorderIsPresent
which prevents us from marking neighboring cells dirty when style changes.
Decouple the "invalidate the collapsed borders" and the "mark the neighboring cells dirty" logic.

Source/WebCore:

Covered by existing tests. (and now we agree with FF on cached-change-cell-border-width.html)

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

LayoutTests:

* fast/table/border-collapsing/cached-change-cell-border-width-expected.txt: Progression. FF agrees.
* fast/table/neighboring-cells-when-collapsed-border-changes.html:
* platform/ios-simulator-wk1/fast/table/border-collapsing/cached-change-cell-border-width-expected.txt:
* platform/mac-wk1/TestExpectations:
* platform/mac/fast/table/border-collapsing/cached-change-cell-border-width-expected.txt:

Modified Paths

Diff

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


--- releases/WebKitGTK/webkit-2.12/LayoutTests/ChangeLog	2016-08-23 06:22:58 UTC (rev 204761)
+++ releases/WebKitGTK/webkit-2.12/LayoutTests/ChangeLog	2016-08-23 06:24:40 UTC (rev 204762)
@@ -1,3 +1,20 @@
+2016-05-24  Zalan Bujtas  <za...@apple.com>
+
+        fast/table/neighboring-cells-when-collapsed-border-changes.html is flaky.
+        https://bugs.webkit.org/show_bug.cgi?id=158009
+
+        Reviewed by David Hyatt.
+
+        RenderTable::invalidateCollapsedBorders() early returns on m_collapsedEmptyBorderIsPresent
+        which prevents us from marking neighboring cells dirty when style changes.
+        Decouple the "invalidate the collapsed borders" and the "mark the neighboring cells dirty" logic.
+
+        * fast/table/border-collapsing/cached-change-cell-border-width-expected.txt: Progression. FF agrees.
+        * fast/table/neighboring-cells-when-collapsed-border-changes.html:
+        * platform/ios-simulator-wk1/fast/table/border-collapsing/cached-change-cell-border-width-expected.txt:
+        * platform/mac-wk1/TestExpectations:
+        * platform/mac/fast/table/border-collapsing/cached-change-cell-border-width-expected.txt:
+
 2016-05-23  Zalan Bujtas  <za...@apple.com>
 
         Changing border color and size simultaneously fails to repaint.

Modified: releases/WebKitGTK/webkit-2.12/LayoutTests/fast/table/border-collapsing/cached-change-cell-border-width-expected.txt (204761 => 204762)


--- releases/WebKitGTK/webkit-2.12/LayoutTests/fast/table/border-collapsing/cached-change-cell-border-width-expected.txt	2016-08-23 06:22:58 UTC (rev 204761)
+++ releases/WebKitGTK/webkit-2.12/LayoutTests/fast/table/border-collapsing/cached-change-cell-border-width-expected.txt	2016-08-23 06:24:40 UTC (rev 204762)
@@ -3,8 +3,8 @@
 layer at (0,0) size 800x600
   RenderBlock {HTML} at (0,0) size 800x600
     RenderBody {BODY} at (8,8) size 784x584
-      RenderTable {TABLE} at (0,0) size 113x54 [border: (2px solid #0000FF)]
-        RenderTableSection {TBODY} at (2,2) size 110x50
-          RenderTableRow {TR} at (0,0) size 110x50
-            RenderTableCell {TD} at (0,22) size 55x6 [border: (2px solid #00FF00)] [r=0 c=0 rs=1 cs=1]
-            RenderTableCell {TD} at (55,23) size 55x4 [border: (1px solid #000000)] [r=0 c=1 rs=1 cs=1]
+      RenderTable {TABLE} at (0,0) size 114x54 [border: (2px solid #0000FF)]
+        RenderTableSection {TBODY} at (2,2) size 111x50
+          RenderTableRow {TR} at (0,0) size 111x50
+            RenderTableCell {TD} at (0,22) size 56x6 [border: (2px solid #00FF00)] [r=0 c=0 rs=1 cs=1]
+            RenderTableCell {TD} at (56,23) size 55x4 [border: (1px solid #000000)] [r=0 c=1 rs=1 cs=1]

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


--- releases/WebKitGTK/webkit-2.12/LayoutTests/fast/table/neighboring-cells-when-collapsed-border-changes.html	2016-08-23 06:22:58 UTC (rev 204761)
+++ releases/WebKitGTK/webkit-2.12/LayoutTests/fast/table/neighboring-cells-when-collapsed-border-changes.html	2016-08-23 06:24:40 UTC (rev 204762)
@@ -21,7 +21,7 @@
     document.getElementById('topCell').style.borderLeftWidth = "150px";
     if (window.testRunner)
         testRunner.notifyDone();
-}, 10);
+}, 0);
 </script>
 </body>
 </html>

Modified: releases/WebKitGTK/webkit-2.12/LayoutTests/platform/ios-simulator-wk1/fast/table/border-collapsing/cached-change-cell-border-width-expected.txt (204761 => 204762)


--- releases/WebKitGTK/webkit-2.12/LayoutTests/platform/ios-simulator-wk1/fast/table/border-collapsing/cached-change-cell-border-width-expected.txt	2016-08-23 06:22:58 UTC (rev 204761)
+++ releases/WebKitGTK/webkit-2.12/LayoutTests/platform/ios-simulator-wk1/fast/table/border-collapsing/cached-change-cell-border-width-expected.txt	2016-08-23 06:24:40 UTC (rev 204762)
@@ -7,4 +7,4 @@
         RenderTableSection {TBODY} at (2,2) size 111x50
           RenderTableRow {TR} at (0,0) size 111x50
             RenderTableCell {TD} at (0,22) size 56x6 [border: (2px solid #00FF00)] [r=0 c=0 rs=1 cs=1]
-            RenderTableCell {TD} at (55,23) size 56x4 [border: (1px solid #000000)] [r=0 c=1 rs=1 cs=1]
+            RenderTableCell {TD} at (56,23) size 55x4 [border: (1px solid #000000)] [r=0 c=1 rs=1 cs=1]

Modified: releases/WebKitGTK/webkit-2.12/LayoutTests/platform/mac/fast/table/border-collapsing/cached-change-cell-border-width-expected.txt (204761 => 204762)


--- releases/WebKitGTK/webkit-2.12/LayoutTests/platform/mac/fast/table/border-collapsing/cached-change-cell-border-width-expected.txt	2016-08-23 06:22:58 UTC (rev 204761)
+++ releases/WebKitGTK/webkit-2.12/LayoutTests/platform/mac/fast/table/border-collapsing/cached-change-cell-border-width-expected.txt	2016-08-23 06:24:40 UTC (rev 204762)
@@ -3,8 +3,8 @@
 layer at (0,0) size 800x600
   RenderBlock {HTML} at (0,0) size 800x600
     RenderBody {BODY} at (8,8) size 784x584
-      RenderTable {TABLE} at (0,0) size 113x54 [border: (2px solid #0000FF)]
-        RenderTableSection {TBODY} at (2,2) size 110x50
-          RenderTableRow {TR} at (0,0) size 110x50
+      RenderTable {TABLE} at (0,0) size 114x54 [border: (2px solid #0000FF)]
+        RenderTableSection {TBODY} at (2,2) size 111x50
+          RenderTableRow {TR} at (0,0) size 111x50
             RenderTableCell {TD} at (0,22) size 56x6 [border: (2px solid #00FF00)] [r=0 c=0 rs=1 cs=1]
-            RenderTableCell {TD} at (55,23) size 56x4 [border: (1px solid #000000)] [r=0 c=1 rs=1 cs=1]
+            RenderTableCell {TD} at (56,23) size 55x4 [border: (1px solid #000000)] [r=0 c=1 rs=1 cs=1]

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


--- releases/WebKitGTK/webkit-2.12/Source/WebCore/ChangeLog	2016-08-23 06:22:58 UTC (rev 204761)
+++ releases/WebKitGTK/webkit-2.12/Source/WebCore/ChangeLog	2016-08-23 06:24:40 UTC (rev 204762)
@@ -1,3 +1,23 @@
+2016-05-24  Zalan Bujtas  <za...@apple.com>
+
+        fast/table/neighboring-cells-when-collapsed-border-changes.html is flaky.
+        https://bugs.webkit.org/show_bug.cgi?id=158009
+
+        Reviewed by David Hyatt.
+
+        RenderTable::invalidateCollapsedBorders() early returns on m_collapsedEmptyBorderIsPresent
+        which prevents us from marking neighboring cells dirty when style changes.
+        Decouple the "invalidate the collapsed borders" and the "mark the neighboring cells dirty" logic.
+
+        Covered by existing tests. (and now we agree with FF on cached-change-cell-border-width.html)
+
+        * rendering/RenderTable.cpp:
+        (WebCore::RenderTable::invalidateCollapsedBorders):
+        (WebCore::markCellDirtyWhenCollapsedBorderChanges): Deleted.
+        * rendering/RenderTableCell.cpp:
+        (WebCore::markCellDirtyWhenCollapsedBorderChanges):
+        (WebCore::RenderTableCell::styleDidChange):
+
 2016-05-23  Zalan Bujtas  <za...@apple.com>
 
         Changing border color and size simultaneously fails to repaint.

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


--- releases/WebKitGTK/webkit-2.12/Source/WebCore/rendering/RenderTable.cpp	2016-08-23 06:22:58 UTC (rev 204761)
+++ releases/WebKitGTK/webkit-2.12/Source/WebCore/rendering/RenderTable.cpp	2016-08-23 06:24:40 UTC (rev 204762)
@@ -597,14 +597,6 @@
     clearNeedsLayout();
 }
 
-static inline void markCellDirtyWhenCollapsedBorderChanges(RenderTableCell* cell)
-{
-    if (!cell)
-        return;
-    cell->invalidateHasEmptyCollapsedBorders();
-    cell->setNeedsLayoutAndPrefWidthsRecalc();
-}
-
 void RenderTable::invalidateCollapsedBorders(RenderTableCell* cellWithStyleChange)
 {
     m_collapsedBordersValid = false;
@@ -619,10 +611,14 @@
     if (cellWithStyleChange) {
         // It is enough to invalidate just the surrounding cells when cell border style changes.
         cellWithStyleChange->invalidateHasEmptyCollapsedBorders();
-        markCellDirtyWhenCollapsedBorderChanges(cellBelow(cellWithStyleChange));
-        markCellDirtyWhenCollapsedBorderChanges(cellAbove(cellWithStyleChange));
-        markCellDirtyWhenCollapsedBorderChanges(cellBefore(cellWithStyleChange));
-        markCellDirtyWhenCollapsedBorderChanges(cellAfter(cellWithStyleChange));
+        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();
         return;
     }
 

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


--- releases/WebKitGTK/webkit-2.12/Source/WebCore/rendering/RenderTableCell.cpp	2016-08-23 06:22:58 UTC (rev 204761)
+++ releases/WebKitGTK/webkit-2.12/Source/WebCore/rendering/RenderTableCell.cpp	2016-08-23 06:24:40 UTC (rev 204762)
@@ -404,6 +404,13 @@
     return firstLineBaseline().valueOr(borderAndPaddingBefore() + contentLogicalHeight());
 }
 
+static inline void markCellDirtyWhenCollapsedBorderChanges(RenderTableCell* cell)
+{
+    if (!cell)
+        return;
+    cell->setNeedsLayoutAndPrefWidthsRecalc();
+}
+
 void RenderTableCell::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
 {
     ASSERT(style().display() == TABLE_CELL);
@@ -422,8 +429,15 @@
 
     // If border was changed, notify table.
     RenderTable* table = this->table();
-    if (table && oldStyle && oldStyle->border() != style().border())
+    if (table && oldStyle && oldStyle->border() != style().border()) {
         table->invalidateCollapsedBorders(this);
+        if (table->collapseBorders() && diff == StyleDifferenceLayout) {
+            markCellDirtyWhenCollapsedBorderChanges(table->cellBelow(this));
+            markCellDirtyWhenCollapsedBorderChanges(table->cellAbove(this));
+            markCellDirtyWhenCollapsedBorderChanges(table->cellBefore(this));
+            markCellDirtyWhenCollapsedBorderChanges(table->cellAfter(this));
+        }
+    }
 }
 
 // The following rules apply for resolving conflicts and figuring out which border
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to