Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 41943f3329fc8057bce65a4aa05403454cc54013
https://github.com/WebKit/WebKit/commit/41943f3329fc8057bce65a4aa05403454cc54013
Author: Ahmad Saleem <[email protected]>
Date: 2026-08-02 (Sun, 02 Aug 2026)
Changed paths:
M Source/WebCore/svg/animation/SMILTime.h
M Source/WebCore/svg/animation/SVGSMILElement.cpp
Log Message:
-----------
SMILTime::operator== is inconsistent with spaceship operator for the
unresolved and indefinite values
https://bugs.webkit.org/show_bug.cgi?id=320817
rdar://183830503
Reviewed by Chris Dumez.
SMILTime::operator== tested isFinite() before comparing, but operator<=>
compares the raw
values, and since 291172 the compiler rewrites <, >, <= and >= from
operator<=>. For the
unresolved and the indefinite value that makes the two disagree: "a == a" is
false while
"a <= a", "a >= a" and "a != a" are all true at the same time.
Drop the isFinite() test so equality matches the ordering. Callers that need to
reject the
sentinel values already ask for isFinite(), isUnresolved() or isIndefinite()
explicitly.
This fixes several comparisons that were dead or wrong for open-ended intervals:
- resolveInterval() refined the end time under "tempEnd == lastIntervalTempEnd"
and
"tempEnd == m_intervalEnd". lastIntervalTempEnd starts at infinity and
m_intervalEnd at
unresolved, so neither could ever match and the refinement never ran for
indefinite
intervals.
- PriorityCompare fell through its "aBegin == bBegin" tie-break whenever both
animations had
an unresolved interval begin, so their relative order came out of an unstable
sort instead
of document order.
- beginListChanged() compared the new interval begin against the old one to
decide whether to
notify dependents, and notified unconditionally when both were unresolved.
- insertSortedAndUnique() stopped scanning for a duplicate at the first entry
whenever the
time being inserted was not finite.
resolveFirstInterval() worked around the old behaviour by comparing
SMILTime::value() by hand;
it can now use operator== again.
* Source/WebCore/svg/animation/SMILTime.h:
(WebCore::operator==):
* Source/WebCore/svg/animation/SVGSMILElement.cpp:
(WebCore::SVGSMILElement::resolveFirstInterval):
Canonical link: https://commits.webkit.org/318422@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications