Branch: refs/heads/main Home: https://github.com/WebKit/WebKit Commit: b6b2dc97d5c146df11893fc2d18f37177aff696b https://github.com/WebKit/WebKit/commit/b6b2dc97d5c146df11893fc2d18f37177aff696b Author: Wenson Hsieh <wenson_hs...@apple.com> Date: 2025-03-03 (Mon, 03 Mar 2025)
Changed paths: M LayoutTests/TestExpectations M LayoutTests/platform/mac-wk2/TestExpectations M LayoutTests/resources/ui-helper.js A LayoutTests/scrollbars/mac/top-left-content-insets-scrollbar-position-expected.txt A LayoutTests/scrollbars/mac/top-left-content-insets-scrollbar-position.html M LayoutTests/tiled-drawing/top-left-content-insets.html M Source/WebCore/platform/ScrollView.cpp M Source/WebCore/testing/Internals.cpp M Source/WebCore/testing/Internals.h M Source/WebCore/testing/Internals.idl M Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivateForTesting.h M Source/WebKit/UIProcess/API/Cocoa/WKWebViewTesting.mm M Source/WebKit/UIProcess/API/ios/WKWebViewPrivateForTestingIOS.h M Source/WebKit/UIProcess/API/ios/WKWebViewTestingIOS.mm M Tools/WebKitTestRunner/cocoa/UIScriptControllerCocoa.h M Tools/WebKitTestRunner/cocoa/UIScriptControllerCocoa.mm M Tools/WebKitTestRunner/ios/UIScriptControllerIOS.h M Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm Log Message: ----------- [macOS] Vertical scrollbar is misplaced when a nonzero left content inset is set https://bugs.webkit.org/show_bug.cgi?id=288943 rdar://145979548 Reviewed by Megan Gardner. Fix logic in `ScrollView::updateScrollbars` to properly account for left/right content insets: - When computing the vertical scrollbar frame, don't offset by the left content inset; this just pushes the scrollbar offscreen. - When computing the horizontal scrollbar frame, offset it by the left content inset and shrink the size to account for both left/right insets. This ensures that the horizontal scrollbar isn't obscured by the left content inset area. Test: scrollbars/mac/top-left-content-insets-scrollbar-position.html * LayoutTests/TestExpectations: * LayoutTests/platform/mac-wk2/TestExpectations: * LayoutTests/resources/ui-helper.js: (window.UIHelper.propertiesOfLayerWithID): Add a `UIHelper` method to asynchronously grab platform layer properties by layer ID. (window.UIHelper.getCALayerTree): Drive-by fix: remove an unnecessary early return if `!isIOSFamily()`, so that `getCALayerTree` can work on macOS as well. * LayoutTests/scrollbars/mac/top-left-content-insets-scrollbar-position-expected.txt: Added. * LayoutTests/scrollbars/mac/top-left-content-insets-scrollbar-position.html: Added. Add a layout test to exercise the change. * LayoutTests/tiled-drawing/top-left-content-insets.html: Drive-by fix: try to un-flake this layout test by delaying the test by a presentation update. * Source/WebCore/platform/ScrollView.cpp: (WebCore::ScrollView::updateScrollbars): * Source/WebCore/testing/Internals.cpp: (WebCore::getLayerID): (WebCore::Internals::horizontalScrollbarLayerID const): (WebCore::Internals::verticalScrollbarLayerID const): Add internal test helpers to get the platform `GraphicsLayer` IDs for the horizontal and vertical scrollbars. * Source/WebCore/testing/Internals.h: * Source/WebCore/testing/Internals.idl: * Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivateForTesting.h: * Source/WebKit/UIProcess/API/Cocoa/WKWebViewTesting.mm: (-[WKWebView _propertiesOfLayerWithID:]): Move this into `WKWebViewTesting.mm`, so that we can use it on both macOS and iOS. * Source/WebKit/UIProcess/API/ios/WKWebViewPrivateForTestingIOS.h: * Source/WebKit/UIProcess/API/ios/WKWebViewTestingIOS.mm: (-[WKWebView _propertiesOfLayerWithID:]): Deleted. * Tools/WebKitTestRunner/cocoa/UIScriptControllerCocoa.h: * Tools/WebKitTestRunner/cocoa/UIScriptControllerCocoa.mm: (WTR::UIScriptControllerCocoa::propertiesOfLayerWithID const): * Tools/WebKitTestRunner/ios/UIScriptControllerIOS.h: * Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm: (WTR::UIScriptControllerIOS::propertiesOfLayerWithID const): Deleted. Canonical link: https://commits.webkit.org/291496@main To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications _______________________________________________ webkit-changes mailing list webkit-changes@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-changes