[webkit-changes] [WebKit/WebKit] 16b186: [UI-side compositing] Add UI process SPIs to add p...

Said Abou-Hallawa noreply at github.com
Mon Mar 13 16:09:40 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 16b186659066d6935156abc2fe6f2fa979fa6207
      https://github.com/WebKit/WebKit/commit/16b186659066d6935156abc2fe6f2fa979fa6207
  Author: Said Abou-Hallawa <said at apple.com>
  Date:   2023-03-13 (Mon, 13 Mar 2023)

  Changed paths:
    M LayoutTests/tiled-drawing/scrolling/non-fast-region/top-content-inset-header-expected.txt
    M Source/WebCore/page/FrameView.cpp
    M Source/WebCore/page/FrameView.h
    M Source/WebCore/page/Page.cpp
    M Source/WebCore/page/scrolling/ScrollingTree.cpp
    M Source/WebCore/page/scrolling/ScrollingTree.h
    M Source/WebCore/platform/ScrollView.h
    M Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h
    M Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm
    M Source/WebKit/Shared/WebPageCreationParameters.cpp
    M Source/WebKit/Shared/WebPageCreationParameters.h
    M Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h
    M Source/WebKit/UIProcess/API/mac/WKWebViewMac.mm
    M Source/WebKit/UIProcess/API/mac/WKWebViewPrivateForTestingMac.h
    M Source/WebKit/UIProcess/API/mac/WKWebViewTestingMac.mm
    M Source/WebKit/UIProcess/PageClient.h
    M Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeHost.h
    M Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm
    M Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp
    M Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h
    M Source/WebKit/UIProcess/RemoteLayerTree/mac/RemoteLayerTreeDrawingAreaProxyMac.h
    M Source/WebKit/UIProcess/RemoteLayerTree/mac/RemoteLayerTreeDrawingAreaProxyMac.mm
    M Source/WebKit/UIProcess/WebPageProxy.cpp
    M Source/WebKit/UIProcess/WebPageProxy.h
    M Source/WebKit/UIProcess/mac/PageClientImplMac.h
    M Source/WebKit/UIProcess/mac/PageClientImplMac.mm
    M Source/WebKit/UIProcess/mac/WebPageProxyMac.mm
    M Source/WebKit/UIProcess/mac/WebViewImpl.h
    M Source/WebKit/UIProcess/mac/WebViewImpl.mm
    M Source/WebKit/WebProcess/WebPage/WebPage.cpp
    M Source/WebKit/WebProcess/WebPage/WebPage.h
    M Source/WebKit/WebProcess/WebPage/WebPage.messages.in
    M Source/WebKit/WebProcess/WebPage/mac/RemoteLayerTreeDrawingAreaMac.mm
    M Tools/MiniBrowser/MiniBrowser.xcodeproj/project.pbxproj
    M Tools/MiniBrowser/mac/WK2BrowserWindowController.m

  Log Message:
  -----------
  [UI-side compositing] Add UI process SPIs to add page banners
https://bugs.webkit.org/show_bug.cgi?id=253554
rdar://101040993

Reviewed by Simon Fraser.

The client of WKWebView will provide CALayers for the page banners. Their heights
will adjust the page scroll rectangle.

Two members will be added to WebPageCreationParameters to communicate the header
and footer heights with core Page if they are are set before creating the WebPage
by the WebProcess.

RemoteLayerTreeHost::updateLayerTree() will add the banners as sub-layers to the
scrolledContentsLayer. Because it is not defined in the UIProcess, its layerID
will be added to RemoteLayerTreeTransaction.

RemoteLayerTreeDrawingAreaProxyMac::didCommitLayerTree() will ensure the position
and the width of the banner layers are adjusted if the totalContentHeight or the
contentWidth change.

Mini browser will be used to test this feature manually. It will create two dummy
CALayers and call the WKWebView SPI when the setting: "Reserve Space For Banners"
is checked. It will call the SPI with nil pointer if this setting is unchecked.

