Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: f67bc569d1c1c47a9433d880ade4d92f9967147a
      
https://github.com/WebKit/WebKit/commit/f67bc569d1c1c47a9433d880ade4d92f9967147a
  Author: Antoine Quint <[email protected]>
  Date:   2026-03-26 (Thu, 26 Mar 2026)

  Changed paths:
    A 
LayoutTests/http/tests/animations/resources/threaded-animations-timeline-resumption-from-page-cache-helper.html
    A 
LayoutTests/http/tests/animations/threaded-animations-timeline-resumption-from-page-cache-expected.txt
    A 
LayoutTests/http/tests/animations/threaded-animations-timeline-resumption-from-page-cache.html
    M LayoutTests/platform/mac-site-isolation/TestExpectations
    M Source/WebCore/animation/AcceleratedTimelinesUpdater.cpp
    M Source/WebCore/animation/AcceleratedTimelinesUpdater.h
    M Source/WebCore/history/BackForwardCache.cpp
    M Source/WebCore/page/Page.cpp
    M Source/WebCore/page/Page.h
    M 
Source/WebKit/UIProcess/RemoteLayerTree/RemoteMonotonicTimelineRegistry.cpp

  Log Message:
  -----------
  [threaded-animations] navigating between apple.com and cnn.com back and forth 
yields a timeline lookup failure
https://bugs.webkit.org/show_bug.cgi?id=310711
rdar://173325751

Reviewed by Simon Fraser.

When navigation occurs between pages from different domains, a separate Web 
Process is used per domain. Additionally,
as such navigation occurs, `WebPageProxy::swapToProvisionalPage()` calls 
`setDrawingArea(provisionalPage->takeDrawingArea())`
which will cause the associated `RemoteLayerTreeEventDispatcher` to be removed. 
However, timelines registration hangs off
that object and so when such a page is resumed and we expect the timeline to 
still be present, we fail the timeline
lookup in `RemoteLayerTreeNode::setAcceleratedEffectsAndBaseValues()`.

To address this, we clear the list of known timelines tracked by 
`AcceleratedTimelinesUpdater` under
`BackForwardCache::trySuspendPage()`, similarly to how we tear down the page's 
render tree, putting both those tasks under
a new `Page::willEnterBackForwardCache()`. This means that when a page is 
resumed from the back-forward cache, any animation
uploaded through to the remote layer tree will have its timeline uploaded as 
well and correctly re-created remotely.

Additionally, when updating the list of known timelines in 
`AcceleratedTimelinesUpdater::processTimelinesSeenDuringEffectStacksUpdate()`
we mistakenly used `HashSet::add()` instead of `HashSet::set()` which meant we 
would fail to add timelines that had were
now null references.

Test: 
http/tests/animations/threaded-animations-timeline-resumption-from-page-cache.html

* 
LayoutTests/http/tests/animations/resources/threaded-animations-timeline-resumption-from-page-cache-helper.html:
 Added.
* 
LayoutTests/http/tests/animations/threaded-animations-timeline-resumption-from-page-cache-expected.txt:
 Added.
* 
LayoutTests/http/tests/animations/threaded-animations-timeline-resumption-from-page-cache.html:
 Added.
* LayoutTests/platform/mac-site-isolation/TestExpectations:
* Source/WebCore/animation/AcceleratedTimelinesUpdater.cpp:
(WebCore::AcceleratedTimelinesUpdater::clear):
(WebCore::AcceleratedTimelinesUpdater::processTimelinesSeenDuringEffectStacksUpdate):
* Source/WebCore/animation/AcceleratedTimelinesUpdater.h:
* Source/WebCore/history/BackForwardCache.cpp:
(WebCore::BackForwardCache::trySuspendPage):
* Source/WebCore/page/Page.cpp:
(WebCore::Page::willEnterBackForwardCache):
* Source/WebCore/page/Page.h:
* Source/WebKit/UIProcess/RemoteLayerTree/RemoteMonotonicTimelineRegistry.cpp:
(WebKit::RemoteMonotonicTimelineRegistry::update):

Canonical link: https://commits.webkit.org/309972@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to