Bug 275725
| Summary: | Clean up SVGSMILElement::findInstanceTime | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Ahmad Saleem <ahmad.saleem792> |
| Component: | SVG | Assignee: | Ahmad Saleem <ahmad.saleem792> |
| Status: | NEW | ||
| Severity: | Normal | CC: | karlcow, sabouhallawa, webkit-bug-importer, zimmermann |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
Ahmad Saleem
Hi Team,
Came across another potential merge from Blink's commit:
Commit: https://chromium-review.googlesource.com/c/chromium/src/+/1400822
WebKit Source: https://github.com/WebKit/WebKit/blob/b8f876b231ab91a7df950c7c0617945620d944e2/Source/WebCore/svg/animation/SVGSMILElement.cpp#L773
This compiles:
SMILTime SVGSMILElement::findInstanceTime(BeginOrEnd beginOrEnd, SMILTime minimumTime, bool equalsMinimumOK) const
{
const Vector<SMILTimeWithOrigin>& list = beginOrEnd == Begin ? m_beginTimes : m_endTimes;
if (list.isEmpty())
return beginOrEnd == Begin ? SMILTime::unresolved() : SMILTime::indefinite();
// If an equal value is not accepted, return the next bigger item in the list, if any.
auto predicate = [equalsMinimumOK](const SMILTimeWithOrigin& instanceTime, const SMILTime& time) {
return equalsMinimumOK ? instanceTime.time() < time : instanceTime.time() <= time;
};
auto* item = std::lower_bound(list.begin(), list.end(), minimumTime, predicate);
if (item == list.end())
return SMILTime::unresolved();
// The special value "indefinite" does not yield an instance time in the begin list.
if (item->time().isIndefinite() && beginOrEnd == Begin)
return SMILTime::unresolved();
return item->time();
}
___
Just raising to get input, whether it is good merge?
Thanks!
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/130730896>
Ahmad Saleem
Pull request: https://github.com/WebKit/WebKit/pull/34162
Ahmad Saleem
NOTE - https://github.com/chromium/chromium/commit/f257770602c9d527674536f7bb2169240b4d7411 (removed - WTF binary search implementation).