* LayoutTests/tiled-drawing/scrolling/non-fast-region/top-content-inset-header-expected.txt:
* Source/WebCore/page/FrameView.cpp:
(WebCore::FrameView::graphicsLayerForScrolledContents):
* Source/WebCore/page/FrameView.h:
* Source/WebCore/page/Page.cpp:
(WebCore::Page::setHeaderHeight):
(WebCore::Page::setFooterHeight):
* Source/WebCore/page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::mainFrameTopContentInset const):
* Source/WebCore/page/scrolling/ScrollingTree.h:
* Source/WebCore/platform/ScrollView.h:
* Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h:
(WebKit::RemoteLayerTreeTransaction::scrolledContentsLayerID const):
(WebKit::RemoteLayerTreeTransaction::setScrolledContentsLayerID):
* Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
(WebKit::RemoteLayerTreeTransaction::encode const):
(WebKit::RemoteLayerTreeTransaction::decode):
(WebKit::RemoteLayerTreeTransaction::description const):
* Source/WebKit/Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode const):
(WebKit::WebPageCreationParameters::decode):
* Source/WebKit/Shared/WebPageCreationParameters.h:
* Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h:
* Source/WebKit/UIProcess/API/mac/WKWebViewMac.mm:
(-[WKWebView _setHeaderBannerLayer:]):
(-[WKWebView _headerBannerLayer]):
(-[WKWebView _setFooterBannerLayer:]):
(-[WKWebView _footerBannerLayer]):
* Source/WebKit/UIProcess/API/mac/WKWebViewPrivateForTestingMac.h:
* Source/WebKit/UIProcess/API/mac/WKWebViewTestingMac.mm:
(-[WKWebView _setHeaderBannerHeight:]): Deleted.
(-[WKWebView _setFooterBannerHeight:]): Deleted.
* Source/WebKit/UIProcess/PageClient.h:
* Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeHost.h:
* Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
(WebKit::RemoteLayerTreeHost::updateBannerLayers):
(WebKit::RemoteLayerTreeHost::updateLayerTree):
* Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
(WebKit::RemoteScrollingCoordinatorProxy::topContentInset const):
* Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
* Source/WebKit/UIProcess/RemoteLayerTree/mac/RemoteLayerTreeDrawingAreaProxyMac.h:
* Source/WebKit/UIProcess/RemoteLayerTree/mac/RemoteLayerTreeDrawingAreaProxyMac.mm:
(WebKit::RemoteLayerTreeDrawingAreaProxyMac::layoutBannerLayers):
(WebKit::RemoteLayerTreeDrawingAreaProxyMac::didCommitLayerTree):
* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::creationParameters):
(WebKit::WebPageProxy::setHeaderBannerHeight):
(WebKit::WebPageProxy::setFooterBannerHeight):
(WebKit::WebPageProxy::setHeaderBannerHeightForTesting): Deleted.
(WebKit::WebPageProxy::setFooterBannerHeightForTesting): Deleted.
* Source/WebKit/UIProcess/WebPageProxy.h:
* Source/WebKit/UIProcess/mac/PageClientImplMac.h:
* Source/WebKit/UIProcess/mac/PageClientImplMac.mm:
(WebKit::PageClientImpl::headerBannerLayer const):
(WebKit::PageClientImpl::footerBannerLayer const):
* Source/WebKit/UIProcess/mac/WebPageProxyMac.mm:
(WebKit::WebPageProxy::headerBannerLayer const):
(WebKit::WebPageProxy::footerBannerLayer const):
(WebKit::WebPageProxy::headerBannerHeight const):
(WebKit::WebPageProxy::footerBannerHeight const):
* Source/WebKit/UIProcess/mac/WebViewImpl.h:
(WebKit::WebViewImpl::headerBannerLayer const):
(WebKit::WebViewImpl::footerBannerLayer const):
* Source/WebKit/UIProcess/mac/WebViewImpl.mm:
(WebKit::WebViewImpl::setHeaderBannerLayer):
(WebKit::WebViewImpl::setFooterBannerLayer):
* Source/WebKit/WebProcess/WebPage/WebPage.cpp:
(WebKit::m_appHighlightsVisible):
(WebKit::WebPage::setHeaderBannerHeight):
(WebKit::WebPage::setFooterBannerHeight):
(WebKit::WebPage::setHeaderBannerHeightForTesting): Deleted.
(WebKit::WebPage::setFooterBannerHeightForTesting): Deleted.
* Source/WebKit/WebProcess/WebPage/WebPage.h:
* Source/WebKit/WebProcess/WebPage/WebPage.messages.in:
* Source/WebKit/WebProcess/WebPage/mac/RemoteLayerTreeDrawingAreaMac.mm:
(WebKit::RemoteLayerTreeDrawingAreaMac::willCommitLayerTree):
* Tools/MiniBrowser/MiniBrowser.xcodeproj/project.pbxproj:
* Tools/MiniBrowser/mac/WK2BrowserWindowController.m:
(-[WK2BrowserWindowController didChangeSettings]):

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




More information about the webkit-changes mailing list