Changeset 276490 in webkit
- Timestamp:
- Apr 23, 2021, 12:16:49 AM (5 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 15 edited
-
ChangeLog (modified) (1 diff)
-
UIProcess/API/glib/WebKitUIClient.cpp (modified) (1 diff)
-
UIProcess/API/gtk/PageClientImpl.cpp (modified) (1 diff)
-
UIProcess/API/gtk/PageClientImpl.h (modified) (1 diff)
-
UIProcess/API/gtk/WebKitWebViewBase.cpp (modified) (4 diffs)
-
UIProcess/API/gtk/WebKitWebViewBasePrivate.h (modified) (1 diff)
-
UIProcess/WebPageProxy.cpp (modified) (5 diffs)
-
UIProcess/WebPageProxy.h (modified) (2 diffs)
-
UIProcess/WebPageProxy.messages.in (modified) (1 diff)
-
UIProcess/mac/WebPageProxyMac.mm (modified) (1 diff)
-
WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp (modified) (1 diff)
-
WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp (modified) (2 diffs)
-
WebProcess/WebPage/WebPage.cpp (modified) (2 diffs)
-
WebProcess/WebPage/WebPage.h (modified) (2 diffs)
-
WebProcess/WebPage/mac/WebPageMac.mm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r276482 r276490 1 2021-04-23 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 [GTK] Implement PageClient::makeViewBlank() 4 https://bugs.webkit.org/show_bug.cgi?id=224236 5 6 Reviewed by Chris Dumez. 7 8 Make most of the changes in r275485 cross platform and implement PageClient::makeViewBlank() for the GTK port. 9 10 * UIProcess/API/glib/WebKitUIClient.cpp: 11 * UIProcess/API/gtk/PageClientImpl.cpp: 12 (WebKit::PageClientImpl::makeViewBlank): 13 * UIProcess/API/gtk/PageClientImpl.h: 14 * UIProcess/API/gtk/WebKitWebViewBase.cpp: 15 (webkitWebViewBaseSnapshot): 16 (webkitWebViewBaseDraw): 17 (webkitWebViewBaseMakeBlank): 18 * UIProcess/API/gtk/WebKitWebViewBasePrivate.h: 19 * UIProcess/WebPageProxy.cpp: 20 (WebKit::WebPageProxy::didUpdateRenderingAfterCommittingLoad): 21 (WebKit::WebPageProxy::stopMakingViewBlankDueToLackOfRenderingUpdate): 22 (WebKit::WebPageProxy::makeViewBlankIfUnpaintedSinceLastLoadCommit): 23 (WebKit::WebPageProxy::didCommitLoadForFrame): 24 * UIProcess/WebPageProxy.h: 25 * UIProcess/WebPageProxy.messages.in: 26 * UIProcess/mac/WebPageProxyMac.mm: 27 (WebKit::WebPageProxy::didUpdateRenderingAfterCommittingLoad): Deleted. 28 * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp: 29 (WebKit::CompositingCoordinator::flushPendingLayerChanges): 30 * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp: 31 (WebKit::DrawingAreaCoordinatedGraphics::updateBackingStoreState): 32 (WebKit::DrawingAreaCoordinatedGraphics::display): 33 * WebProcess/WebPage/WebPage.cpp: 34 (WebKit::WebPage::didUpdateRendering): 35 (WebKit::WebPage::didCommitLoad): 36 * WebProcess/WebPage/WebPage.h: 37 * WebProcess/WebPage/mac/WebPageMac.mm: 38 (WebKit::WebPage::didUpdateRendering): Deleted. 39 1 40 2021-04-22 Jer Noble <jer.noble@apple.com> 2 41 -
trunk/Source/WebKit/UIProcess/API/glib/WebKitUIClient.cpp
r273075 r276490 81 81 } 82 82 83 void runJavaScriptAlert(WebPageProxy&, const String& message, WebFrameProxy*, WebKit::FrameInfoData&&, Function<void()>&& completionHandler) final 84 { 83 void runJavaScriptAlert(WebPageProxy& page, const String& message, WebFrameProxy*, WebKit::FrameInfoData&&, Function<void()>&& completionHandler) final 84 { 85 page.makeViewBlankIfUnpaintedSinceLastLoadCommit(); 85 86 webkitWebViewRunJavaScriptAlert(m_webView, message.utf8(), WTFMove(completionHandler)); 86 87 } 87 88 88 void runJavaScriptConfirm(WebPageProxy&, const String& message, WebFrameProxy*, WebKit::FrameInfoData&&, Function<void(bool)>&& completionHandler) final 89 { 89 void runJavaScriptConfirm(WebPageProxy& page, const String& message, WebFrameProxy*, WebKit::FrameInfoData&&, Function<void(bool)>&& completionHandler) final 90 { 91 page.makeViewBlankIfUnpaintedSinceLastLoadCommit(); 90 92 webkitWebViewRunJavaScriptConfirm(m_webView, message.utf8(), WTFMove(completionHandler)); 91 93 } 92 94 93 void runJavaScriptPrompt(WebPageProxy&, const String& message, const String& defaultValue, WebFrameProxy*, WebKit::FrameInfoData&&, Function<void(const String&)>&& completionHandler) final 94 { 95 void runJavaScriptPrompt(WebPageProxy& page, const String& message, const String& defaultValue, WebFrameProxy*, WebKit::FrameInfoData&&, Function<void(const String&)>&& completionHandler) final 96 { 97 page.makeViewBlankIfUnpaintedSinceLastLoadCommit(); 95 98 webkitWebViewRunJavaScriptPrompt(m_webView, message.utf8(), defaultValue.utf8(), WTFMove(completionHandler)); 96 99 } -
trunk/Source/WebKit/UIProcess/API/gtk/PageClientImpl.cpp
r276448 r276490 642 642 } 643 643 644 void PageClientImpl::makeViewBlank(bool makeBlank) 645 { 646 webkitWebViewBaseMakeBlank(WEBKIT_WEB_VIEW_BASE(m_viewWidget), makeBlank); 647 } 648 644 649 } // namespace WebKit -
trunk/Source/WebKit/UIProcess/API/gtk/PageClientImpl.h
r276448 r276490 178 178 String themeName() const override; 179 179 180 void makeViewBlank(bool) override; 181 180 182 // Members of PageClientImpl class 181 183 GtkWidget* m_viewWidget; -
trunk/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp
r274815 r276490 284 284 IntSize contentsSize; 285 285 Optional<MotionEvent> lastMotionEvent; 286 bool isBlank; 286 287 287 288 GtkWindow* toplevelOnScreenWindow { nullptr }; … … 746 747 return; 747 748 748 ASSERT(drawingArea->isInAcceleratedCompositingMode()); 749 webViewBase->priv->acceleratedBackingStore->snapshot(snapshot); 749 if (!webViewBase->priv->isBlank) { 750 ASSERT(drawingArea->isInAcceleratedCompositingMode()); 751 webViewBase->priv->acceleratedBackingStore->snapshot(snapshot); 752 } 750 753 751 754 if (webViewBase->priv->inspectorView) … … 767 770 return FALSE; 768 771 769 bool showingNavigationSnapshot = webViewBase->priv->pageProxy->isShowingNavigationGestureSnapshot(); 770 if (showingNavigationSnapshot) 771 cairo_push_group(cr); 772 773 if (drawingArea->isInAcceleratedCompositingMode()) { 774 ASSERT(webViewBase->priv->acceleratedBackingStore); 775 webViewBase->priv->acceleratedBackingStore->paint(cr, clipRect); 776 } else { 777 WebCore::Region unpaintedRegion; // This is simply unused. 778 drawingArea->paint(cr, clipRect, unpaintedRegion); 779 } 780 781 if (showingNavigationSnapshot) { 782 RefPtr<cairo_pattern_t> group = adoptRef(cairo_pop_group(cr)); 783 if (auto* controller = webkitWebViewBaseViewGestureController(webViewBase)) 784 controller->draw(cr, group.get()); 772 if (!webViewBase->priv->isBlank) { 773 bool showingNavigationSnapshot = webViewBase->priv->pageProxy->isShowingNavigationGestureSnapshot(); 774 if (showingNavigationSnapshot) 775 cairo_push_group(cr); 776 777 if (drawingArea->isInAcceleratedCompositingMode()) { 778 ASSERT(webViewBase->priv->acceleratedBackingStore); 779 webViewBase->priv->acceleratedBackingStore->paint(cr, clipRect); 780 } else { 781 WebCore::Region unpaintedRegion; // This is simply unused. 782 drawingArea->paint(cr, clipRect, unpaintedRegion); 783 } 784 785 if (showingNavigationSnapshot) { 786 RefPtr<cairo_pattern_t> group = adoptRef(cairo_pop_group(cr)); 787 if (auto* controller = webkitWebViewBaseViewGestureController(webViewBase)) 788 controller->draw(cr, group.get()); 789 } 785 790 } 786 791 … … 2778 2783 delta, wheelTicks, toWebKitWheelEventPhase(phase), toWebKitWheelEventPhase(momentumPhase))); 2779 2784 } 2785 2786 void webkitWebViewBaseMakeBlank(WebKitWebViewBase* webViewBase, bool makeBlank) 2787 { 2788 WebKitWebViewBasePrivate* priv = webViewBase->priv; 2789 if (priv->isBlank == makeBlank) 2790 return; 2791 2792 priv->isBlank = makeBlank; 2793 gtk_widget_queue_draw(GTK_WIDGET(webViewBase)); 2794 } -
trunk/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBasePrivate.h
r274815 r276490 121 121 WebKitInputMethodContext* webkitWebViewBaseGetInputMethodContext(WebKitWebViewBase*); 122 122 void webkitWebViewBaseSynthesizeCompositionKeyPress(WebKitWebViewBase*, const String& text, Optional<Vector<WebCore::CompositionUnderline>>&&, Optional<WebKit::EditingRange>&&); 123 124 void webkitWebViewBaseMakeBlank(WebKitWebViewBase*, bool); -
trunk/Source/WebKit/UIProcess/WebPageProxy.cpp
r276306 r276490 2469 2469 #endif 2470 2470 2471 void WebPageProxy::didUpdateRenderingAfterCommittingLoad() 2472 { 2473 if (m_hasUpdatedRenderingAfterDidCommitLoad) 2474 return; 2475 2476 m_hasUpdatedRenderingAfterDidCommitLoad = true; 2477 stopMakingViewBlankDueToLackOfRenderingUpdate(); 2478 } 2479 2471 2480 void WebPageProxy::stopMakingViewBlankDueToLackOfRenderingUpdate() 2472 2481 { 2473 #if PLATFORM(COCOA)2474 2482 ASSERT(m_hasUpdatedRenderingAfterDidCommitLoad); 2475 2483 RELEASE_LOG_IF_ALLOWED(Process, "stopMakingViewBlankDueToLackOfRenderingUpdate:"); 2476 2484 pageClient().makeViewBlank(false); 2477 #endif2478 2485 } 2479 2486 … … 2483 2490 void WebPageProxy::makeViewBlankIfUnpaintedSinceLastLoadCommit() 2484 2491 { 2492 if (!m_hasUpdatedRenderingAfterDidCommitLoad) { 2485 2493 #if PLATFORM(COCOA) 2486 if (!m_hasUpdatedRenderingAfterDidCommitLoad) {2487 2494 static bool shouldMakeViewBlank = linkedOnOrAfter(WebCore::SDKVersion::FirstWithBlankViewOnJSPrompt); 2495 #else 2496 static bool shouldMakeViewBlank = true; 2497 #endif 2488 2498 if (shouldMakeViewBlank) { 2489 2499 RELEASE_LOG_IF_ALLOWED(Process, "makeViewBlankIfUnpaintedSinceLastLoadCommit: Making the view blank because of a JS prompt before the first paint for its page"); … … 2491 2501 } 2492 2502 } 2493 #endif2494 2503 } 2495 2504 … … 4694 4703 m_process->didCommitProvisionalLoad(); 4695 4704 4696 #if PLATFORM(COCOA)4697 4705 if (frame->isMainFrame()) { 4698 4706 m_hasUpdatedRenderingAfterDidCommitLoad = false; … … 4701 4709 #endif 4702 4710 } 4703 #endif4704 4711 4705 4712 auto transaction = m_pageLoadState.transaction(); -
trunk/Source/WebKit/UIProcess/WebPageProxy.h
r276347 r276490 2237 2237 2238 2238 void didReceiveEvent(uint32_t opaqueType, bool handled); 2239 void didUpdateRenderingAfterCommittingLoad(); 2239 2240 #if PLATFORM(MAC) 2240 void didUpdateRenderingAfterCommittingLoad();2241 2241 void fontAtSelectionCallback(const FontInfo&, double, bool, CallbackID); 2242 2242 #endif … … 2672 2672 bool m_isPerformingDOMPrintOperation { false }; 2673 2673 2674 #if PLATFORM(COCOA)2675 2674 bool m_hasUpdatedRenderingAfterDidCommitLoad { true }; 2676 #endif2677 2675 2678 2676 WebCore::ResourceRequest m_decidePolicyForResponseRequest; -
trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in
r276181 r276490 376 376 377 377 SetEditableElementIsFocused(bool editableElementIsFocused) 378 #endif 379 378 380 DidUpdateRenderingAfterCommittingLoad() 379 #endif380 381 381 382 #if USE(DICTATION_ALTERNATIVES) -
trunk/Source/WebKit/UIProcess/mac/WebPageProxyMac.mm
r275485 r276490 661 661 } 662 662 663 void WebPageProxy::didUpdateRenderingAfterCommittingLoad()664 {665 if (m_hasUpdatedRenderingAfterDidCommitLoad)666 return;667 668 m_hasUpdatedRenderingAfterDidCommitLoad = true;669 stopMakingViewBlankDueToLackOfRenderingUpdate();670 }671 672 663 #if ENABLE(UI_PROCESS_PDF_HUD) 673 664 -
trunk/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp
r266000 r276490 174 174 } 175 175 176 m_page.didUpdateRendering(); 177 176 178 return true; 177 179 } -
trunk/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp
r274869 r276490 425 425 m_webPage.flushPendingEditorStateUpdate(); 426 426 m_webPage.scrollMainFrameIfNotAtMaxScrollPosition(scrollOffset); 427 m_webPage.didUpdateRendering(); 427 428 428 429 if (m_layerTreeHost) … … 821 822 #endif 822 823 824 m_webPage.didUpdateRendering(); 825 823 826 // Layout can trigger more calls to setNeedsDisplay and we don't want to process them 824 827 // until the UI process has painted the update, so we stop the timer here. -
trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp
r276473 r276490 4087 4087 } 4088 4088 4089 void WebPage::didUpdateRendering() 4090 { 4091 if (m_didUpdateRenderingAfterCommittingLoad) 4092 return; 4093 4094 m_didUpdateRenderingAfterCommittingLoad = true; 4095 send(Messages::WebPageProxy::DidUpdateRenderingAfterCommittingLoad()); 4096 } 4097 4089 4098 void WebPage::finalizeRenderingUpdate(OptionSet<FinalizeRenderingUpdateFlags> flags) 4090 4099 { … … 6239 6248 } 6240 6249 6241 #if PLATFORM(MAC)6242 6250 m_didUpdateRenderingAfterCommittingLoad = false; 6243 #endif 6251 6244 6252 #if PLATFORM(IOS_FAMILY) 6245 6253 m_hasReceivedVisibleContentRectsAfterDidCommitLoad = false; -
trunk/Source/WebKit/WebProcess/WebPage/WebPage.h
r276347 r276490 634 634 #endif 635 635 636 void didUpdateRendering(); 637 636 638 #if PLATFORM(MAC) 637 639 void setTopOverhangImage(WebImage*); 638 640 void setBottomOverhangImage(WebImage*); 639 641 640 void didUpdateRendering();641 642 642 void setUseSystemAppearance(bool); 643 643 … … 2301 2301 bool m_canUseCredentialStorage { true }; 2302 2302 2303 #if PLATFORM(MAC)2304 2303 bool m_didUpdateRenderingAfterCommittingLoad { false }; 2305 #endif2306 2304 2307 2305 Vector<String> m_corsDisablingPatterns; -
trunk/Source/WebKit/WebProcess/WebPage/mac/WebPageMac.mm
r276303 r276490 1026 1026 } 1027 1027 1028 void WebPage::didUpdateRendering()1029 {1030 if (m_didUpdateRenderingAfterCommittingLoad)1031 return;1032 1033 m_didUpdateRenderingAfterCommittingLoad = true;1034 send(Messages::WebPageProxy::DidUpdateRenderingAfterCommittingLoad());1035 }1036 1037 1028 #if ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS_FAMILY) 1038 1029 void WebPage::playbackTargetSelected(PlaybackTargetClientContextIdentifier contextId, WebCore::MediaPlaybackTargetContext&& targetContext) const
Note:
See TracChangeset
for help on using the changeset viewer.