Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 4d60710e3813177c975e9b8a632555ad105ec3ca
https://github.com/WebKit/WebKit/commit/4d60710e3813177c975e9b8a632555ad105ec3ca
Author: Ahmad Saleem <[email protected]>
Date: 2026-08-17 (Mon, 17 Aug 2026)
Changed paths:
M Source/WebCore/rendering/RenderTable.cpp
M Source/WebCore/rendering/RenderTable.h
Log Message:
-----------
Deduplicate the collapsed-border painting pass loop between paintObject() and
paintCollapsedBordersForRow()
https://bugs.webkit.org/show_bug.cgi?id=321905
rdar://185078582
Reviewed by Simon Fraser.
RenderTable::paintObject() and RenderTable::paintCollapsedBordersForRow() both
implement the same collapsed-border painting protocol: recalculate the collapsed
borders, make a PaintInfo copy in PaintPhase::CollapsedTableBorders, then do one
pass per cached border value from lowest to highest precedence with
m_currentBorder pointing at the border being painted, and finally clear
m_currentBorder. Only the innermost step differs: paintObject() walks the
sections bottom-up, while paintCollapsedBordersForRow() walks the row's cells.
Move the shared part into a paintCollapsedBorderPasses() helper that takes the
per-pass painting work as a NOESCAPE callable, so the m_currentBorder lifecycle
exists in one place instead of two. Both instantiations are in RenderTable.cpp,
so the template is defined there.
paintObject() previously mutated its own PaintInfo's phase in place rather than
copying; the copy is equivalent because that PaintInfo is not used again
afterwards (the outline paint below it uses the original paintInfo). The pass
loop also becomes a range-for over m_collapsedBorders instead of an index loop.
No change in behavior.
* Source/WebCore/rendering/RenderTable.cpp:
(WebCore::RenderTable::paintObject):
(WebCore::RenderTable::paintCollapsedBorderPasses):
(WebCore::RenderTable::paintCollapsedBordersForRow):
* Source/WebCore/rendering/RenderTable.h:
Canonical link: https://commits.webkit.org/319312@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications