WebKit Bugzilla
Attachment 358706 Details for
Bug 193283
: [PSON] Flash of blank content while transitioning from page A to page B.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
patch
swapfromsuspended-2.patch (text/plain), 12.73 KB, created by
Antti Koivisto
on 2019-01-09 08:17:24 PST
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Antti Koivisto
Created:
2019-01-09 08:17:24 PST
Size:
12.73 KB
patch
obsolete
>Index: Source/WebKit/ChangeLog >=================================================================== >--- Source/WebKit/ChangeLog (revision 239772) >+++ Source/WebKit/ChangeLog (working copy) >@@ -1,3 +1,46 @@ >+2019-01-09 Antti Koivisto <antti@apple.com> >+ >+ [PSON] Flash of blank content while transitioning from page A to page B. >+ https://bugs.webkit.org/show_bug.cgi?id=193283 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Layer tree is not frozen during WebPage construction. If the flush timer (started for the initial >+ empty document) manages to run before the actual page load starts, we'll get a flash. >+ >+ * Shared/WebPageCreationParameters.cpp: >+ (WebKit::WebPageCreationParameters::encode const): >+ (WebKit::WebPageCreationParameters::decode): >+ * Shared/WebPageCreationParameters.h: >+ >+ Rename shouldDelayAttachingDrawingArea bit to isSwapFromSuspended and make it available on all platforms. >+ >+ * UIProcess/RemoteLayerTree/mac/ScrollerMac.h: Removed. >+ * UIProcess/RemoteLayerTree/mac/ScrollerMac.mm: Removed. >+ * UIProcess/RemoteLayerTree/mac/ScrollerPairMac.h: Removed. >+ * UIProcess/RemoteLayerTree/mac/ScrollerPairMac.mm: Removed. >+ * UIProcess/RemoteLayerTree/mac/ScrollingTreeFrameScrollingNodeRemoteMac.cpp: Removed. >+ * UIProcess/RemoteLayerTree/mac/ScrollingTreeFrameScrollingNodeRemoteMac.h: Removed. >+ * UIProcess/WebPageProxy.cpp: >+ (WebKit::WebPageProxy::swapToWebProcess): >+ (WebKit::WebPageProxy::finishAttachingToWebProcess): >+ (WebKit::WebPageProxy::initializeWebPage): >+ (WebKit::WebPageProxy::continueNavigationInNewProcess): >+ * UIProcess/WebPageProxy.h: >+ * WebProcess/WebPage/WebPage.cpp: >+ (WebKit::m_shouldAttachDrawingAreaOnPageTransition): >+ >+ Freeze the layer tree in WebPage constructor if this is a swap from a suspended process. >+ >+ (WebKit::WebPage::reinitializeWebPage): >+ (WebKit::WebPage::didCompletePageTransition): >+ >+ Unfreeze on first non-initial empty document page transition. >+ >+ * WebProcess/WebPage/WebPage.h: >+ * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: >+ (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea): >+ > 2019-01-09 Michael Catanzaro <mcatanzaro@igalia.com> > > [GTK] Add missing autocleanups >Index: Source/WebKit/Shared/WebPageCreationParameters.cpp >=================================================================== >--- Source/WebKit/Shared/WebPageCreationParameters.cpp (revision 239720) >+++ Source/WebKit/Shared/WebPageCreationParameters.cpp (working copy) >@@ -73,12 +73,12 @@ void WebPageCreationParameters::encode(I > encoder.encodeEnum(layerHostingMode); > encoder << mimeTypesWithCustomContentProviders; > encoder << controlledByAutomation; >+ encoder << isSwapFromSuspended; > > #if PLATFORM(MAC) > encoder << colorSpace; > encoder << useSystemAppearance; > encoder << useDarkAppearance; >- encoder << shouldDelayAttachingDrawingArea; > #endif > #if PLATFORM(IOS_FAMILY) > encoder << screenSize; >@@ -227,6 +227,8 @@ Optional<WebPageCreationParameters> WebP > return WTF::nullopt; > if (!decoder.decode(parameters.controlledByAutomation)) > return WTF::nullopt; >+ if (!decoder.decode(parameters.isSwapFromSuspended)) >+ return WTF::nullopt; > > #if PLATFORM(MAC) > if (!decoder.decode(parameters.colorSpace)) >@@ -235,8 +237,6 @@ Optional<WebPageCreationParameters> WebP > return WTF::nullopt; > if (!decoder.decode(parameters.useDarkAppearance)) > return WTF::nullopt; >- if (!decoder.decode(parameters.shouldDelayAttachingDrawingArea)) >- return WTF::nullopt; > #endif > > #if PLATFORM(IOS_FAMILY) >Index: Source/WebKit/Shared/WebPageCreationParameters.h >=================================================================== >--- Source/WebKit/Shared/WebPageCreationParameters.h (revision 239720) >+++ Source/WebKit/Shared/WebPageCreationParameters.h (working copy) >@@ -129,12 +129,12 @@ struct WebPageCreationParameters { > Vector<String> mimeTypesWithCustomContentProviders; > > bool controlledByAutomation; >+ bool isSwapFromSuspended { false }; > > #if PLATFORM(MAC) > ColorSpaceData colorSpace; > bool useSystemAppearance; > bool useDarkAppearance; >- bool shouldDelayAttachingDrawingArea { false }; > #endif > #if PLATFORM(IOS_FAMILY) > WebCore::FloatSize screenSize; >Index: Source/WebKit/UIProcess/WebPageProxy.cpp >=================================================================== >--- Source/WebKit/UIProcess/WebPageProxy.cpp (revision 239720) >+++ Source/WebKit/UIProcess/WebPageProxy.cpp (working copy) >@@ -772,7 +772,7 @@ bool WebPageProxy::suspendCurrentPageIfP > return true; > } > >-void WebPageProxy::swapToWebProcess(Ref<WebProcessProxy>&& process, std::unique_ptr<SuspendedPageProxy>&& destinationSuspendedPage, ShouldDelayAttachingDrawingArea shouldDelayAttachingDrawingArea) >+void WebPageProxy::swapToWebProcess(Ref<WebProcessProxy>&& process, std::unique_ptr<SuspendedPageProxy>&& destinationSuspendedPage, IsSwapFromSuspended isSwapFromSuspended) > { > ASSERT(!m_isClosed); > RELEASE_LOG_IF_ALLOWED(Loading, "swapToWebProcess: webPID = %i, pageID = %" PRIu64, m_process->processIdentifier(), m_pageID); >@@ -800,10 +800,10 @@ void WebPageProxy::swapToWebProcess(Ref< > m_process->addExistingWebPage(*this, m_pageID, WebProcessProxy::BeginsUsingDataStore::No); > m_process->addMessageReceiver(Messages::WebPageProxy::messageReceiverName(), m_pageID, *this); > >- finishAttachingToWebProcess(shouldDelayAttachingDrawingArea); >+ finishAttachingToWebProcess(isSwapFromSuspended); > } > >-void WebPageProxy::finishAttachingToWebProcess(ShouldDelayAttachingDrawingArea shouldDelayAttachingDrawingArea) >+void WebPageProxy::finishAttachingToWebProcess(IsSwapFromSuspended isSwapFromSuspended) > { > ASSERT(m_process->state() != ChildProcessProxy::State::Terminated); > >@@ -839,7 +839,7 @@ void WebPageProxy::finishAttachingToWebP > m_editableImageController = std::make_unique<EditableImageController>(*this); > #endif > >- initializeWebPage(shouldDelayAttachingDrawingArea); >+ initializeWebPage(isSwapFromSuspended); > > m_inspector->updateForNewPageProcess(this); > >@@ -904,7 +904,7 @@ RefPtr<API::Navigation> WebPageProxy::re > return WTFMove(navigation); > } > >-void WebPageProxy::initializeWebPage(ShouldDelayAttachingDrawingArea shouldDelayAttachingDrawingArea) >+void WebPageProxy::initializeWebPage(IsSwapFromSuspended isSwapFromSuspended) > { > ASSERT(isValid()); > >@@ -922,11 +922,7 @@ void WebPageProxy::initializeWebPage(Sho > #endif > > auto parameters = creationParameters(); >-#if PLATFORM(MAC) >- parameters.shouldDelayAttachingDrawingArea = shouldDelayAttachingDrawingArea == ShouldDelayAttachingDrawingArea::Yes; >-#else >- UNUSED_PARAM(shouldDelayAttachingDrawingArea); >-#endif >+ parameters.isSwapFromSuspended = isSwapFromSuspended == IsSwapFromSuspended::Yes; > > #if ENABLE(SERVICE_WORKER) > parameters.hasRegisteredServiceWorkers = process().processPool().mayHaveRegisteredServiceWorkers(m_websiteDataStore); >@@ -2768,7 +2764,7 @@ void WebPageProxy::continueNavigationInN > bool didSuspendPreviousPage = suspendCurrentPageIfPossible(navigation, mainFrameIDInPreviousProcess, processSwapRequestedByClient); > m_process->removeWebPage(*this, m_pageID, WebProcessProxy::EndsUsingDataStore::No); > >- swapToWebProcess(WTFMove(process), WTFMove(suspendedPageProxy), didSuspendPreviousPage ? ShouldDelayAttachingDrawingArea::Yes : ShouldDelayAttachingDrawingArea::No); >+ swapToWebProcess(WTFMove(process), WTFMove(suspendedPageProxy), didSuspendPreviousPage ? IsSwapFromSuspended::Yes : IsSwapFromSuspended::No); > > if (auto* item = navigation.targetItem()) { > LOG(Loading, "WebPageProxy %p continueNavigationInNewProcess to back item URL %s", this, item->url().utf8().data()); >Index: Source/WebKit/UIProcess/WebPageProxy.h >=================================================================== >--- Source/WebKit/UIProcess/WebPageProxy.h (revision 239720) >+++ Source/WebKit/UIProcess/WebPageProxy.h (working copy) >@@ -458,8 +458,8 @@ public: > API::IconLoadingClient& iconLoadingClient() { return *m_iconLoadingClient; } > void setIconLoadingClient(std::unique_ptr<API::IconLoadingClient>&&); > >- enum class ShouldDelayAttachingDrawingArea { No, Yes }; >- void initializeWebPage(ShouldDelayAttachingDrawingArea = ShouldDelayAttachingDrawingArea::No); >+ enum class IsSwapFromSuspended { No, Yes }; >+ void initializeWebPage(IsSwapFromSuspended = IsSwapFromSuspended::No); > > WeakPtr<SecKeyProxyStore> secKeyProxyStore(const WebCore::AuthenticationChallenge&); > >@@ -1574,11 +1574,11 @@ private: > void setCanShortCircuitHorizontalWheelEvents(bool canShortCircuitHorizontalWheelEvents) { m_canShortCircuitHorizontalWheelEvents = canShortCircuitHorizontalWheelEvents; } > > void reattachToWebProcess(); >- void swapToWebProcess(Ref<WebProcessProxy>&&, std::unique_ptr<SuspendedPageProxy>&&, ShouldDelayAttachingDrawingArea); >+ void swapToWebProcess(Ref<WebProcessProxy>&&, std::unique_ptr<SuspendedPageProxy>&&, IsSwapFromSuspended); > void didFailToSuspendAfterProcessSwap(); > void didSuspendAfterProcessSwap(); > >- void finishAttachingToWebProcess(ShouldDelayAttachingDrawingArea = ShouldDelayAttachingDrawingArea::No); >+ void finishAttachingToWebProcess(IsSwapFromSuspended = IsSwapFromSuspended::No); > > RefPtr<API::Navigation> reattachToWebProcessForReload(); > RefPtr<API::Navigation> reattachToWebProcessWithItem(WebBackForwardListItem&); >Index: Source/WebKit/WebProcess/WebPage/WebPage.cpp >=================================================================== >--- Source/WebKit/WebProcess/WebPage/WebPage.cpp (revision 239720) >+++ Source/WebKit/WebProcess/WebPage/WebPage.cpp (working copy) >@@ -402,7 +402,7 @@ WebPage::WebPage(uint64_t pageID, WebPag > , m_overrideContentSecurityPolicy { parameters.overrideContentSecurityPolicy } > , m_cpuLimit(parameters.cpuLimit) > #if PLATFORM(MAC) >- , m_shouldAttachDrawingAreaOnPageTransition(parameters.shouldDelayAttachingDrawingArea) >+ , m_shouldAttachDrawingAreaOnPageTransition(parameters.isSwapFromSuspended) > #endif > { > ASSERT(m_pageID); >@@ -472,6 +472,9 @@ WebPage::WebPage(uint64_t pageID, WebPag > m_drawingArea->setPaintingEnabled(false); > m_drawingArea->setShouldScaleViewToFitDocument(parameters.shouldScaleViewToFitDocument); > >+ if (parameters.isSwapFromSuspended) >+ freezeLayerTree(LayerTreeFreezeReason::SwapFromSuspended); >+ > #if ENABLE(ASYNC_SCROLLING) > m_useAsyncScrolling = parameters.store.getBoolValueForKey(WebPreferencesKey::threadedScrollingEnabledKey()); > if (!m_drawingArea->supportsAsyncScrolling()) >@@ -694,7 +697,7 @@ void WebPage::reinitializeWebPage(WebPag > m_drawingArea->updatePreferences(parameters.store); > m_drawingArea->setPaintingEnabled(true); > #if PLATFORM(MAC) >- m_shouldAttachDrawingAreaOnPageTransition = parameters.shouldDelayAttachingDrawingArea; >+ m_shouldAttachDrawingAreaOnPageTransition = parameters.isSwapFromSuspended; > #endif > unfreezeLayerTree(LayerTreeFreezeReason::PageSuspended); > } >@@ -3098,8 +3101,11 @@ void WebPage::didCompletePageTransition( > { > unfreezeLayerTree(LayerTreeFreezeReason::PageTransition); > >-#if PLATFORM(MAC) > bool isInitialEmptyDocument = !m_mainFrame; >+ if (!isInitialEmptyDocument) >+ unfreezeLayerTree(LayerTreeFreezeReason::SwapFromSuspended); >+ >+#if PLATFORM(MAC) > if (m_shouldAttachDrawingAreaOnPageTransition && !isInitialEmptyDocument) { > m_shouldAttachDrawingAreaOnPageTransition = false; > // Unfreezing the layer tree above schedules a layer flush so we delay attaching the drawing area >Index: Source/WebKit/WebProcess/WebPage/WebPage.h >=================================================================== >--- Source/WebKit/WebProcess/WebPage/WebPage.h (revision 239720) >+++ Source/WebKit/WebProcess/WebPage/WebPage.h (working copy) >@@ -696,6 +696,7 @@ public: > ProcessSuspended = 1 << 2, > PageSuspended = 1 << 3, > Printing = 1 << 4, >+ SwapFromSuspended = 1 << 5, > }; > void freezeLayerTree(LayerTreeFreezeReason); > void unfreezeLayerTree(LayerTreeFreezeReason); >Index: Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm >=================================================================== >--- Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm (revision 239720) >+++ Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm (working copy) >@@ -97,7 +97,7 @@ TiledCoreAnimationDrawingArea::TiledCore > updateLayerHostingContext(); > setColorSpace(parameters.colorSpace); > >- if (!parameters.shouldDelayAttachingDrawingArea) >+ if (!parameters.isSwapFromSuspended) > attach(); > } >
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 193283
: 358706