diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:35:49 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:35:49 +0000 |
commit | d8bbc7858622b6d9c278469aab701ca0b609cddf (patch) | |
tree | eff41dc61d9f714852212739e6b3738b82a2af87 /dom/svg/SVGSVGElement.cpp | |
parent | Releasing progress-linux version 125.0.3-1~progress7.99u1. (diff) | |
download | firefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.tar.xz firefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.zip |
Merging upstream version 126.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/svg/SVGSVGElement.cpp')
-rw-r--r-- | dom/svg/SVGSVGElement.cpp | 39 |
1 files changed, 23 insertions, 16 deletions
diff --git a/dom/svg/SVGSVGElement.cpp b/dom/svg/SVGSVGElement.cpp index f7282569f9..04f5b8662e 100644 --- a/dom/svg/SVGSVGElement.cpp +++ b/dom/svg/SVGSVGElement.cpp @@ -193,23 +193,30 @@ float SVGSVGElement::GetCurrentTimeAsFloat() { } void SVGSVGElement::SetCurrentTime(float seconds) { - if (mTimedDocumentRoot) { - // Make sure the timegraph is up-to-date - FlushAnimations(); - double fMilliseconds = double(seconds) * PR_MSEC_PER_SEC; - // Round to nearest whole number before converting, to avoid precision - // errors - SMILTime lMilliseconds = SVGUtils::ClampToInt64(NS_round(fMilliseconds)); - mTimedDocumentRoot->SetCurrentTime(lMilliseconds); - AnimationNeedsResample(); - // Trigger synchronous sample now, to: - // - Make sure we get an up-to-date paint after this method - // - re-enable event firing (it got disabled during seeking, and it - // doesn't get re-enabled until the first sample after the seek -- so - // let's make that happen now.) - FlushAnimations(); + if (!mTimedDocumentRoot) { + // we're not the outermost <svg> or not bound to a tree, so silently fail + return; } - // else we're not the outermost <svg> or not bound to a tree, so silently fail + // Make sure the timegraph is up-to-date + if (auto* currentDoc = GetComposedDoc()) { + currentDoc->FlushPendingNotifications(FlushType::Style); + } + if (!mTimedDocumentRoot) { + return; + } + FlushAnimations(); + double fMilliseconds = double(seconds) * PR_MSEC_PER_SEC; + // Round to nearest whole number before converting, to avoid precision + // errors + SMILTime lMilliseconds = SVGUtils::ClampToInt64(NS_round(fMilliseconds)); + mTimedDocumentRoot->SetCurrentTime(lMilliseconds); + AnimationNeedsResample(); + // Trigger synchronous sample now, to: + // - Make sure we get an up-to-date paint after this method + // - re-enable event firing (it got disabled during seeking, and it + // doesn't get re-enabled until the first sample after the seek -- so + // let's make that happen now.) + FlushAnimations(); } void SVGSVGElement::DeselectAll() { |