WebKit Bugzilla
Attachment 361620 Details for
Bug 177484
: requestAnimationFrame should execute before the next frame
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-177484-20190209211907.patch (text/plain), 42.82 KB, created by
Said Abou-Hallawa
on 2019-02-09 21:19:08 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Said Abou-Hallawa
Created:
2019-02-09 21:19:08 PST
Size:
42.82 KB
patch
obsolete
>Subversion Revision: 241227 >diff --git a/Source/WTF/ChangeLog b/Source/WTF/ChangeLog >index e45ad93c1e472acbf5066018dd2a237aeafd04dd..de2538fa4b387a4cefd7ff4388bbe96bddc7cd24 100644 >--- a/Source/WTF/ChangeLog >+++ b/Source/WTF/ChangeLog >@@ -1,3 +1,15 @@ >+2019-02-09 Said Abou-Hallawa <said@apple.com> >+ >+ requestAnimationFrame should execute before the next frame >+ https://bugs.webkit.org/show_bug.cgi?id=177484 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Add tracing signposts for requestAnimationFrame scheduling and flushing >+ the layers interval. >+ >+ * wtf/SystemTracing.h: >+ > 2019-02-08 Alex Christensen <achristensen@webkit.org> > > Add SPI to use networking daemon instead of XPC service >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index b3bdd47f32bb2c2c6848732055a8e130c8c45d41..8a79b3afaca6ec2ffdd772b908f09f0db1f76011 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,68 @@ >+2019-02-09 Said Abou-Hallawa <said@apple.com> >+ >+ requestAnimationFrame should execute before the next frame >+ https://bugs.webkit.org/show_bug.cgi?id=177484 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ This change will fix two issues with animation timing: >+ >+ 1. Servicing requestAnimationFrame callbacks happens when the DisplayLink >+ fires. This may happen even if the frame is missed and no display is >+ committed. >+ >+ 2. Javascript may try to refresh the screen more than 60 FPS. WebCore >+ currently runs the layout and commits the layer although the graphical >+ system will throttle to 60 FPS at the end. >+ >+ These two issues can be fixed if we do the following: >+ >+ 1. DisplayMonitor callback will scheduleCompositingLayerFlush() instead >+ of servicing requestAnimationFrame callbacks. >+ >+ 2. When the page is about to be displayed, requestAnimationFrame callbacks >+ will be served. >+ >+ * Sources.txt: >+ * WebCore.xcodeproj/project.pbxproj: >+ * animation/DocumentAnimationScheduler.cpp: >+ (WebCore::DocumentAnimationScheduler::unscheduleWebAnimationsResolution): >+ (WebCore::DocumentAnimationScheduler::displayRefreshFired): >+ (WebCore::DocumentAnimationScheduler::scheduleScriptedAnimationResolution): Deleted. >+ * animation/DocumentAnimationScheduler.h: >+ * dom/Document.cpp: >+ (WebCore::Document::serviceScriptedAnimations): >+ * dom/Document.h: >+ * dom/ScriptedAnimationController.cpp: >+ (WebCore::ScriptedAnimationController::scheduleAnimation): >+ * page/DisplayRefreshEventManager.cpp: Added. >+ (WebCore::DisplayRefreshEventManager::DisplayRefreshEventManager): >+ (WebCore::DisplayRefreshEventManager::processDisplayRefreshEvent): >+ * page/DisplayRefreshEventManager.h: Copied from Source/WebCore/animation/DocumentAnimationScheduler.h. >+ * page/DisplayRefreshScheduler.cpp: Added. >+ (WebCore::DisplayRefreshScheduler::DisplayRefreshScheduler): >+ (WebCore::DisplayRefreshScheduler::scheduleRefresh): >+ (WebCore::DisplayRefreshScheduler::windowScreenDidChange): >+ (WebCore::DisplayRefreshScheduler::createDisplayRefreshMonitor const): >+ (WebCore::DisplayRefreshScheduler::startTimer): >+ (WebCore::DisplayRefreshScheduler::clearTimer): >+ (WebCore::DisplayRefreshScheduler::displayRefreshFired): >+ * page/DisplayRefreshScheduler.h: Copied from Source/WebCore/animation/DocumentAnimationScheduler.h. >+ (WebCore::DisplayRefreshScheduler::create): >+ * page/FrameTree.cpp: >+ * page/Page.cpp: >+ (WebCore::Page::refreshScheduler): >+ (WebCore::Page::willDisplayPage): Deleted. >+ * page/Page.h: >+ (WebCore::Page::refreshEventManager): >+ * page/PageOverlayController.cpp: >+ (WebCore::PageOverlayController::didChangeViewExposedRect): >+ (WebCore::PageOverlayController::notifyFlushRequired): >+ * page/mac/ServicesOverlayController.mm: >+ (WebCore::ServicesOverlayController::Highlight::notifyFlushRequired): >+ * rendering/RenderLayerCompositor.cpp: >+ (WebCore::RenderLayerCompositor::scheduleLayerFlushNow): >+ > 2019-02-08 Yusuke Suzuki <ysuzuki@apple.com> > > [JSC] Shrink sizeof(CodeBlock) more >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 3f86bead7753f270efb9fcdf650549206192d288..b9ca6d501110f98285c28f3e6d30940ca0992f2c 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,22 @@ >+2019-02-09 Said Abou-Hallawa <said@apple.com> >+ >+ requestAnimationFrame should execute before the next frame >+ https://bugs.webkit.org/show_bug.cgi?id=177484 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ DisplayRefreshEventManager is a page-level class which is supposed to >+ handle events related to rendering. >+ >+ * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm: >+ (WebKit::RemoteLayerTreeDrawingArea::flushLayers): >+ * WebProcess/WebPage/WebPage.cpp: >+ (WebKit::WebPage::processDisplayRefreshEvent): >+ (WebKit::WebPage::willDisplayPage): Deleted. >+ * WebProcess/WebPage/WebPage.h: >+ * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: >+ (WebKit::TiledCoreAnimationDrawingArea::flushLayers): >+ > 2019-02-08 Alexander Mikhaylenko <exalm7659@gmail.com> > > [GTK] Implement back/forward touchpad gesture >diff --git a/Source/WTF/wtf/SystemTracing.h b/Source/WTF/wtf/SystemTracing.h >index 105196ec48735fab52b3931511e00ed0c14fe15f..ace7e20cf11566e4631e68f1d9e2da4cbb1eb5ff 100644 >--- a/Source/WTF/wtf/SystemTracing.h >+++ b/Source/WTF/wtf/SystemTracing.h >@@ -75,6 +75,11 @@ enum TracePointCode { > DisplayListRecordEnd, > DisplayRefreshDispatchingToMainThread, > >+ ScheduleDisplayRefresh, >+ TriggerDisplayRefresh, >+ RenderingUpdateStart, >+ RenderingUpdateEnd, >+ > WebKitRange = 10000, > WebHTMLViewPaintStart, > WebHTMLViewPaintEnd, >diff --git a/Source/WebCore/Sources.txt b/Source/WebCore/Sources.txt >index 7aeccf700fe3be564caf02ea8c41d9a30cd38dd8..cc89f65ca2b373c797617b76495dc694e10b345b 100644 >--- a/Source/WebCore/Sources.txt >+++ b/Source/WebCore/Sources.txt >@@ -1485,6 +1485,8 @@ page/DeprecatedGlobalSettings.cpp > page/DeviceController.cpp > page/DiagnosticLoggingKeys.cpp > page/DisabledAdaptations.cpp >+page/DisplayRefreshEventManager.cpp >+page/DisplayRefreshScheduler.cpp > page/DragController.cpp > page/EditableImageReference.cpp > page/EventHandler.cpp >diff --git a/Source/WebCore/WebCore.xcodeproj/project.pbxproj b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >index 0273cbbabf40606b43b16487110be5b2f56ab477..60ba75f761eeb138f3646c3ded4d48fd304d3743 100644 >--- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj >+++ b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >@@ -1780,6 +1780,8 @@ > 555130011E7CCCCB00A69E38 /* DecodingOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 555130001E7CCCCA00A69E38 /* DecodingOptions.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 555B87ED1CAAF0AB00349425 /* ImageDecoderCG.h in Headers */ = {isa = PBXBuildFile; fileRef = 555B87EB1CAAF0AB00349425 /* ImageDecoderCG.h */; }; > 5576A5651D88A70800CCC04C /* ImageFrame.h in Headers */ = {isa = PBXBuildFile; fileRef = 5576A5631D88A70800CCC04C /* ImageFrame.h */; settings = {ATTRIBUTES = (Private, ); }; }; >+ 558DBE33220CDD1F000876D0 /* DisplayRefreshScheduler.h in Headers */ = {isa = PBXBuildFile; fileRef = 55BC1190220CC53E000DB56B /* DisplayRefreshScheduler.h */; settings = {ATTRIBUTES = (Private, ); }; }; >+ 558DBE39220D18F0000876D0 /* DisplayRefreshEventManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 558DBE37220D0ABF000876D0 /* DisplayRefreshEventManager.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 55A336F91D821E3C0022C4C7 /* ImageBackingStore.h in Headers */ = {isa = PBXBuildFile; fileRef = 55A336F81D821E3C0022C4C7 /* ImageBackingStore.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 55AF14E61EAAC59B0026EEAA /* UTIRegistry.h in Headers */ = {isa = PBXBuildFile; fileRef = 55AF14E41EAAC59B0026EEAA /* UTIRegistry.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 55EC9599206AA7A0007DD0A9 /* PaintFrequencyTracker.h in Headers */ = {isa = PBXBuildFile; fileRef = 55EC95972069C92D007DD0A9 /* PaintFrequencyTracker.h */; settings = {ATTRIBUTES = (Private, ); }; }; >@@ -2114,7 +2116,6 @@ > 7156BCA121CA350F00534397 /* BasicEffectTiming.h in Headers */ = {isa = PBXBuildFile; fileRef = 7156BC9F21CA350600534397 /* BasicEffectTiming.h */; }; > 715AD7202050513200D592DC /* DeclarativeAnimation.h in Headers */ = {isa = PBXBuildFile; fileRef = 715AD71D2050512400D592DC /* DeclarativeAnimation.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 715AD7212050513F00D592DC /* CSSTransition.h in Headers */ = {isa = PBXBuildFile; fileRef = 7123C186204739BA00789392 /* CSSTransition.h */; }; >- 716E55B020DBABF100F0CF29 /* DocumentAnimationScheduler.h in Headers */ = {isa = PBXBuildFile; fileRef = 716E55AD20DBABDC00F0CF29 /* DocumentAnimationScheduler.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 71729F7B20F3BA4900801CE6 /* DocumentTimelineOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 71729F7A20F3BA3A00801CE6 /* DocumentTimelineOptions.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 71729F7E20F3BB4700801CE6 /* JSDocumentTimelineOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 71729F7C20F3BAB900801CE6 /* JSDocumentTimelineOptions.h */; }; > 71A1B6081DEE5AD70073BCFB /* modern-media-controls-localized-strings.js in Resources */ = {isa = PBXBuildFile; fileRef = 71A1B6061DEE5A820073BCFB /* modern-media-controls-localized-strings.js */; }; >@@ -8644,11 +8645,15 @@ > 555B87EB1CAAF0AB00349425 /* ImageDecoderCG.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ImageDecoderCG.h; sourceTree = "<group>"; }; > 5576A5621D88A70800CCC04C /* ImageFrame.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ImageFrame.cpp; sourceTree = "<group>"; }; > 5576A5631D88A70800CCC04C /* ImageFrame.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ImageFrame.h; sourceTree = "<group>"; }; >+ 558DBE36220D0ABF000876D0 /* DisplayRefreshEventManager.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = DisplayRefreshEventManager.cpp; sourceTree = "<group>"; }; >+ 558DBE37220D0ABF000876D0 /* DisplayRefreshEventManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DisplayRefreshEventManager.h; sourceTree = "<group>"; }; > 5597FCCB2076C06800D35BB0 /* GlyphDisplayListCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GlyphDisplayListCache.h; sourceTree = "<group>"; }; > 55A336F61D8209F40022C4C7 /* NativeImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeImage.h; sourceTree = "<group>"; }; > 55A336F81D821E3C0022C4C7 /* ImageBackingStore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ImageBackingStore.h; sourceTree = "<group>"; }; > 55AF14E31EAAC59B0026EEAA /* UTIRegistry.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = UTIRegistry.cpp; sourceTree = "<group>"; }; > 55AF14E41EAAC59B0026EEAA /* UTIRegistry.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = UTIRegistry.h; sourceTree = "<group>"; }; >+ 55BC118F220CC53E000DB56B /* DisplayRefreshScheduler.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = DisplayRefreshScheduler.cpp; sourceTree = "<group>"; }; >+ 55BC1190220CC53E000DB56B /* DisplayRefreshScheduler.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DisplayRefreshScheduler.h; sourceTree = "<group>"; }; > 55D408F71A7C631800C78450 /* SVGImageClients.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGImageClients.h; sourceTree = "<group>"; }; > 55EC95972069C92D007DD0A9 /* PaintFrequencyTracker.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PaintFrequencyTracker.h; sourceTree = "<group>"; }; > 55FA7FEF210FA386005AEFE7 /* SVGAttribute.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SVGAttribute.h; sourceTree = "<group>"; }; >@@ -9365,8 +9370,6 @@ > 716C8DF21E48B269005BD0DA /* volume-up-support.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = "volume-up-support.js"; sourceTree = "<group>"; }; > 716C8DF31E48B284005BD0DA /* volume-down-button.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = "volume-down-button.js"; sourceTree = "<group>"; }; > 716C8DF41E48B284005BD0DA /* volume-up-button.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = "volume-up-button.js"; sourceTree = "<group>"; }; >- 716E55AD20DBABDC00F0CF29 /* DocumentAnimationScheduler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DocumentAnimationScheduler.h; sourceTree = "<group>"; }; >- 716E55AF20DBABDD00F0CF29 /* DocumentAnimationScheduler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DocumentAnimationScheduler.cpp; sourceTree = "<group>"; }; > 716FA0D81DB26591007323CC /* airplay-button.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.css; path = "airplay-button.css"; sourceTree = "<group>"; }; > 716FA0D91DB26591007323CC /* airplay-button.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = "airplay-button.js"; sourceTree = "<group>"; }; > 716FA0DA1DB26591007323CC /* airplay-placard.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = "airplay-placard.js"; sourceTree = "<group>"; }; >@@ -9470,6 +9473,8 @@ > 727AFED31A2EA6A0000442E8 /* EXTsRGB.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = EXTsRGB.idl; sourceTree = "<group>"; }; > 72E417611A2E8D2F004C562A /* JSEXTsRGB.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSEXTsRGB.cpp; sourceTree = "<group>"; }; > 72E417621A2E8D2F004C562A /* JSEXTsRGB.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSEXTsRGB.h; sourceTree = "<group>"; }; >+ 72E8F8DA220EAD3600263E24 /* DocumentAnimationScheduler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DocumentAnimationScheduler.cpp; sourceTree = "<group>"; }; >+ 72E8F8DC220EAE5E00263E24 /* DocumentAnimationScheduler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DocumentAnimationScheduler.h; sourceTree = "<group>"; }; > 72F1AD9F1A3904C300014E18 /* EXTFragDepth.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EXTFragDepth.cpp; sourceTree = "<group>"; }; > 72F1ADA01A3904C300014E18 /* EXTFragDepth.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EXTFragDepth.h; sourceTree = "<group>"; }; > 72F1ADA11A3904C300014E18 /* EXTFragDepth.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = EXTFragDepth.idl; sourceTree = "<group>"; }; >@@ -20331,6 +20336,10 @@ > 8372DB301A6780A800C697C5 /* DiagnosticLoggingResultType.h */, > F47A09D420A9DD0400240FAE /* DisabledAdaptations.cpp */, > F47A09CF20A939F600240FAE /* DisabledAdaptations.h */, >+ 558DBE36220D0ABF000876D0 /* DisplayRefreshEventManager.cpp */, >+ 558DBE37220D0ABF000876D0 /* DisplayRefreshEventManager.h */, >+ 55BC118F220CC53E000DB56B /* DisplayRefreshScheduler.cpp */, >+ 55BC1190220CC53E000DB56B /* DisplayRefreshScheduler.h */, > BC5A86810C33676000EEA649 /* DOMSelection.cpp */, > BC5A86820C33676000EEA649 /* DOMSelection.h */, > BC5A86830C33676000EEA649 /* DOMSelection.idl */, >@@ -20633,8 +20642,8 @@ > 7123C185204739B900789392 /* CSSTransition.idl */, > 715AD71F2050512400D592DC /* DeclarativeAnimation.cpp */, > 715AD71D2050512400D592DC /* DeclarativeAnimation.h */, >- 716E55AF20DBABDD00F0CF29 /* DocumentAnimationScheduler.cpp */, >- 716E55AD20DBABDC00F0CF29 /* DocumentAnimationScheduler.h */, >+ 72E8F8DA220EAD3600263E24 /* DocumentAnimationScheduler.cpp */, >+ 72E8F8DC220EAE5E00263E24 /* DocumentAnimationScheduler.h */, > 71025EC41F99F096004A250C /* DocumentTimeline.cpp */, > 71025EC51F99F096004A250C /* DocumentTimeline.h */, > 71025ECA1F99F096004A250C /* DocumentTimeline.idl */, >@@ -29033,17 +29042,18 @@ > 0FE5FBD51C3DD51E0007A2CA /* DisplayListItems.h in Headers */, > 0FE5FBD71C3DD51E0007A2CA /* DisplayListRecorder.h in Headers */, > 0FE5FBD91C3DD51E0007A2CA /* DisplayListReplayer.h in Headers */, >+ 558DBE39220D18F0000876D0 /* DisplayRefreshEventManager.h in Headers */, > 49AF2D6914435D050016A784 /* DisplayRefreshMonitor.h in Headers */, > 2D29ECC6192ECC8300984B78 /* DisplayRefreshMonitorClient.h in Headers */, > 2D29ECCA192F1F1D00984B78 /* DisplayRefreshMonitorIOS.h in Headers */, > 2DE70023192FE82A00B0975C /* DisplayRefreshMonitorMac.h in Headers */, > 2D29ECC8192ECC8300984B78 /* DisplayRefreshMonitorManager.h in Headers */, >+ 558DBE33220CDD1F000876D0 /* DisplayRefreshScheduler.h in Headers */, > FD31609112B026F700C1A359 /* Distance.h in Headers */, > 84730D771248F0B300D3A9C9 /* DistantLightSource.h in Headers */, > B2F34FE60E82F81400F627CD /* DNS.h in Headers */, > 7EE6846F12D26E3800E73215 /* DNSResolveQueueCFNet.h in Headers */, > A8185F4009765766005826D9 /* Document.h in Headers */, >- 716E55B020DBABF100F0CF29 /* DocumentAnimationScheduler.h in Headers */, > A3BB59F41457A40D00AC56FE /* DocumentEventQueue.h in Headers */, > A8185F3D09765766005826D9 /* DocumentFragment.h in Headers */, > 46E1666E1FCC86A200C9710B /* DocumentIdentifier.h in Headers */, >diff --git a/Source/WebCore/animation/DocumentAnimationScheduler.cpp b/Source/WebCore/animation/DocumentAnimationScheduler.cpp >index ada330a67cd4c3dda8b235c1781c7406091c8286..24e5cc6d387c38011b92504f7dcddb22b1f728ac 100644 >--- a/Source/WebCore/animation/DocumentAnimationScheduler.cpp >+++ b/Source/WebCore/animation/DocumentAnimationScheduler.cpp >@@ -67,15 +67,7 @@ bool DocumentAnimationScheduler::scheduleWebAnimationsResolution() > void DocumentAnimationScheduler::unscheduleWebAnimationsResolution() > { > m_scheduledWebAnimationsResolution = false; >- >- if (!m_scheduledScriptedAnimationResolution) >- DisplayRefreshMonitorManager::sharedManager().unregisterClient(*this); >-} >- >-bool DocumentAnimationScheduler::scheduleScriptedAnimationResolution() >-{ >- m_scheduledScriptedAnimationResolution = true; >- return DisplayRefreshMonitorManager::sharedManager().scheduleAnimation(*this); >+ DisplayRefreshMonitorManager::sharedManager().unregisterClient(*this); > } > > void DocumentAnimationScheduler::displayRefreshFired() >@@ -94,12 +86,6 @@ void DocumentAnimationScheduler::displayRefreshFired() > m_document->timeline().documentAnimationSchedulerDidFire(); > } > >- if (m_scheduledScriptedAnimationResolution) { >- m_scheduledScriptedAnimationResolution = false; >- if (auto* scriptedAnimationController = m_document->scriptedAnimationController()) >- scriptedAnimationController->documentAnimationSchedulerDidFire(); >- } >- > m_isFiring = false; > } > >diff --git a/Source/WebCore/animation/DocumentAnimationScheduler.h b/Source/WebCore/animation/DocumentAnimationScheduler.h >index 98e88c51bdadd9d6db0a312d0a2767b18c57c83d..c2a1c9a98069f81654e433f32cfc585bb5817d61 100644 >--- a/Source/WebCore/animation/DocumentAnimationScheduler.h >+++ b/Source/WebCore/animation/DocumentAnimationScheduler.h >@@ -59,7 +59,6 @@ private: > > RefPtr<Document> m_document; > bool m_scheduledWebAnimationsResolution { false }; >- bool m_scheduledScriptedAnimationResolution { false }; > bool m_isFiring { false }; > Seconds m_lastTimestamp { 0_s }; > >diff --git a/Source/WebCore/dom/Document.cpp b/Source/WebCore/dom/Document.cpp >index 050555ba9491f47ca0bb4dfdaaa193d9ac54edf9..e5a8b5404a371e691f652215a16bce37ea21d110 100644 >--- a/Source/WebCore/dom/Document.cpp >+++ b/Source/WebCore/dom/Document.cpp >@@ -6293,6 +6293,12 @@ void Document::resumeScriptedAnimationControllerCallbacks() > m_scriptedAnimationController->resume(); > } > >+void Document::serviceScriptedAnimations() >+{ >+ if (m_scriptedAnimationController) >+ m_scriptedAnimationController->serviceScriptedAnimations(domWindow()->nowTimestamp()); >+} >+ > void Document::windowScreenDidChange(PlatformDisplayID displayID) > { > #if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR) >diff --git a/Source/WebCore/dom/Document.h b/Source/WebCore/dom/Document.h >index 9bdf1b8d879f513e8c233e5c702da1fb15e2da4b..dc25fbf55cf73c958fa3fde4ca94252081589afd 100644 >--- a/Source/WebCore/dom/Document.h >+++ b/Source/WebCore/dom/Document.h >@@ -1067,7 +1067,9 @@ public: > ScriptedAnimationController* scriptedAnimationController() { return m_scriptedAnimationController.get(); } > void suspendScriptedAnimationControllerCallbacks(); > void resumeScriptedAnimationControllerCallbacks(); >- >+ >+ void serviceScriptedAnimations(); >+ > void windowScreenDidChange(PlatformDisplayID); > > void finishedParsing(); >diff --git a/Source/WebCore/dom/ScriptedAnimationController.cpp b/Source/WebCore/dom/ScriptedAnimationController.cpp >index e88bb90cfbae17ad6d006e01b64204230d0fe801..e5f257b61333aeb7b812342b47804a3624510a6a 100644 >--- a/Source/WebCore/dom/ScriptedAnimationController.cpp >+++ b/Source/WebCore/dom/ScriptedAnimationController.cpp >@@ -262,8 +262,10 @@ void ScriptedAnimationController::scheduleAnimation() > > #if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR) > if (!m_isUsingTimer && !isThrottled()) { >- if (m_document->animationScheduler().scheduleScriptedAnimationResolution()) >+ if (auto* page = this->page()) { >+ page->refreshScheduler().scheduleRefresh(); > return; >+ } > > m_isUsingTimer = true; > } >diff --git a/Source/WebCore/page/DisplayRefreshEventManager.cpp b/Source/WebCore/page/DisplayRefreshEventManager.cpp >new file mode 100644 >index 0000000000000000000000000000000000000000..e6b25c20edaa7adf36a6367d6bc79ab3b177eff4 >--- /dev/null >+++ b/Source/WebCore/page/DisplayRefreshEventManager.cpp >@@ -0,0 +1,53 @@ >+/* >+ * Copyright (C) 2019 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#include "config.h" >+#include "DisplayRefreshEventManager.h" >+ >+#include "DocumentTimeline.h" >+#include "Frame.h" >+#include "FrameTree.h" >+#include "Page.h" >+ >+namespace WebCore { >+ >+DisplayRefreshEventManager::DisplayRefreshEventManager(Page& page) >+ : m_page(page) >+{ >+} >+ >+void DisplayRefreshEventManager::processDisplayRefreshEvent() >+{ >+ for (Frame* frame = &m_page.mainFrame(); frame; frame = frame->tree().traverseNext()) { >+ if (frame->document()) >+ frame->document()->serviceScriptedAnimations(); >+ } >+ >+#if ENABLE(INTERSECTION_OBSERVER) >+ m_page.updateIntersectionObservations(); >+#endif >+} >+ >+} >diff --git a/Source/WebCore/page/DisplayRefreshEventManager.h b/Source/WebCore/page/DisplayRefreshEventManager.h >new file mode 100644 >index 0000000000000000000000000000000000000000..6cff70a33ecc789c807b2f1663c12c7526d37f08 >--- /dev/null >+++ b/Source/WebCore/page/DisplayRefreshEventManager.h >@@ -0,0 +1,44 @@ >+/* >+ * Copyright (C) 2019 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#pragma once >+ >+#include <wtf/HashSet.h> >+ >+namespace WebCore { >+ >+class Document; >+class Page; >+ >+class DisplayRefreshEventManager { >+public: >+ DisplayRefreshEventManager(Page&); >+ WEBCORE_EXPORT void processDisplayRefreshEvent(); >+ >+private: >+ Page& m_page; >+}; >+ >+} >diff --git a/Source/WebCore/page/DisplayRefreshScheduler.cpp b/Source/WebCore/page/DisplayRefreshScheduler.cpp >new file mode 100644 >index 0000000000000000000000000000000000000000..0efe8dcbc153979216efeb2d0084af52c33f2aff >--- /dev/null >+++ b/Source/WebCore/page/DisplayRefreshScheduler.cpp >@@ -0,0 +1,96 @@ >+/* >+ * Copyright (C) 2019 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#include "config.h" >+#include "DisplayRefreshScheduler.h" >+ >+#include "Chrome.h" >+#include "ChromeClient.h" >+#include "DisplayRefreshMonitorManager.h" >+#include "Page.h" >+#include <wtf/SystemTracing.h> >+ >+namespace WebCore { >+ >+DisplayRefreshScheduler::DisplayRefreshScheduler(Page& page) >+ : m_page(page) >+{ >+#if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR) >+ windowScreenDidChange(page.chrome().displayID()); >+#endif >+} >+ >+void DisplayRefreshScheduler::scheduleRefresh() >+{ >+ if (m_scheduled) >+ return; >+ >+ tracePoint(ScheduleDisplayRefresh); >+ >+#if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR) >+ if (!DisplayRefreshMonitorManager::sharedManager().scheduleAnimation(*this)) >+#endif >+ startTimer(Seconds(1.0 / 60)); >+ >+ m_scheduled = true; >+} >+ >+#if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR) >+void DisplayRefreshScheduler::windowScreenDidChange(PlatformDisplayID displayID) >+{ >+ DisplayRefreshMonitorManager::sharedManager().windowScreenDidChange(displayID, *this); >+} >+ >+RefPtr<DisplayRefreshMonitor> DisplayRefreshScheduler::createDisplayRefreshMonitor(PlatformDisplayID displayID) const >+{ >+ if (auto monitor = m_page.chrome().client().createDisplayRefreshMonitor(displayID)) >+ return monitor; >+ >+ return DisplayRefreshMonitor::createDefaultDisplayRefreshMonitor(displayID); >+} >+#endif >+ >+void DisplayRefreshScheduler::startTimer(Seconds delay) >+{ >+ ASSERT(!m_refreshTimer); >+ m_refreshTimer = std::make_unique<Timer>(*this, &DisplayRefreshScheduler::displayRefreshFired); >+ m_refreshTimer->startOneShot(delay); >+} >+ >+void DisplayRefreshScheduler::clearTimer() >+{ >+ m_refreshTimer = nullptr; >+} >+ >+void DisplayRefreshScheduler::displayRefreshFired() >+{ >+ tracePoint(TriggerDisplayRefresh); >+ >+ m_page.chrome().client().scheduleCompositingLayerFlush(); >+ clearTimer(); >+ m_scheduled = false; >+} >+ >+} >diff --git a/Source/WebCore/page/DisplayRefreshScheduler.h b/Source/WebCore/page/DisplayRefreshScheduler.h >new file mode 100644 >index 0000000000000000000000000000000000000000..8c1e0451e027df26f7155427a4031150e1fda098 >--- /dev/null >+++ b/Source/WebCore/page/DisplayRefreshScheduler.h >@@ -0,0 +1,68 @@ >+/* >+ * Copyright (C) 2019 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#pragma once >+ >+#include "DisplayRefreshMonitorClient.h" >+#include <wtf/Seconds.h> >+ >+namespace WebCore { >+ >+class Page; >+class Timer; >+ >+class DisplayRefreshScheduler >+#if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR) >+ : public DisplayRefreshMonitorClient >+#endif >+{ >+ WTF_MAKE_FAST_ALLOCATED; >+public: >+ static std::unique_ptr<DisplayRefreshScheduler> create(Page& page) >+ { >+ return std::make_unique<DisplayRefreshScheduler>(page); >+ } >+ >+ DisplayRefreshScheduler(Page&); >+ void scheduleRefresh(); >+ >+#if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR) >+ void windowScreenDidChange(PlatformDisplayID); >+#endif >+ >+private: >+#if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR) >+ RefPtr<DisplayRefreshMonitor> createDisplayRefreshMonitor(PlatformDisplayID) const final; >+#endif >+ void startTimer(Seconds); >+ void clearTimer(); >+ void displayRefreshFired() final; >+ >+ Page& m_page; >+ std::unique_ptr<Timer> m_refreshTimer; >+ bool m_scheduled { false }; >+}; >+ >+} >diff --git a/Source/WebCore/page/FrameTree.cpp b/Source/WebCore/page/FrameTree.cpp >index d63f861a780528f720334b3dbb81f7bb08c19a9c..24511da24b0da9e52b55781825fba5775a82021a 100644 >--- a/Source/WebCore/page/FrameTree.cpp >+++ b/Source/WebCore/page/FrameTree.cpp >@@ -23,6 +23,7 @@ > > #include "Document.h" > #include "Frame.h" >+#include "FrameLoader.h" > #include "FrameView.h" > #include "HTMLFrameOwnerElement.h" > #include "Page.h" >diff --git a/Source/WebCore/page/Page.cpp b/Source/WebCore/page/Page.cpp >index 690735d4f0cb20c702b2b7b47d48bb2a322e9276..475d2825e9a269dcf556eb3dcdac7075a49415f6 100644 >--- a/Source/WebCore/page/Page.cpp >+++ b/Source/WebCore/page/Page.cpp >@@ -1112,13 +1112,6 @@ void Page::didFinishLoad() > m_performanceMonitor->didFinishLoad(); > } > >-void Page::willDisplayPage() >-{ >-#if ENABLE(INTERSECTION_OBSERVER) >- updateIntersectionObservations(); >-#endif >-} >- > bool Page::isOnlyNonUtilityPage() const > { > return !isUtilityPage() && nonUtilityPageCount == 1; >@@ -2815,6 +2808,13 @@ void Page::didChangeMainDocument() > #endif > } > >+DisplayRefreshScheduler& Page::refreshScheduler() >+{ >+ if (!m_refreshScheduler) >+ m_refreshScheduler = DisplayRefreshScheduler::create(*this); >+ return *m_refreshScheduler; >+} >+ > void Page::forEachDocument(const Function<void(Document&)>& functor) > { > for (Frame* frame = &mainFrame(); frame; frame = frame->tree().traverseNext()) { >diff --git a/Source/WebCore/page/Page.h b/Source/WebCore/page/Page.h >index 9464a8ddaf07a543f0b868ab083649caff7204b7..9a3a37bfb002b1b868a9343489d31690a52ec4f8 100644 >--- a/Source/WebCore/page/Page.h >+++ b/Source/WebCore/page/Page.h >@@ -22,6 +22,8 @@ > > #include "ActivityState.h" > #include "DisabledAdaptations.h" >+#include "DisplayRefreshEventManager.h" >+#include "DisplayRefreshScheduler.h" > #include "Document.h" > #include "FindOptions.h" > #include "FrameLoaderTypes.h" >@@ -261,6 +263,9 @@ public: > > PerformanceMonitor* performanceMonitor() { return m_performanceMonitor.get(); } > >+ DisplayRefreshScheduler& refreshScheduler(); >+ DisplayRefreshEventManager& refreshEventManager() { return m_refreshEventManager; } >+ > ValidationMessageClient* validationMessageClient() const { return m_validationMessageClient.get(); } > void updateValidationBubbleStateIfNeeded(); > >@@ -333,8 +338,6 @@ public: > void didStartProvisionalLoad(); > void didFinishLoad(); // Called when the load has been committed in the main frame. > >- WEBCORE_EXPORT void willDisplayPage(); >- > // The view scale factor is multiplied into the page scale factor by all > // callers of setPageScaleFactor. > WEBCORE_EXPORT void setViewScaleFactor(float); >@@ -860,6 +863,9 @@ private: > int m_headerHeight { 0 }; > int m_footerHeight { 0 }; > >+ std::unique_ptr<DisplayRefreshScheduler> m_refreshScheduler; >+ DisplayRefreshEventManager m_refreshEventManager { *this }; >+ > HashSet<RenderObject*> m_relevantUnpaintedRenderObjects; > Region m_topRelevantPaintedRegion; > Region m_bottomRelevantPaintedRegion; >diff --git a/Source/WebCore/page/PageOverlayController.cpp b/Source/WebCore/page/PageOverlayController.cpp >index 86a68529581683223cf02cedf865930e7661f5c3..1000ff1345e20e006586bc3a721fb463588b4ec8 100644 >--- a/Source/WebCore/page/PageOverlayController.cpp >+++ b/Source/WebCore/page/PageOverlayController.cpp >@@ -317,7 +317,7 @@ void PageOverlayController::didChangeDeviceScaleFactor() > > void PageOverlayController::didChangeViewExposedRect() > { >- m_page.chrome().client().scheduleCompositingLayerFlush(); >+ m_page.refreshScheduler().scheduleRefresh(); > } > > void PageOverlayController::didScrollFrame(Frame& frame) >@@ -411,7 +411,7 @@ float PageOverlayController::deviceScaleFactor() const > > void PageOverlayController::notifyFlushRequired(const WebCore::GraphicsLayer*) > { >- m_page.chrome().client().scheduleCompositingLayerFlush(); >+ m_page.refreshScheduler().scheduleRefresh(); > } > > void PageOverlayController::didChangeOverlayFrame(PageOverlay& overlay) >diff --git a/Source/WebCore/page/mac/ServicesOverlayController.mm b/Source/WebCore/page/mac/ServicesOverlayController.mm >index c96bed10869f675dbf5145f9f3e0f4123f02fbe7..1deb0164fb48a71d4352f272c605c565d0adfb29 100644 >--- a/Source/WebCore/page/mac/ServicesOverlayController.mm >+++ b/Source/WebCore/page/mac/ServicesOverlayController.mm >@@ -121,7 +121,7 @@ void ServicesOverlayController::Highlight::notifyFlushRequired(const GraphicsLay > if (!m_controller) > return; > >- m_controller->page().chrome().client().scheduleCompositingLayerFlush(); >+ m_controller->page().refreshScheduler().scheduleRefresh(); > } > > void ServicesOverlayController::Highlight::paintContents(const GraphicsLayer*, GraphicsContext& graphicsContext, GraphicsLayerPaintingPhase, const FloatRect&, GraphicsLayerPaintBehavior) >diff --git a/Source/WebCore/rendering/RenderLayerCompositor.cpp b/Source/WebCore/rendering/RenderLayerCompositor.cpp >index 19dab8a341386ccb840165664ff5f85570db983e..f53df7e6216a3df1982213e15bfd8fa8b2201f56 100644 >--- a/Source/WebCore/rendering/RenderLayerCompositor.cpp >+++ b/Source/WebCore/rendering/RenderLayerCompositor.cpp >@@ -430,7 +430,7 @@ void RenderLayerCompositor::notifyFlushRequired(const GraphicsLayer* layer) > void RenderLayerCompositor::scheduleLayerFlushNow() > { > m_hasPendingLayerFlush = false; >- page().chrome().client().scheduleCompositingLayerFlush(); >+ page().refreshScheduler().scheduleRefresh(); > } > > void RenderLayerCompositor::scheduleLayerFlush(bool canThrottle) >diff --git a/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm b/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm >index ce2d5cbdece8d9dc5177168df056109a30ee89b2..d53f571a84105840ef0e93f8869b03ead6f2dd3b 100644 >--- a/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm >+++ b/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm >@@ -348,7 +348,7 @@ void RemoteLayerTreeDrawingArea::flushLayers() > backingStoreCollection.willFlushLayers(); > > m_webPage.layoutIfNeeded(); >- m_webPage.willDisplayPage(); >+ m_webPage.processDisplayRefreshEvent(); > > FloatRect visibleRect(FloatPoint(), m_viewSize); > if (m_scrolledViewExposedRect) >diff --git a/Source/WebKit/WebProcess/WebPage/WebPage.cpp b/Source/WebKit/WebProcess/WebPage/WebPage.cpp >index 2023fe418d03152c8e0a80f6df9c98b808a23464..e2e45f0f14bcd6411dad5a8b812f678e687a4d72 100644 >--- a/Source/WebKit/WebProcess/WebPage/WebPage.cpp >+++ b/Source/WebKit/WebProcess/WebPage/WebPage.cpp >@@ -3566,9 +3566,9 @@ void WebPage::didFlushLayerTreeAtTime(MonotonicTime timestamp) > } > #endif > >-void WebPage::willDisplayPage() >+void WebPage::processDisplayRefreshEvent() > { >- m_page->willDisplayPage(); >+ m_page->refreshEventManager().processDisplayRefreshEvent(); > } > > WebInspector* WebPage::inspector(LazyCreationPolicy behavior) >diff --git a/Source/WebKit/WebProcess/WebPage/WebPage.h b/Source/WebKit/WebProcess/WebPage/WebPage.h >index e2460cbd27db384521d70e42bb4dab0619121aa0..52310c7a2e1ce06d1d57783b675b044e554370ea 100644 >--- a/Source/WebKit/WebProcess/WebPage/WebPage.h >+++ b/Source/WebKit/WebProcess/WebPage/WebPage.h >@@ -300,7 +300,7 @@ public: > void didFlushLayerTreeAtTime(MonotonicTime); > #endif > >- void willDisplayPage(); >+ void processDisplayRefreshEvent(); > > enum class LazyCreationPolicy { UseExistingOnly, CreateIfNeeded }; > >diff --git a/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm b/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm >index 324d063162332b8d4f66621679b05271129478c2..da2e2900aeda81441aaabab2d62da76a8ffe0d38 100644 >--- a/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm >+++ b/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm >@@ -59,6 +59,7 @@ > #import <pal/spi/cocoa/QuartzCoreSPI.h> > #import <wtf/MachSendRight.h> > #import <wtf/MainThread.h> >+#import <wtf/SystemTracing.h> > > #if ENABLE(ASYNC_SCROLLING) > #import <WebCore/AsyncScrollingCoordinator.h> >@@ -459,12 +460,14 @@ void TiledCoreAnimationDrawingArea::flushLayers() > if (layerTreeStateIsFrozen()) > return; > >+ TraceScope traceScope(RenderingUpdateStart, RenderingUpdateEnd); >+ > @autoreleasepool { > scaleViewToFitDocumentIfNeeded(); > > m_webPage.layoutIfNeeded(); > m_webPage.flushPendingEditorStateUpdate(); >- m_webPage.willDisplayPage(); >+ m_webPage.processDisplayRefreshEvent(); > > updateIntrinsicContentSizeIfNeeded(); > >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index bcd17721edf14cbed6fa4a31f711f2c5589b8d8d..9c24991d3d2c270869d3d7b624e1a7d4e909bb3f 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,12 @@ >+2019-02-09 Said Abou-Hallawa <said@apple.com> >+ >+ requestAnimationFrame should execute before the next frame >+ https://bugs.webkit.org/show_bug.cgi?id=177484 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * Tracing/SystemTracePoints.plist: >+ > 2019-02-08 Alexander Mikhaylenko <exalm7659@gmail.com> > > [GTK] Implement back/forward touchpad gesture >diff --git a/Tools/Tracing/SystemTracePoints.plist b/Tools/Tracing/SystemTracePoints.plist >index 0e1a6783866dc2df5dbadb82eb375e8686330769..1bb29410fc9c3849e7c0b323c8a34448da75c729 100644 >--- a/Tools/Tracing/SystemTracePoints.plist >+++ b/Tools/Tracing/SystemTracePoints.plist >@@ -202,8 +202,42 @@ > <key>Component</key> > <string>47</string> > <key>Code</key> >+ <string>5025</string> >+ </dict> >+ >+ >+ <dict> >+ <key>Name</key> >+ <string>Schedule display refresh</string> >+ <key>Type</key> >+ <string>Impulse</string> >+ <key>Component</key> >+ <string>47</string> >+ <key>Code</key> > <string>5026</string> > </dict> >+ <dict> >+ <key>Name</key> >+ <string>Trigger display refresh</string> >+ <key>Type</key> >+ <string>Impulse</string> >+ <key>Component</key> >+ <string>47</string> >+ <key>Code</key> >+ <string>5027</string> >+ </dict> >+ <dict> >+ <key>Name</key> >+ <string>Update rendering</string> >+ <key>Type</key> >+ <string>Interval</string> >+ <key>Component</key> >+ <string>47</string> >+ <key>CodeBegin</key> >+ <string>5028</string> >+ <key>CodeEnd</key> >+ <string>5029</string> >+ </dict> > <dict> > <key>Name</key> > <string>Paint WebHTMLView</string>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 177484
:
356578
|
361620
|
361621
|
361622
|
361623
|
361718
|
361727
|
361743
|
361749
|
361750
|
361752
|
361756
|
361760
|
361764
|
361769
|
361775
|
361776
|
361779
|
361783
|
361947
|
361963
|
361970
|
361973
|
361974
|
362845
|
362847
|
362848
|
362849
|
362850
|
362851
|
363268
|
363274
|
363286
|
363295
|
363309
|
363313
|
363417
|
363419
|
363420
|
363831
|
363846
|
363850
|
363857
|
363862
|
363940
|
366413
|
366416
|
366417
|
366418
|
366427
|
366731
|
366736
|
366740
|
366745
|
367083
|
367091
|
367145
|
367151
|
367160
|
367186