<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Changing border color and size simultaneously fails to repaint"
   href="https://bugs.webkit.org/show_bug.cgi?id=157967#c3">Comment # 3</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Changing border color and size simultaneously fails to repaint"
   href="https://bugs.webkit.org/show_bug.cgi?id=157967">bug 157967</a>
              from <span class="vcard"><a class="email" href="mailto:zalan&#64;apple.com" title="zalan &lt;zalan&#64;apple.com&gt;"> <span class="fn">zalan</span></a>
</span></b>
        <pre>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
&#64;&#64; -594,6 +594,14 &#64;&#64; void RenderTable::layout()
     clearNeedsLayout();
 }

+static inline void markCellDirtyWhenCollapsedBorderChanges(RenderTableCell* cell)
+{
+    if (!cell)
+        return;
+    cell-&gt;invalidateHasEmptyCollapsedBorders();
+    cell-&gt;setNeedsLayoutAndPrefWidthsRecalc();
+}
+
 void RenderTable::invalidateCollapsedBorders(RenderTableCell* cellWithStyleChange)
 {
     m_collapsedBordersValid = false;
&#64;&#64; -608,14 +616,10 &#64;&#64; void RenderTable::invalidateCollapsedBorders(RenderTableCell* cellWithStyleChang
     if (cellWithStyleChange) {
         // It is enough to invalidate just the surrounding cells when cell border style changes.
         cellWithStyleChange-&gt;invalidateHasEmptyCollapsedBorders();
-        if (auto* below = cellBelow(cellWithStyleChange))
-            below-&gt;invalidateHasEmptyCollapsedBorders();
-        if (auto* above = cellAbove(cellWithStyleChange))
-            above-&gt;invalidateHasEmptyCollapsedBorders();
-        if (auto* before = cellBefore(cellWithStyleChange))
-            before-&gt;invalidateHasEmptyCollapsedBorders();
-        if (auto* after = cellAfter(cellWithStyleChange))
-            after-&gt;invalidateHasEmptyCollapsedBorders();
+        markCellDirtyWhenCollapsedBorderChanges(cellBelow(cellWithStyleChange));
+        markCellDirtyWhenCollapsedBorderChanges(cellAbove(cellWithStyleChange));
+        markCellDirtyWhenCollapsedBorderChanges(cellBefore(cellWithStyleChange));
+        markCellDirtyWhenCollapsedBorderChanges(cellAfter(cellWithStyleChange));
         return;
     }</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>