Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 76bf3bb6fcdfad5013fd389e8d2c72eaaf65e426
https://github.com/WebKit/WebKit/commit/76bf3bb6fcdfad5013fd389e8d2c72eaaf65e426
Author: Nipun Shukla <[email protected]>
Date: 2026-09-14 (Mon, 14 Sep 2026)
Changed paths:
M Source/WebCore/rendering/LayerOverlapMap.cpp
Log Message:
-----------
LayerOverlapMap stores redundant rects, making overlap tests slower than
necessary
rdar://177552669
Reviewed by Simon Fraser.
RectList::intersects() walks the whole list to determine overlap
and RectList::append() adds all rects passed in. On pages with
many layers the vector grows large and is largely redundant.
A rect that is fully contained by a rect already in the list
will not change the answer because anything intersecting the contained
rect also intersects its container.
append() now returns early when the incoming rect is contained in
one of the four most recently added rects and drops any recent rects
that the incoming rect covers.
This patch should not cause any behavior change and as such is covered
by existing tests.
* Source/WebCore/rendering/LayerOverlapMap.cpp:
(WebCore::rectArea):
(WebCore::RectList::isAlreadyCovered const):
(WebCore::RectList::append):
(WebCore::RectList::removeRecentRectsCoveredBy):
Canonical link: https://commits.webkit.org/321076@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications