Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: defbb4f7ca8889021aba5a8320f44b8ded93dcee
https://github.com/WebKit/WebKit/commit/defbb4f7ca8889021aba5a8320f44b8ded93dcee
Author: Ahmad Saleem <[email protected]>
Date: 2026-07-12 (Sun, 12 Jul 2026)
Changed paths:
M Source/WebCore/svg/animation/SVGSMILElement.cpp
Log Message:
-----------
SVGSMILElement instance time lists accumulate duplicate entries from repeated
beginElementAt/endElementAt calls
https://bugs.webkit.org/show_bug.cgi?id=319202
rdar://182056248
Reviewed by Taher Ali.
Repeated beginElementAt()/endElementAt() with the same offset append a new
entry to m_beginTimes/m_endTimes every call, growing the lists without bound.
The duplicates are inert and findInstanceTime() uses lower_bound and resolves
the same time regardless but waste memory and slow later inserts and scans.
Collapse duplicates at insertion: rename insertSorted() to
insertSortedAndUnique() and skip the insert when a matching (time, origin)
pair already exists. Since the list is ordered only by time, the uniqueness
check walks just the contiguous equal-time run.
No new tests since not observable through animation behavior and the lists have
no Internals introspection.
* Source/WebCore/svg/animation/SVGSMILElement.cpp:
(WebCore::insertSortedAndUnique):
(WebCore::SVGSMILElement::addInstanceTime):
(WebCore::insertSorted): Deleted.
Canonical link: https://commits.webkit.org/317007@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications