Branch: refs/heads/main Home: https://github.com/WebKit/WebKit Commit: 337e6bee8615c22c0fdd27f6af7481a16af57182 https://github.com/WebKit/WebKit/commit/337e6bee8615c22c0fdd27f6af7481a16af57182 Author: Wenson Hsieh <wenson_hs...@apple.com> Date: 2023-04-21 (Fri, 21 Apr 2023)
Changed paths: M Source/WebCore/page/LocalFrameView.cpp M Source/WebCore/page/LocalFrameView.h M Source/WebCore/platform/ScrollableArea.h M Source/WebCore/platform/Scrollbar.cpp M Source/WebCore/rendering/RenderLayerCompositor.cpp M Source/WebCore/rendering/RenderLayerScrollableArea.cpp M Source/WebCore/rendering/RenderLayerScrollableArea.h M Source/WebCore/rendering/RenderListBox.cpp M Source/WebCore/rendering/RenderListBox.h Log Message: ----------- REGRESSION (262243@main): LFC enters a broken, semi-enabled state after rendering scrollbars https://bugs.webkit.org/show_bug.cgi?id=255741 rdar://108112443 Reviewed by Simon Fraser and Alan Baradlay. When GPU process and UI-side compositing on macOS are enabled, 262243@main had inadvertently added a call to `LocalFrameView::displayView()` in the process of asking for the current page scale; this instantiates a `m_displayView` in the process, the existence of which causes us to reattach or detach the root layer in `LocalFrameView::setIsInWindow()`. `Display::View` was not intended to be used outside of LFC, so we should avoid instantiating it unless necessary; to fix this bug, we instead add a `deviceScaleFactor()` override hook to `ScrollableArea`, implement it in all relevant subclasses by asking the `Page`, and then plumbing this information at paint time to `Scrollbar`, through `ScrollableArea`. This is done (as opposed to adding a method that reads off of the `FrameView` or `Page` directly in scrollbar) to avoid layering violations due to accessing non-platform WebCore logic from within `platform/`. Additionally, we enforce this moving forward by asserting that LFC is enabled when asking for `Display::View`, which would have fired in the previous test I added in 262243@main. * Source/WebCore/page/LocalFrameView.cpp: (WebCore::LocalFrameView::displayView): (WebCore::LocalFrameView::deviceScaleFactor const): * Source/WebCore/page/LocalFrameView.h: * Source/WebCore/platform/ScrollableArea.h: (WebCore::ScrollableArea::deviceScaleFactor const): * Source/WebCore/platform/Scrollbar.cpp: (WebCore::Scrollbar::deviceScaleFactor const): * Source/WebCore/rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::deviceScaleFactor const): * Source/WebCore/rendering/RenderLayerScrollableArea.cpp: (WebCore::RenderLayerScrollableArea::deviceScaleFactor const): * Source/WebCore/rendering/RenderLayerScrollableArea.h: * Source/WebCore/rendering/RenderListBox.cpp: (WebCore::RenderListBox::deviceScaleFactor const): * Source/WebCore/rendering/RenderListBox.h: Canonical link: https://commits.webkit.org/263241@main _______________________________________________ webkit-changes mailing list webkit-changes@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-changes