⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 276158 in webkit


Ignore:
Timestamp:
Apr 16, 2021, 12:26:25 PM (5 years ago)
Author:
Russell Epstein
Message:

Cherry-pick r275485. rdar://problem/76412930

Make sure we no longer show the previous page when running a JS prompt
https://bugs.webkit.org/show_bug.cgi?id=215782
<rdar://problem/67698601>

Reviewed by Darin Adler.

Source/WebCore:

Add linked-on-after check for the behavior change to minimize the risk of
breakage.

  • platform/cocoa/VersionChecks.h:

Source/WebKit:

Make sure we no longer show the previous page when running a JS prompt.
If we have not yet done a layer tree commit since the last load commit, then
we are likely still showing the previous page. If we are asked to run a JS
prompt / alert / confirm at this point, it would be confusing to still show
the previous page. In order to address the issue, we now make the view blank
in such scenario (ideally, we'd have painted the new page but this is
currently not a trivial thing to do).

To make the view blank, the approach chosen is the set the opacity of our
root layer to 0 when the JS prompt is requested (before the first paint) and
set the opacity back to 1 after the first paint.

To minimize the risks of breakage, the behavior change is behind a
linked-on-after check. Also, we only trigger this behavior if the WKWebView
client actually implements the corresponding JS prompt delegate.

  • UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::UIClient::runJavaScriptAlert): (WebKit::UIDelegate::UIClient::runJavaScriptConfirm): (WebKit::UIDelegate::UIClient::runJavaScriptPrompt):
  • UIProcess/PageClient.h: (WebKit::PageClient::makeViewBlank):
  • UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::stopMakingViewBlankDueToLackOfRenderingUpdate): (WebKit::WebPageProxy::makeViewBlankIfUnpaintedSinceLastLoadCommit): (WebKit::WebPageProxy::didCommitLoadForFrame): (WebKit::WebPageProxy::runJavaScriptAlert):
  • UIProcess/WebPageProxy.h:
  • UIProcess/WebPageProxy.messages.in:
  • UIProcess/ios/PageClientImplIOS.h:
  • UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::makeViewBlank):
  • UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::didCommitLayerTree):
  • UIProcess/mac/PageClientImplMac.h:
  • UIProcess/mac/PageClientImplMac.mm: (WebKit::PageClientImpl::makeViewBlank):
  • UIProcess/mac/WebPageProxyMac.mm: (WebKit::WebPageProxy::didUpdateRenderingAfterCommittingLoad):
  • WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::runJavaScriptAlert): (WebKit::WebChromeClient::runJavaScriptConfirm): (WebKit::WebChromeClient::runJavaScriptPrompt): Add flag to make sure pending async messages are processed *before* the JS prompt sync IPCs. Without this, it was possible for the UIProcess to receive the JS prompt IPC *before* the DidCommitLoadForFrame IPC, which would confuse our logic, since we would think this is a JS prompt for the previous page.
  • WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::didCommitLoad):
  • WebProcess/WebPage/WebPage.h: (WebKit::WebPage::sendSyncWithDelayedReply):
  • WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: (WebKit::TiledCoreAnimationDrawingArea::updateRendering):
  • WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::didUpdateRendering):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@275485 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Location:
