[Webkit-unassigned] [Bug 157967] Changing border color and size simultaneously fails to repaint

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat May 21 13:04:24 PDT 2016


https://bugs.webkit.org/show_bug.cgi?id=157967

--- Comment #3 from zalan <zalan at apple.com> ---
I wonder how common this collapse border related style change is as now with this fix, we do a lot more work.

diff --git a/Source/WebCore/rendering/RenderTable.cpp b/Source/WebCore/rendering/RenderTable.cpp
index d8a8d6e..f6289b6 100644
--- a/Source/WebCore/rendering/RenderTable.cpp
+++ b/Source/WebCore/rendering/RenderTable.cpp
@@ -594,6 +594,14 @@ void RenderTable::layout()
     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 @@ void RenderTable::invalidateCollapsedBorders(RenderTableCell* cellWithStyleChang
     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;
     }

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20160521/efb56227/attachment.html>


More information about the webkit-unassigned mailing list