branches/safari-611-branch/Source
Files:
19 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-611-branch/Source/WebCore/ChangeLog

    r276156 r276158  
     12021-04-16  Russell Epstein  <repstein@apple.com>
     2
     3        Cherry-pick r275485. rdar://problem/76412930
     4
     5    Make sure we no longer show the previous page when running a JS prompt
     6    https://bugs.webkit.org/show_bug.cgi?id=215782
     7    <rdar://problem/67698601>
     8   
     9    Reviewed by Darin Adler.
     10   
     11    Source/WebCore:
     12   
     13    Add linked-on-after check for the behavior change to minimize the risk of
     14    breakage.
     15   
     16    * platform/cocoa/VersionChecks.h:
     17   
     18    Source/WebKit:
     19   
     20    Make sure we no longer show the previous page when running a JS prompt.
     21    If we have not yet done a layer tree commit since the last load commit, then
     22    we are likely still showing the previous page. If we are asked to run a JS
     23    prompt / alert / confirm at this point, it would be confusing to still show
     24    the previous page. In order to address the issue, we now make the view blank
     25    in such scenario (ideally, we'd have painted the new page but this is
     26    currently not a trivial thing to do).
     27   
     28    To make the view blank, the approach chosen is the set the opacity of our
     29    root layer to 0 when the JS prompt is requested (before the first paint) and
     30    set the opacity back to 1 after the first paint.
     31   
     32    To minimize the risks of breakage, the behavior change is behind a
     33    linked-on-after check. Also, we only trigger this behavior if the WKWebView
     34    client actually implements the corresponding JS prompt delegate.
     35   
     36    * UIProcess/Cocoa/UIDelegate.mm:
     37    (WebKit::UIDelegate::UIClient::runJavaScriptAlert):
     38    (WebKit::UIDelegate::UIClient::runJavaScriptConfirm):
     39    (WebKit::UIDelegate::UIClient::runJavaScriptPrompt):
     40    * UIProcess/PageClient.h:
     41    (WebKit::PageClient::makeViewBlank):
     42    * UIProcess/WebPageProxy.cpp:
     43    (WebKit::WebPageProxy::stopMakingViewBlankDueToLackOfRenderingUpdate):
     44    (WebKit::WebPageProxy::makeViewBlankIfUnpaintedSinceLastLoadCommit):
     45    (WebKit::WebPageProxy::didCommitLoadForFrame):
     46    (WebKit::WebPageProxy::runJavaScriptAlert):
     47    * UIProcess/WebPageProxy.h:
     48    * UIProcess/WebPageProxy.messages.in:
     49    * UIProcess/ios/PageClientImplIOS.h:
     50    * UIProcess/ios/PageClientImplIOS.mm:
     51    (WebKit::PageClientImpl::makeViewBlank):
     52    * UIProcess/ios/WebPageProxyIOS.mm:
     53    (WebKit::WebPageProxy::didCommitLayerTree):
     54    * UIProcess/mac/PageClientImplMac.h:
     55    * UIProcess/mac/PageClientImplMac.mm:
     56    (WebKit::PageClientImpl::makeViewBlank):
     57    * UIProcess/mac/WebPageProxyMac.mm:
     58    (WebKit::WebPageProxy::didUpdateRenderingAfterCommittingLoad):
     59    * WebProcess/WebCoreSupport/WebChromeClient.cpp:
     60    (WebKit::WebChromeClient::runJavaScriptAlert):
     61    (WebKit::WebChromeClient::runJavaScriptConfirm):
     62    (WebKit::WebChromeClient::runJavaScriptPrompt):
     63    Add flag to make sure pending async messages are processed *before* the JS prompt sync IPCs.
     64    Without this, it was possible for the UIProcess to receive the JS prompt IPC *before* the
     65    DidCommitLoadForFrame IPC, which would confuse our logic, since we would think this is a JS
     66    prompt for the previous page.
     67   
     68    * WebProcess/WebPage/WebPage.cpp:
     69    (WebKit::WebPage::didCommitLoad):
     70    * WebProcess/WebPage/WebPage.h:
     71    (WebKit::WebPage::sendSyncWithDelayedReply):
     72    * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
     73    (WebKit::TiledCoreAnimationDrawingArea::updateRendering):
     74    * WebProcess/WebPage/mac/WebPageMac.mm:
     75    (WebKit::WebPage::didUpdateRendering):
     76   
     77    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@275485 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     78
     79    2021-04-05  Chris Dumez  <cdumez@apple.com>
     80
     81            Make sure we no longer show the previous page when running a JS prompt
     82            https://bugs.webkit.org/show_bug.cgi?id=215782
     83            <rdar://problem/67698601>
     84
     85            Reviewed by Darin Adler.
     86
     87            Add linked-on-after check for the behavior change to minimize the risk of
     88            breakage.
     89
     90            * platform/cocoa/VersionChecks.h:
     91
    1922021-04-16  Russell Epstein  <repstein@apple.com>
    293
  • branches/safari-611-branch/Source/WebCore/platform/cocoa/VersionChecks.h

    r276151 r276158  
    7070    FirstWithoutWeChatScrollingQuirk = DYLD_IOS_VERSION_14_5,
    7171    FirstWithSharedNetworkProcess = DYLD_IOS_VERSION_14_5,
     72    FirstWithBlankViewOnJSPrompt = DYLD_IOS_VERSION_14_5,
    7273#elif PLATFORM(MAC)
    7374    FirstWithNetworkCache = DYLD_MACOSX_VERSION_10_11,
     
    8990    FirstWithDataURLFragmentRemoval = DYLD_MACOSX_VERSION_11_3,
    9091    FirstWithHTMLDocumentSupportedPropertyNames = DYLD_MACOSX_VERSION_11_3,
     92    FirstWithBlankViewOnJSPrompt = DYLD_MACOSX_VERSION_11_3,
    9193#endif
    9294};
  • branches/safari-611-branch/Source/WebKit/ChangeLog

    r276157 r276158  
     12021-04-16  Russell Epstein  <repstein@apple.com>
     2
     3        Cherry-pick r275485. rdar://problem/76412930
     4
     5    Make sure we no longer show the previous page when running a JS prompt
     6    https://bugs.webkit.org/show_bug.cgi?id=215782
     7    <rdar://problem/67698601>
     8   
     9    Reviewed by Darin Adler.
     10   
     11    Source/WebCore:
     12   
     13    Add linked-on-after check for the behavior change to minimize the risk of
     14    breakage.
     15   
     16    * platform/cocoa/VersionChecks.h:
     17   
     18    Source/WebKit:
     19   
     20    Make sure we no longer show the previous page when running a JS prompt.
     21    If we have not yet done a layer tree commit since the last load commit, then
     22    we are likely still showing the previous page. If we are asked to run a JS
     23    prompt / alert / confirm at this point, it would be confusing to still show
     24    the previous page. In order to address the issue, we now make the view blank
     25    in such scenario (ideally, we'd have painted the new page but this is
     26    currently not a trivial thing to do).
     27   
     28    To make the view blank, the approach chosen is the set the opacity of our
     29    root layer to 0 when the JS prompt is requested (before the first paint) and
     30    set the opacity back to 1 after the first paint.
     31   
     32    To minimize the risks of breakage, the behavior change is behind a
     33    linked-on-after check. Also, we only trigger this behavior if the WKWebView
     34    client actually implements the corresponding JS prompt delegate.
     35   
     36    * UIProcess/Cocoa/UIDelegate.mm:
     37    (WebKit::UIDelegate::UIClient::runJavaScriptAlert):
     38    (WebKit::UIDelegate::UIClient::runJavaScriptConfirm):
     39    (WebKit::UIDelegate::UIClient::runJavaScriptPrompt):
     40    * UIProcess/PageClient.h:
     41    (WebKit::PageClient::makeViewBlank):
     42    * UIProcess/WebPageProxy.cpp:
     43    (WebKit::WebPageProxy::stopMakingViewBlankDueToLackOfRenderingUpdate):
     44    (WebKit::WebPageProxy::makeViewBlankIfUnpaintedSinceLastLoadCommit):
     45    (WebKit::WebPageProxy::didCommitLoadForFrame):
     46    (WebKit::WebPageProxy::runJavaScriptAlert):
     47    * UIProcess/WebPageProxy.h:
     48    * UIProcess/WebPageProxy.messages.in:
     49    * UIProcess/ios/PageClientImplIOS.h:
     50    * UIProcess/ios/PageClientImplIOS.mm:
     51    (WebKit::PageClientImpl::makeViewBlank):
     52    * UIProcess/ios/WebPageProxyIOS.mm:
     53    (WebKit::WebPageProxy::didCommitLayerTree):
     54    * UIProcess/mac/PageClientImplMac.h:
     55    * UIProcess/mac/PageClientImplMac.mm:
     56    (WebKit::PageClientImpl::makeViewBlank):
     57    * UIProcess/mac/WebPageProxyMac.mm:
     58    (WebKit::WebPageProxy::didUpdateRenderingAfterCommittingLoad):
     59    * WebProcess/WebCoreSupport/WebChromeClient.cpp:
     60    (WebKit::WebChromeClient::runJavaScriptAlert):
     61    (WebKit::WebChromeClient::runJavaScriptConfirm):
     62    (WebKit::WebChromeClient::runJavaScriptPrompt):
     63    Add flag to make sure pending async messages are processed *before* the JS prompt sync IPCs.
     64    Without this, it was possible for the UIProcess to receive the JS prompt IPC *before* the
     65    DidCommitLoadForFrame IPC, which would confuse our logic, since we would think this is a JS
     66    prompt for the previous page.
     67   
     68    * WebProcess/WebPage/WebPage.cpp:
     69    (WebKit::WebPage::didCommitLoad):
     70    * WebProcess/WebPage/WebPage.h:
     71    (WebKit::WebPage::sendSyncWithDelayedReply):
     72    * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
     73    (WebKit::TiledCoreAnimationDrawingArea::updateRendering):
     74    * WebProcess/WebPage/mac/WebPageMac.mm:
     75    (WebKit::WebPage::didUpdateRendering):
     76   
     77    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@275485 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     78
     79    2021-04-05  Chris Dumez  <cdumez@apple.com>
     80
     81            Make sure we no longer show the previous page when running a JS prompt
     82            https://bugs.webkit.org/show_bug.cgi?id=215782
     83            <rdar://problem/67698601>
     84
     85            Reviewed by Darin Adler.
     86
     87            Make sure we no longer show the previous page when running a JS prompt.
     88            If we have not yet done a layer tree commit since the last load commit, then
     89            we are likely still showing the previous page. If we are asked to run a JS
     90            prompt / alert / confirm at this point, it would be confusing to still show
     91            the previous page. In order to address the issue, we now make the view blank
     92            in such scenario (ideally, we'd have painted the new page but this is
     93            currently not a trivial thing to do).
     94
     95            To make the view blank, the approach chosen is the set the opacity of our
     96            root layer to 0 when the JS prompt is requested (before the first paint) and
     97            set the opacity back to 1 after the first paint.
     98
     99            To minimize the risks of breakage, the behavior change is behind a
     100            linked-on-after check. Also, we only trigger this behavior if the WKWebView
     101            client actually implements the corresponding JS prompt delegate.
     102
     103            * UIProcess/Cocoa/UIDelegate.mm:
     104            (WebKit::UIDelegate::UIClient::runJavaScriptAlert):
     105            (WebKit::UIDelegate::UIClient::runJavaScriptConfirm):
     106            (WebKit::UIDelegate::UIClient::runJavaScriptPrompt):
     107            * UIProcess/PageClient.h:
     108            (WebKit::PageClient::makeViewBlank):
     109            * UIProcess/WebPageProxy.cpp:
     110            (WebKit::WebPageProxy::stopMakingViewBlankDueToLackOfRenderingUpdate):
     111            (WebKit::WebPageProxy::makeViewBlankIfUnpaintedSinceLastLoadCommit):
     112            (WebKit::WebPageProxy::didCommitLoadForFrame):
     113            (WebKit::WebPageProxy::runJavaScriptAlert):
     114            * UIProcess/WebPageProxy.h:
     115            * UIProcess/WebPageProxy.messages.in:
     116            * UIProcess/ios/PageClientImplIOS.h:
     117            * UIProcess/ios/PageClientImplIOS.mm:
     118            (WebKit::PageClientImpl::makeViewBlank):
     119            * UIProcess/ios/WebPageProxyIOS.mm:
     120            (WebKit::WebPageProxy::didCommitLayerTree):
     121            * UIProcess/mac/PageClientImplMac.h:
     122            * UIProcess/mac/PageClientImplMac.mm:
     123            (WebKit::PageClientImpl::makeViewBlank):
     124            * UIProcess/mac/WebPageProxyMac.mm:
     125            (WebKit::WebPageProxy::didUpdateRenderingAfterCommittingLoad):
     126            * WebProcess/WebCoreSupport/WebChromeClient.cpp:
     127            (WebKit::WebChromeClient::runJavaScriptAlert):
     128            (WebKit::WebChromeClient::runJavaScriptConfirm):
     129            (WebKit::WebChromeClient::runJavaScriptPrompt):
     130            Add flag to make sure pending async messages are processed *before* the JS prompt sync IPCs.
     131            Without this, it was possible for the UIProcess to receive the JS prompt IPC *before* the
     132            DidCommitLoadForFrame IPC, which would confuse our logic, since we would think this is a JS
     133            prompt for the previous page.
     134
     135            * WebProcess/WebPage/WebPage.cpp:
     136            (WebKit::WebPage::didCommitLoad):
     137            * WebProcess/WebPage/WebPage.h:
     138            (WebKit::WebPage::sendSyncWithDelayedReply):
     139            * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
     140            (WebKit::TiledCoreAnimationDrawingArea::updateRendering):
     141            * WebProcess/WebPage/mac/WebPageMac.mm:
     142            (WebKit::WebPage::didUpdateRendering):
     143
    11442021-04-16  Russell Epstein  <repstein@apple.com>
    2145
  • branches/safari-611-branch/Source/WebKit/UIProcess/Cocoa/UIDelegate.mm

    r276151 r276158  
    302302    }
    303303
     304    page.makeViewBlankIfUnpaintedSinceLastLoadCommit();
     305
    304306    auto checker = CompletionHandlerCallChecker::create(delegate.get(), @selector(webView:runJavaScriptAlertPanelWithMessage:initiatedByFrame:completionHandler:));
    305307    [delegate webView:m_uiDelegate->m_webView.get().get() runJavaScriptAlertPanelWithMessage:message initiatedByFrame:wrapper(API::FrameInfo::create(WTFMove(frameInfo), &page)) completionHandler:makeBlockPtr([completionHandler = WTFMove(completionHandler), checker = WTFMove(checker)] {
     
    327329    }
    328330
     331    page.makeViewBlankIfUnpaintedSinceLastLoadCommit();
     332
    329333    auto checker = CompletionHandlerCallChecker::create(delegate.get(), @selector(webView:runJavaScriptConfirmPanelWithMessage:initiatedByFrame:completionHandler:));
    330334    [delegate webView:m_uiDelegate->m_webView.get().get() runJavaScriptConfirmPanelWithMessage:message initiatedByFrame:wrapper(API::FrameInfo::create(WTFMove(frameInfo), &page)) completionHandler:makeBlockPtr([completionHandler = WTFMove(completionHandler), checker = WTFMove(checker)] (BOOL result) mutable {
     
    351355        return;
    352356    }
     357
     358    page.makeViewBlankIfUnpaintedSinceLastLoadCommit();
    353359
    354360    auto checker = CompletionHandlerCallChecker::create(delegate.get(), @selector(webView:runJavaScriptTextInputPanelWithPrompt:defaultText:initiatedByFrame:completionHandler:));
  • branches/safari-611-branch/Source/WebKit/UIProcess/PageClient.h

    r276151 r276158  
    504504    virtual void setMouseEventPolicy(WebCore::MouseEventPolicy) { }
    505505
     506    virtual void makeViewBlank(bool) { }
     507
    506508#if PLATFORM(MAC)
    507509    virtual void didPerformImmediateActionHitTest(const WebHitTestResultData&, bool contentPreventsDefault, API::Object*) = 0;
  • branches/safari-611-branch/Source/WebKit/UIProcess/WebPageProxy.cpp

    r276151 r276158  
    23962396#endif
    23972397
     2398void WebPageProxy::stopMakingViewBlankDueToLackOfRenderingUpdate()
     2399{
     2400#if PLATFORM(COCOA)
     2401    ASSERT(m_hasUpdatedRenderingAfterDidCommitLoad);
     2402    RELEASE_LOG_IF_ALLOWED(Process, "stopMakingViewBlankDueToLackOfRenderingUpdate:");
     2403    pageClient().makeViewBlank(false);
     2404#endif
     2405}
     2406
     2407// If we have not painted yet since the last load commit, then we are likely still displaying the previous page.
     2408// Displaying a JS prompt for the new page with the old page behind would be confusing so we make the view blank
     2409// until the next paint in such case.
     2410void WebPageProxy::makeViewBlankIfUnpaintedSinceLastLoadCommit()
     2411{
     2412#if PLATFORM(COCOA)
     2413    if (!m_hasUpdatedRenderingAfterDidCommitLoad) {
     2414        static bool shouldMakeViewBlank = linkedOnOrAfter(WebCore::SDKVersion::FirstWithBlankViewOnJSPrompt);
     2415        if (shouldMakeViewBlank) {
     2416            RELEASE_LOG_IF_ALLOWED(Process, "makeViewBlankIfUnpaintedSinceLastLoadCommit: Making the view blank because of a JS prompt before the first paint for its page");
     2417            pageClient().makeViewBlank(true);
     2418        }
     2419    }
     2420#endif
     2421}
     2422
    23982423void WebPageProxy::discardQueuedMouseEvents()
    23992424{
     
    46294654    m_process->didCommitProvisionalLoad();
    46304655
     4656#if PLATFORM(COCOA)
     4657    if (frame->isMainFrame()) {
     4658        m_hasUpdatedRenderingAfterDidCommitLoad = false;
    46314659#if PLATFORM(IOS_FAMILY)
    4632     if (frame->isMainFrame()) {
    4633         m_hasReceivedLayerTreeTransactionAfterDidCommitLoad = false;
    46344660        m_firstLayerTreeTransactionIdAfterDidCommitLoad = downcast<RemoteLayerTreeDrawingAreaProxy>(*drawingArea()).nextLayerTreeTransactionID();
     4661#endif
    46354662    }
    46364663#endif
  • branches/safari-611-branch/Source/WebKit/UIProcess/WebPageProxy.h

    r276151 r276158  
    575575
    576576    WeakPtr<SecKeyProxyStore> secKeyProxyStore(const WebCore::AuthenticationChallenge&);
     577
     578    void makeViewBlankIfUnpaintedSinceLastLoadCommit();
    577579       
    578580    void close();
     
    21192121#endif
    21202122
     2123    void stopMakingViewBlankDueToLackOfRenderingUpdate();
     2124
    21212125    // Spelling and grammar.
    21222126    void checkSpellingOfString(const String& text, CompletionHandler<void(int32_t misspellingLocation, int32_t misspellingLength)>&&);
     
    21502154#endif
    21512155#if PLATFORM(MAC)
     2156    void didUpdateRenderingAfterCommittingLoad();
    21522157    void fontAtSelectionCallback(const FontInfo&, double, bool, CallbackID);
    21532158#endif
     
    24502455    TransactionID m_firstLayerTreeTransactionIdAfterDidCommitLoad;
    24512456    int32_t m_deviceOrientation { 0 };
    2452     bool m_hasReceivedLayerTreeTransactionAfterDidCommitLoad { true };
    24532457    bool m_hasNetworkRequestsOnSuspended { false };
    24542458    bool m_isKeyboardAnimatingIn { false };
     
    25742578    bool m_isInPrintingMode { false };
    25752579    bool m_isPerformingDOMPrintOperation { false };
     2580
     2581#if PLATFORM(COCOA)
     2582    bool m_hasUpdatedRenderingAfterDidCommitLoad { true };
     2583#endif
    25762584
    25772585    WebCore::ResourceRequest m_decidePolicyForResponseRequest;
  • branches/safari-611-branch/Source/WebKit/UIProcess/WebPageProxy.messages.in

    r276151 r276158  
    377377
    378378    SetEditableElementIsFocused(bool editableElementIsFocused)
     379    DidUpdateRenderingAfterCommittingLoad()
    379380#endif
    380381
  • branches/safari-611-branch/Source/WebKit/UIProcess/ios/PageClientImplIOS.h

    r276151 r276158  
    145145    LayerHostingMode viewLayerHostingMode() override { return LayerHostingMode::OutOfProcess; }
    146146
     147    void makeViewBlank(bool) final;
     148
    147149    RefPtr<ViewSnapshot> takeViewSnapshot(Optional<WebCore::IntRect>&&) override;
    148150    void wheelEventWasNotHandledByWebCore(const NativeWebWheelEvent&) override;
  • branches/safari-611-branch/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm

    r276151 r276158  
    476476}
    477477
     478void PageClientImpl::makeViewBlank(bool makeBlank)
     479{
     480    [m_contentView layer].opacity = makeBlank ? 0 : 1;
     481}
     482
    478483void PageClientImpl::showSafeBrowsingWarning(const SafeBrowsingWarning& warning, CompletionHandler<void(Variant<WebKit::ContinueUnsafeLoad, URL>&&)>&& completionHandler)
    479484{
  • branches/safari-611-branch/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm

    r276151 r276158  
    338338    m_pageExtendedBackgroundColor = layerTreeTransaction.pageExtendedBackgroundColor();
    339339
    340     if (!m_hasReceivedLayerTreeTransactionAfterDidCommitLoad) {
     340    if (!m_hasUpdatedRenderingAfterDidCommitLoad) {
    341341        if (layerTreeTransaction.transactionID() >= m_firstLayerTreeTransactionIdAfterDidCommitLoad) {
    342             m_hasReceivedLayerTreeTransactionAfterDidCommitLoad = true;
     342            m_hasUpdatedRenderingAfterDidCommitLoad = true;
     343            stopMakingViewBlankDueToLackOfRenderingUpdate();
    343344            m_lastVisibleContentRectUpdate = VisibleContentRectUpdateInfo();
    344345        }
  • branches/safari-611-branch/Source/WebKit/UIProcess/mac/PageClientImplMac.h

    r276151 r276158  
    222222    void requestDOMPasteAccess(const WebCore::IntRect&, const String&, CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&&) final;
    223223
     224    void makeViewBlank(bool) final;
     225
    224226    NSView *activeView() const;
    225227    NSWindow *activeWindow() const;
  • branches/safari-611-branch/Source/WebKit/UIProcess/mac/PageClientImplMac.mm

    r276151 r276158  
    977977}
    978978
     979
     980void PageClientImpl::makeViewBlank(bool makeBlank)
     981{
     982    m_impl->acceleratedCompositingRootLayer().opacity = makeBlank ? 0 : 1;
     983}
     984
    979985#if HAVE(APP_ACCENT_COLORS)
    980986WebCore::Color PageClientImpl::accentColor()
  • branches/safari-611-branch/Source/WebKit/UIProcess/mac/WebPageProxyMac.mm

    r276151 r276158  
    652652}
    653653
     654void WebPageProxy::didUpdateRenderingAfterCommittingLoad()
     655{
     656    if (m_hasUpdatedRenderingAfterDidCommitLoad)
     657        return;
     658
     659    m_hasUpdatedRenderingAfterDidCommitLoad = true;
     660    stopMakingViewBlankDueToLackOfRenderingUpdate();
     661}
     662
    654663#if ENABLE(UI_PROCESS_PDF_HUD)
    655664
  • branches/safari-611-branch/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp

    r276157 r276158  
    458458    IPC::UnboundedSynchronousIPCScope unboundedSynchronousIPCScope;
    459459
    460     m_page.sendSyncWithDelayedReply(Messages::WebPageProxy::RunJavaScriptAlert(webFrame->frameID(), webFrame->info(), alertText), Messages::WebPageProxy::RunJavaScriptAlert::Reply());
     460    m_page.sendSyncWithDelayedReply(Messages::WebPageProxy::RunJavaScriptAlert(webFrame->frameID(), webFrame->info(), alertText), Messages::WebPageProxy::RunJavaScriptAlert::Reply(), IPC::SendSyncOption::MaintainOrderingWithAsyncMessages);
    461461}
    462462
     
    476476
    477477    bool result = false;
    478     if (!m_page.sendSyncWithDelayedReply(Messages::WebPageProxy::RunJavaScriptConfirm(webFrame->frameID(), webFrame->info(), message), Messages::WebPageProxy::RunJavaScriptConfirm::Reply(result)))
     478    if (!m_page.sendSyncWithDelayedReply(Messages::WebPageProxy::RunJavaScriptConfirm(webFrame->frameID(), webFrame->info(), message), Messages::WebPageProxy::RunJavaScriptConfirm::Reply(result), IPC::SendSyncOption::MaintainOrderingWithAsyncMessages))
    479479        return false;
    480480
     
    496496    IPC::UnboundedSynchronousIPCScope unboundedSynchronousIPCScope;
    497497
    498     if (!m_page.sendSyncWithDelayedReply(Messages::WebPageProxy::RunJavaScriptPrompt(webFrame->frameID(), webFrame->info(), message, defaultValue), Messages::WebPageProxy::RunJavaScriptPrompt::Reply(result)))
     498    if (!m_page.sendSyncWithDelayedReply(Messages::WebPageProxy::RunJavaScriptPrompt(webFrame->frameID(), webFrame->info(), message, defaultValue), Messages::WebPageProxy::RunJavaScriptPrompt::Reply(result), IPC::SendSyncOption::MaintainOrderingWithAsyncMessages))
    499499        return false;
    500500
  • branches/safari-611-branch/Source/WebKit/WebProcess/WebPage/WebPage.cpp

    r276151 r276158  
    60866086    }
    60876087
     6088#if PLATFORM(MAC)
     6089    m_didUpdateRenderingAfterCommittingLoad = false;
     6090#endif
    60886091#if PLATFORM(IOS_FAMILY)
    60896092    m_hasReceivedVisibleContentRectsAfterDidCommitLoad = false;
  • branches/safari-611-branch/Source/WebKit/WebProcess/WebPage/WebPage.h

    r276151 r276158  
    624624    void setTopOverhangImage(WebImage*);
    625625    void setBottomOverhangImage(WebImage*);
     626
     627    void didUpdateRendering();
    626628   
    627629    void setUseSystemAppearance(bool);
     
    12651267
    12661268    template<typename T>
    1267     SendSyncResult sendSyncWithDelayedReply(T&& message, typename T::Reply&& reply)
     1269    SendSyncResult sendSyncWithDelayedReply(T&& message, typename T::Reply&& reply, OptionSet<IPC::SendSyncOption> sendSyncOptions = { })
    12681270    {
    12691271        cancelGesturesBlockedOnSynchronousReplies();
    1270         return sendSync(WTFMove(message), WTFMove(reply), Seconds::infinity(), IPC::SendSyncOption::InformPlatformProcessWillSuspend);
     1272        sendSyncOptions = sendSyncOptions | IPC::SendSyncOption::InformPlatformProcessWillSuspend;
     1273        return sendSync(WTFMove(message), WTFMove(reply), Seconds::infinity(), sendSyncOptions);
    12711274    }
    12721275
     
    21882191    bool m_canUseCredentialStorage { true };
    21892192
     2193#if PLATFORM(MAC)
     2194    bool m_didUpdateRenderingAfterCommittingLoad { false };
     2195#endif
     2196
    21902197    Vector<String> m_corsDisablingPatterns;
    21912198
  • branches/safari-611-branch/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm

    r276151 r276158  
    482482
    483483        sendDidFirstLayerFlushIfNeeded();
     484        m_webPage.didUpdateRendering();
    484485        handleActivityStateChangeCallbacksIfNeeded();
    485486        invalidateRenderingUpdateRunLoopObserver();
  • branches/safari-611-branch/Source/WebKit/WebProcess/WebPage/mac/WebPageMac.mm

    r276151 r276158  
    10291029}
    10301030
     1031void WebPage::didUpdateRendering()
     1032{
     1033    if (m_didUpdateRenderingAfterCommittingLoad)
     1034        return;
     1035
     1036    m_didUpdateRenderingAfterCommittingLoad = true;
     1037    send(Messages::WebPageProxy::DidUpdateRenderingAfterCommittingLoad());
     1038}
     1039
    10311040#if ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS_FAMILY)
    10321041void WebPage::playbackTargetSelected(PlaybackTargetClientContextIdentifier contextId, const WebCore::MediaPlaybackTargetContext& targetContext) const
Note: See TracChangeset for help on using the changeset viewer.