haikuwebkit/LayoutTests/fast/scrolling/rtl-scrollbars-overflow-con...

29 lines
3.7 KiB
HTML
Raw Permalink Normal View History

[WK2] [OS X] Create API for switching RTL scrollbar policy https://bugs.webkit.org/show_bug.cgi?id=156948 <rdar://problem/25707757> Reviewed by Darin Adler. Source/WebCore: There are two schools of thought for where to put scrollbars in RTL environments. The first is that we should obey the content's "dir" attribute, specified on each element. The second is that we should be consistent with the platform (AppKit's) behavior. There are some situations where the placement should be done according to the content. For example, this policy would be used in web browsers. However, there are also places where web content is designed to fit seamlessly amongst native content. In this situation, the placement of the scrollbars should be done according to the view. Because WebKit doesn't know which of these situations it is operating within, this patch adds a new API property, userInterfaceDirectionPolicy, to WKWebViewConfigurationPolicy. This allows clients to instruct us which policy to abide by. It is plumbed to the web process inside the WebPreferencesStore and is ultimately held inside the Page's Settings object. This Setting is consulted by RenderLayerModelObject, which serves as a good centralized place for this policy implementation. This is the class which decides if we should be consulting its RenderStyle or the platform itself when we decide where to put the scrollbars. Putting this decision inside the renderer is important because ScrollableArea often needs to know if scrollbars should be put on the left, but ScrollableArea doesn't know anything about RenderStyles. Therefore, the renderer must be the intermediary between ScrollableArea and the RenderStyle. (ScrollableArea also doesn't directly know anything about renderers either; however, each of the subclasses knows about an appropriate renderer.) Therefore, ScrollableArea gets a new virtual method which is implemented by the RenderLayerModelObject. Tests: fast/scrolling/rtl-scrollbars*.html * WebCore.xcodeproj/project.pbxproj: ScrollableAreaMac.mm is no longer necessary. * page/FrameView.cpp: (WebCore::FrameView::shouldPlaceBlockDirectionScrollbarOnLeft): Overridden ScrollableArea function. * page/FrameView.h: * page/Settings.h: * page/Settings.in: * platform/ScrollView.cpp: Adding two new settings: One to know if we should consult with the RenderStyle or the platform, and the other is whether or not the platform considers itself to be RTL. (WebCore::ScrollView::documentScrollPositionRelativeToViewOrigin): Update to use new mechanism. (WebCore::ScrollView::updateScrollbars): Ditto. (WebCore::ScrollView::scrollCornerRect): Ditto. (WebCore::ScrollView::locationOfContents): Ditto. * platform/ScrollableArea.cpp: (WebCore::ScrollableArea::verticalScrollbarIsOnLeft): Deleted. This was the old mechanism. (WebCore::ScrollableArea::systemLanguageIsRTL): Deleted. Ditto. * platform/ScrollableArea.h: * platform/mac/ScrollableAreaMac.mm: Removed. (WebCore::ScrollableArea::verticalScrollbarIsOnLeft): Deleted. (WebCore::ScrollableArea::systemLanguageIsRTL): Deleted. * platform/mac/ScrollbarThemeMac.mm: (WebCore::ScrollbarThemeMac::didCreateScrollerImp): Update to use new mechanism. * platform/text/WritingMode.h: These enums should match what's in WebKit2. * rendering/RenderBlock.cpp: (WebCore::RenderBlock::logicalLeftOffsetForContent): Update to use new mechanism. (WebCore::RenderBlock::logicalRightOffsetForContent): Ditto. * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::determineLogicalLeftPositionForChild): Ditto. * rendering/RenderBox.cpp: Ditto. (WebCore::RenderBox::contentBoxRect): (WebCore::RenderBox::overflowClipRect): (WebCore::RenderBox::computePositionedLogicalWidth): (WebCore::RenderBox::layoutOverflowRectForPropagation): * rendering/RenderBoxModelObject.cpp: Ditto. (WebCore::RenderBoxModelObject::constrainingRectForStickyPosition): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::resize): Ditto. (WebCore::cornerStart): Migrate to use references. (WebCore::cornerRect): Ditto. (WebCore::RenderLayer::scrollCornerRect): Ditto. (WebCore::resizerCornerRect): Ditto. (WebCore::RenderLayer::scrollCornerAndResizerRect): Ditto. (WebCore::RenderLayer::verticalScrollbarStart): Update to use new mechanism. (WebCore::RenderLayer::horizontalScrollbarStart): Ditto. (WebCore::RenderLayer::offsetFromResizeCorner): Ditto. (WebCore::RenderLayer::positionOverflowControls): Migrate to use references. (WebCore::RenderLayer::computeScrollDimensions): Ditto. (WebCore::RenderLayer::overflowControlsIntersectRect): Ditto. (WebCore::RenderLayer::drawPlatformResizerImage): Update to use new mechanism. (WebCore::RenderLayer::paintResizer): Migrate to use references. (WebCore::RenderLayer::isPointInResizeControl): Ditto. (WebCore::RenderLayer::hitTestOverflowControls): Ditto. (WebCore::RenderLayer::hitTestResizerInFragments): Ditto. * rendering/RenderLayer.h: ScrollableArea override * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::positionForClipLayer): Update to use new mechanism. * rendering/RenderLayerModelObject.cpp: (WebCore::RenderLayerModelObject::shouldPlaceBlockDirectionScrollbarOnLeft): This is the meat of this patch. This is where we decide if we should be interrogating the RenderStyle or the underlying platform. * rendering/RenderLayerModelObject.h: * rendering/RenderListBox.cpp: Update to use new mechanism. (WebCore::RenderListBox::itemBoundingBoxRect): (WebCore::RenderListBox::paintScrollbar): (WebCore::RenderListBox::isPointInOverflowControl): (WebCore::RenderListBox::listIndexAtOffset): (WebCore::RenderListBox::controlClipRect): (WebCore::RenderListBox::invalidateScrollbarRect): (WebCore::RenderListBox::convertFromScrollbarToContainingView): (WebCore::RenderListBox::convertFromContainingViewToScrollbar): * rendering/RenderListBox.h: * rendering/RenderView.cpp: Ditto. (WebCore::RenderView::repaintViewRectangle): * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::shouldPlaceBlockDirectionScrollbarOnLeft): This function is now much dumber. It just inspects its own style. * testing/InternalSettings.cpp: Allow mocking. (WebCore::InternalSettings::Backup::Backup): (WebCore::InternalSettings::Backup::restoreTo): (WebCore::InternalSettings::verticalScrollbarLocationPolicy): (WebCore::InternalSettings::setVerticalScrollbarLocationPolicy): (WebCore::InternalSettings::systemLayoutDirection): (WebCore::InternalSettings::setSystemLayoutDirection): * testing/InternalSettings.h: * testing/InternalSettings.idl: Source/WebKit2: Add the new API. * Shared/WebPreferencesDefinitions.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _initializeWithConfiguration:]): * UIProcess/API/Cocoa/WKWebViewConfiguration.h: * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration init]): (-[WKWebViewConfiguration encodeWithCoder:]): (-[WKWebViewConfiguration initWithCoder:]): (-[WKWebViewConfiguration copyWithZone:]): * UIProcess/WebPageProxy.cpp: * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): LayoutTests: Update tests to use new RTL scrollbar mechanism. * fast/scrolling/rtl-scrollbars-animation-property.html: * fast/scrolling/rtl-scrollbars-elementFromPoint-static.html: * fast/scrolling/rtl-scrollbars-elementFromPoint.html: * fast/scrolling/rtl-scrollbars-expected.html: * fast/scrolling/rtl-scrollbars-iframe-offset-expected.html: * fast/scrolling/rtl-scrollbars-iframe-offset.html: * fast/scrolling/rtl-scrollbars-iframe-position-absolute.html: * fast/scrolling/rtl-scrollbars-iframe-scrolled-expected.html: * fast/scrolling/rtl-scrollbars-iframe-scrolled.html: * fast/scrolling/rtl-scrollbars-iframe.html: * fast/scrolling/rtl-scrollbars-listbox-expected.html: * fast/scrolling/rtl-scrollbars-listbox-scroll-expected.html: * fast/scrolling/rtl-scrollbars-listbox-scroll.html: * fast/scrolling/rtl-scrollbars-listbox-select-left-expected.html: * fast/scrolling/rtl-scrollbars-listbox-select-left.html: * fast/scrolling/rtl-scrollbars-listbox-select-right-expected.html: * fast/scrolling/rtl-scrollbars-listbox-select-right.html: * fast/scrolling/rtl-scrollbars-listbox-simple-expected-mismatch.html: * fast/scrolling/rtl-scrollbars-listbox-simple.html: * fast/scrolling/rtl-scrollbars-listbox.html: * fast/scrolling/rtl-scrollbars-overflow-contents-expected.html: * fast/scrolling/rtl-scrollbars-overflow-contents.html: * fast/scrolling/rtl-scrollbars-overflow-dir-rtl-expected.html: * fast/scrolling/rtl-scrollbars-overflow-dir-rtl.html: * fast/scrolling/rtl-scrollbars-overflow-elementFromPoint.html: * fast/scrolling/rtl-scrollbars-overflow-expected.html: * fast/scrolling/rtl-scrollbars-overflow-padding-expected.html: * fast/scrolling/rtl-scrollbars-overflow-padding.html: * fast/scrolling/rtl-scrollbars-overflow-position-absolute-expected.html: * fast/scrolling/rtl-scrollbars-overflow-position-absolute.html: * fast/scrolling/rtl-scrollbars-overflow-simple-expected-mismatch.html: * fast/scrolling/rtl-scrollbars-overflow-simple.html: * fast/scrolling/rtl-scrollbars-overflow-text-selection-scrolled-expected.html: * fast/scrolling/rtl-scrollbars-overflow-text-selection-scrolled.html: * fast/scrolling/rtl-scrollbars-overflow.html: * fast/scrolling/rtl-scrollbars-overlay-no-push-contents-expected.html: * fast/scrolling/rtl-scrollbars-overlay-no-push-contents.html: * fast/scrolling/rtl-scrollbars-position-absolute-expected.html: * fast/scrolling/rtl-scrollbars-position-absolute.html: * fast/scrolling/rtl-scrollbars-position-fixed-expected.html: * fast/scrolling/rtl-scrollbars-position-fixed.html: * fast/scrolling/rtl-scrollbars-positioning-expected.html: * fast/scrolling/rtl-scrollbars-positioning.html: * fast/scrolling/rtl-scrollbars-simple-expected-mismatch.html: * fast/scrolling/rtl-scrollbars-simple.html: * fast/scrolling/rtl-scrollbars-sticky-document-2-expected.html: * fast/scrolling/rtl-scrollbars-sticky-document-2.html: * fast/scrolling/rtl-scrollbars-sticky-document-expected.html: * fast/scrolling/rtl-scrollbars-sticky-document.html: * fast/scrolling/rtl-scrollbars-sticky-iframe-2-expected.html: * fast/scrolling/rtl-scrollbars-sticky-iframe-2.html: * fast/scrolling/rtl-scrollbars-sticky-iframe-expected.html: * fast/scrolling/rtl-scrollbars-sticky-iframe.html: * fast/scrolling/rtl-scrollbars-sticky-overflow-scroll-2-expected.html: * fast/scrolling/rtl-scrollbars-sticky-overflow-scroll-2.html: * fast/scrolling/rtl-scrollbars-sticky-overflow-scroll-expected.html: * fast/scrolling/rtl-scrollbars-sticky-overflow-scroll.html: * fast/scrolling/rtl-scrollbars-text-selection-expected.html: * fast/scrolling/rtl-scrollbars-text-selection-scrolled-expected.html: * fast/scrolling/rtl-scrollbars-text-selection-scrolled.html: * fast/scrolling/rtl-scrollbars-text-selection.html: * fast/scrolling/rtl-scrollbars.html: * platform/mac/fast/scrolling/rtl-scrollbars-animation-property-expected.png: Added. Canonical link: https://commits.webkit.org/175171@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@200116 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-27 01:25:26 +00:00
<!DOCTYPE html>
[OS X] Scrollbars of overflow:scroll divs should appear on the left on RTL systems https://bugs.webkit.org/show_bug.cgi?id=155385 Reviewed by Simon Fraser. Source/WebCore: There is already some existing setup for RTL scrollbars. This patch hooks up this existing support to the OS X triggering mechanism introduced in r197956. It also fixes up the existing support to function even when the direction of the RTL-scrollbar div is LTR (this means the contents of the div must be pushed over by the width of the scrollbar). Tests: fast/scrolling/rtl-scrollbars-overflow-contents.html fast/scrolling/rtl-scrollbars-overflow-dir-rtl.html fast/scrolling/rtl-scrollbars-overflow-padding.html fast/scrolling/rtl-scrollbars-overflow-simple.html fast/scrolling/rtl-scrollbars-overflow.html * rendering/RenderBlock.cpp: (WebCore::RenderBlock::addOverflowFromPositionedObjects): (WebCore::RenderBlock::logicalLeftOffsetForContent): (WebCore::RenderBlock::logicalRightOffsetForContent): * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::determineLogicalLeftPositionForChild): * rendering/RenderBox.cpp: (WebCore::RenderBox::overflowClipRect): (WebCore::RenderBox::layoutOverflowRectForPropagation): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::computeScrollDimensions): * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::shouldPlaceBlockDirectionScrollbarOnLogicalLeft): * rendering/style/RenderStyle.h: LayoutTests: * platform/mac-wk1/TestExpectations: * platform/mac/TestExpectations: * platform/efl/TestExpectations: * platform/gtk/TestExpectations: * platform/ios-simulator/TestExpectations: * platform/win/TestExpectations: * fast/scrolling/rtl-scrollbars-overflow-contents-expected.html: Added. * fast/scrolling/rtl-scrollbars-overflow-contents.html: Added. * fast/scrolling/rtl-scrollbars-overflow-dir-rtl-expected.html: Added. * fast/scrolling/rtl-scrollbars-overflow-dir-rtl.html: Added. * fast/scrolling/rtl-scrollbars-overflow-expected.html: Added. * fast/scrolling/rtl-scrollbars-overflow-padding-expected.html: Added. * fast/scrolling/rtl-scrollbars-overflow-padding.html: Added. * fast/scrolling/rtl-scrollbars-overflow-simple-expected-mismatch.html: Added. * fast/scrolling/rtl-scrollbars-overflow-simple.html: Added. * fast/scrolling/rtl-scrollbars-overflow.html: Added. Canonical link: https://commits.webkit.org/173512@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198069 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-12 21:18:25 +00:00
<html>
<head>
[WK2] [OS X] Create API for switching RTL scrollbar policy https://bugs.webkit.org/show_bug.cgi?id=156948 <rdar://problem/25707757> Reviewed by Darin Adler. Source/WebCore: There are two schools of thought for where to put scrollbars in RTL environments. The first is that we should obey the content's "dir" attribute, specified on each element. The second is that we should be consistent with the platform (AppKit's) behavior. There are some situations where the placement should be done according to the content. For example, this policy would be used in web browsers. However, there are also places where web content is designed to fit seamlessly amongst native content. In this situation, the placement of the scrollbars should be done according to the view. Because WebKit doesn't know which of these situations it is operating within, this patch adds a new API property, userInterfaceDirectionPolicy, to WKWebViewConfigurationPolicy. This allows clients to instruct us which policy to abide by. It is plumbed to the web process inside the WebPreferencesStore and is ultimately held inside the Page's Settings object. This Setting is consulted by RenderLayerModelObject, which serves as a good centralized place for this policy implementation. This is the class which decides if we should be consulting its RenderStyle or the platform itself when we decide where to put the scrollbars. Putting this decision inside the renderer is important because ScrollableArea often needs to know if scrollbars should be put on the left, but ScrollableArea doesn't know anything about RenderStyles. Therefore, the renderer must be the intermediary between ScrollableArea and the RenderStyle. (ScrollableArea also doesn't directly know anything about renderers either; however, each of the subclasses knows about an appropriate renderer.) Therefore, ScrollableArea gets a new virtual method which is implemented by the RenderLayerModelObject. Tests: fast/scrolling/rtl-scrollbars*.html * WebCore.xcodeproj/project.pbxproj: ScrollableAreaMac.mm is no longer necessary. * page/FrameView.cpp: (WebCore::FrameView::shouldPlaceBlockDirectionScrollbarOnLeft): Overridden ScrollableArea function. * page/FrameView.h: * page/Settings.h: * page/Settings.in: * platform/ScrollView.cpp: Adding two new settings: One to know if we should consult with the RenderStyle or the platform, and the other is whether or not the platform considers itself to be RTL. (WebCore::ScrollView::documentScrollPositionRelativeToViewOrigin): Update to use new mechanism. (WebCore::ScrollView::updateScrollbars): Ditto. (WebCore::ScrollView::scrollCornerRect): Ditto. (WebCore::ScrollView::locationOfContents): Ditto. * platform/ScrollableArea.cpp: (WebCore::ScrollableArea::verticalScrollbarIsOnLeft): Deleted. This was the old mechanism. (WebCore::ScrollableArea::systemLanguageIsRTL): Deleted. Ditto. * platform/ScrollableArea.h: * platform/mac/ScrollableAreaMac.mm: Removed. (WebCore::ScrollableArea::verticalScrollbarIsOnLeft): Deleted. (WebCore::ScrollableArea::systemLanguageIsRTL): Deleted. * platform/mac/ScrollbarThemeMac.mm: (WebCore::ScrollbarThemeMac::didCreateScrollerImp): Update to use new mechanism. * platform/text/WritingMode.h: These enums should match what's in WebKit2. * rendering/RenderBlock.cpp: (WebCore::RenderBlock::logicalLeftOffsetForContent): Update to use new mechanism. (WebCore::RenderBlock::logicalRightOffsetForContent): Ditto. * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::determineLogicalLeftPositionForChild): Ditto. * rendering/RenderBox.cpp: Ditto. (WebCore::RenderBox::contentBoxRect): (WebCore::RenderBox::overflowClipRect): (WebCore::RenderBox::computePositionedLogicalWidth): (WebCore::RenderBox::layoutOverflowRectForPropagation): * rendering/RenderBoxModelObject.cpp: Ditto. (WebCore::RenderBoxModelObject::constrainingRectForStickyPosition): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::resize): Ditto. (WebCore::cornerStart): Migrate to use references. (WebCore::cornerRect): Ditto. (WebCore::RenderLayer::scrollCornerRect): Ditto. (WebCore::resizerCornerRect): Ditto. (WebCore::RenderLayer::scrollCornerAndResizerRect): Ditto. (WebCore::RenderLayer::verticalScrollbarStart): Update to use new mechanism. (WebCore::RenderLayer::horizontalScrollbarStart): Ditto. (WebCore::RenderLayer::offsetFromResizeCorner): Ditto. (WebCore::RenderLayer::positionOverflowControls): Migrate to use references. (WebCore::RenderLayer::computeScrollDimensions): Ditto. (WebCore::RenderLayer::overflowControlsIntersectRect): Ditto. (WebCore::RenderLayer::drawPlatformResizerImage): Update to use new mechanism. (WebCore::RenderLayer::paintResizer): Migrate to use references. (WebCore::RenderLayer::isPointInResizeControl): Ditto. (WebCore::RenderLayer::hitTestOverflowControls): Ditto. (WebCore::RenderLayer::hitTestResizerInFragments): Ditto. * rendering/RenderLayer.h: ScrollableArea override * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::positionForClipLayer): Update to use new mechanism. * rendering/RenderLayerModelObject.cpp: (WebCore::RenderLayerModelObject::shouldPlaceBlockDirectionScrollbarOnLeft): This is the meat of this patch. This is where we decide if we should be interrogating the RenderStyle or the underlying platform. * rendering/RenderLayerModelObject.h: * rendering/RenderListBox.cpp: Update to use new mechanism. (WebCore::RenderListBox::itemBoundingBoxRect): (WebCore::RenderListBox::paintScrollbar): (WebCore::RenderListBox::isPointInOverflowControl): (WebCore::RenderListBox::listIndexAtOffset): (WebCore::RenderListBox::controlClipRect): (WebCore::RenderListBox::invalidateScrollbarRect): (WebCore::RenderListBox::convertFromScrollbarToContainingView): (WebCore::RenderListBox::convertFromContainingViewToScrollbar): * rendering/RenderListBox.h: * rendering/RenderView.cpp: Ditto. (WebCore::RenderView::repaintViewRectangle): * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::shouldPlaceBlockDirectionScrollbarOnLeft): This function is now much dumber. It just inspects its own style. * testing/InternalSettings.cpp: Allow mocking. (WebCore::InternalSettings::Backup::Backup): (WebCore::InternalSettings::Backup::restoreTo): (WebCore::InternalSettings::verticalScrollbarLocationPolicy): (WebCore::InternalSettings::setVerticalScrollbarLocationPolicy): (WebCore::InternalSettings::systemLayoutDirection): (WebCore::InternalSettings::setSystemLayoutDirection): * testing/InternalSettings.h: * testing/InternalSettings.idl: Source/WebKit2: Add the new API. * Shared/WebPreferencesDefinitions.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _initializeWithConfiguration:]): * UIProcess/API/Cocoa/WKWebViewConfiguration.h: * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration init]): (-[WKWebViewConfiguration encodeWithCoder:]): (-[WKWebViewConfiguration initWithCoder:]): (-[WKWebViewConfiguration copyWithZone:]): * UIProcess/WebPageProxy.cpp: * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): LayoutTests: Update tests to use new RTL scrollbar mechanism. * fast/scrolling/rtl-scrollbars-animation-property.html: * fast/scrolling/rtl-scrollbars-elementFromPoint-static.html: * fast/scrolling/rtl-scrollbars-elementFromPoint.html: * fast/scrolling/rtl-scrollbars-expected.html: * fast/scrolling/rtl-scrollbars-iframe-offset-expected.html: * fast/scrolling/rtl-scrollbars-iframe-offset.html: * fast/scrolling/rtl-scrollbars-iframe-position-absolute.html: * fast/scrolling/rtl-scrollbars-iframe-scrolled-expected.html: * fast/scrolling/rtl-scrollbars-iframe-scrolled.html: * fast/scrolling/rtl-scrollbars-iframe.html: * fast/scrolling/rtl-scrollbars-listbox-expected.html: * fast/scrolling/rtl-scrollbars-listbox-scroll-expected.html: * fast/scrolling/rtl-scrollbars-listbox-scroll.html: * fast/scrolling/rtl-scrollbars-listbox-select-left-expected.html: * fast/scrolling/rtl-scrollbars-listbox-select-left.html: * fast/scrolling/rtl-scrollbars-listbox-select-right-expected.html: * fast/scrolling/rtl-scrollbars-listbox-select-right.html: * fast/scrolling/rtl-scrollbars-listbox-simple-expected-mismatch.html: * fast/scrolling/rtl-scrollbars-listbox-simple.html: * fast/scrolling/rtl-scrollbars-listbox.html: * fast/scrolling/rtl-scrollbars-overflow-contents-expected.html: * fast/scrolling/rtl-scrollbars-overflow-contents.html: * fast/scrolling/rtl-scrollbars-overflow-dir-rtl-expected.html: * fast/scrolling/rtl-scrollbars-overflow-dir-rtl.html: * fast/scrolling/rtl-scrollbars-overflow-elementFromPoint.html: * fast/scrolling/rtl-scrollbars-overflow-expected.html: * fast/scrolling/rtl-scrollbars-overflow-padding-expected.html: * fast/scrolling/rtl-scrollbars-overflow-padding.html: * fast/scrolling/rtl-scrollbars-overflow-position-absolute-expected.html: * fast/scrolling/rtl-scrollbars-overflow-position-absolute.html: * fast/scrolling/rtl-scrollbars-overflow-simple-expected-mismatch.html: * fast/scrolling/rtl-scrollbars-overflow-simple.html: * fast/scrolling/rtl-scrollbars-overflow-text-selection-scrolled-expected.html: * fast/scrolling/rtl-scrollbars-overflow-text-selection-scrolled.html: * fast/scrolling/rtl-scrollbars-overflow.html: * fast/scrolling/rtl-scrollbars-overlay-no-push-contents-expected.html: * fast/scrolling/rtl-scrollbars-overlay-no-push-contents.html: * fast/scrolling/rtl-scrollbars-position-absolute-expected.html: * fast/scrolling/rtl-scrollbars-position-absolute.html: * fast/scrolling/rtl-scrollbars-position-fixed-expected.html: * fast/scrolling/rtl-scrollbars-position-fixed.html: * fast/scrolling/rtl-scrollbars-positioning-expected.html: * fast/scrolling/rtl-scrollbars-positioning.html: * fast/scrolling/rtl-scrollbars-simple-expected-mismatch.html: * fast/scrolling/rtl-scrollbars-simple.html: * fast/scrolling/rtl-scrollbars-sticky-document-2-expected.html: * fast/scrolling/rtl-scrollbars-sticky-document-2.html: * fast/scrolling/rtl-scrollbars-sticky-document-expected.html: * fast/scrolling/rtl-scrollbars-sticky-document.html: * fast/scrolling/rtl-scrollbars-sticky-iframe-2-expected.html: * fast/scrolling/rtl-scrollbars-sticky-iframe-2.html: * fast/scrolling/rtl-scrollbars-sticky-iframe-expected.html: * fast/scrolling/rtl-scrollbars-sticky-iframe.html: * fast/scrolling/rtl-scrollbars-sticky-overflow-scroll-2-expected.html: * fast/scrolling/rtl-scrollbars-sticky-overflow-scroll-2.html: * fast/scrolling/rtl-scrollbars-sticky-overflow-scroll-expected.html: * fast/scrolling/rtl-scrollbars-sticky-overflow-scroll.html: * fast/scrolling/rtl-scrollbars-text-selection-expected.html: * fast/scrolling/rtl-scrollbars-text-selection-scrolled-expected.html: * fast/scrolling/rtl-scrollbars-text-selection-scrolled.html: * fast/scrolling/rtl-scrollbars-text-selection.html: * fast/scrolling/rtl-scrollbars.html: * platform/mac/fast/scrolling/rtl-scrollbars-animation-property-expected.png: Added. Canonical link: https://commits.webkit.org/175171@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@200116 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-27 01:25:26 +00:00
<script>
if (window.internals) {
Cleanup InternalSettings https://bugs.webkit.org/show_bug.cgi?id=218881 Reviewed by Darin Adler. Source/WebCore: Cleanup InternalSettings by removing all the functions that duplicated functionality already implemented by InternalSettingsGenerated, sorting the remaining functions by setting class, and replacing string parameters with proper IDL enums. * testing/InternalSettings.cpp: * testing/InternalSettings.h: * testing/InternalSettings.idl: Remove duplicate functions and add enums for EditingBehavior, PDFImageCachingPolicy, StorageBlockingPolicy, SystemLayoutDirection, TrackKind, and UserInterfaceDirectionPolicy. Most of these map directly to existing WebCore enums (and FontLoadTimingOverride was easily updated to match the WebCore enum), but new enums were needed for EditingBehavior, PDFImageCachingPolicy and StorageBlockingPolicy to keep existing tests working. The UserInterfaceDirectionPolicy enum is different than what the tests expect (tests used "View" rather then "System") but were updated to match. * testing/Internals.cpp: (WebCore::Internals::Internals): (WebCore::Internals::setMediaCaptureRequiresSecureConnection): Deleted. * testing/Internals.h: Remove now unused function setMediaCaptureRequiresSecureConnection. This should be done by the test runner or individual tests as needed. * testing/js/WebCoreTestSupport.cpp: (WebCoreTestSupport::setAllowsAnySSLCertificate): Switch to calling DeprecatedGlobalSettings directly rather than hopping through InternalSettings. This allows us to remove the InternalSettings function. LayoutTests: Update tests to work with update InternalSettings related enum values. - Platforms passed to internals.settings.setEditingBehavior now must be all lowercase. - The value "View" has been renamed to "System" for internals.settings.setUserInterfaceDirectionPolicy * editing/mac/selection/double-click-and-drag-over-anchor-to-select.html: * editing/selection/shift-click-includes-existing-selection.html: * editing/selection/user-select-all-with-shift-expected.txt: * editing/selection/user-select-all-with-shift.html: * fast/scrolling/rtl-scrollbars-alternate-body-dir-attr-does-not-update-scrollbar-placement-2-expected.html: * fast/scrolling/rtl-scrollbars-alternate-iframe-body-dir-attr-does-not-update-scrollbar-placement-expected.html: * fast/scrolling/rtl-scrollbars-animation-property.html: * fast/scrolling/rtl-scrollbars-elementFromPoint-static.html: * fast/scrolling/rtl-scrollbars-elementFromPoint.html: * fast/scrolling/rtl-scrollbars-expected.html: * fast/scrolling/rtl-scrollbars-iframe-offset-expected.html: * fast/scrolling/rtl-scrollbars-iframe-offset.html: * fast/scrolling/rtl-scrollbars-iframe-position-absolute.html: * fast/scrolling/rtl-scrollbars-iframe-scrolled-expected.html: * fast/scrolling/rtl-scrollbars-iframe-scrolled.html: * fast/scrolling/rtl-scrollbars-iframe.html: * fast/scrolling/rtl-scrollbars-listbox-scroll-expected.html: * fast/scrolling/rtl-scrollbars-listbox-scroll.html: * fast/scrolling/rtl-scrollbars-listbox-select-left-expected.html: * fast/scrolling/rtl-scrollbars-listbox-select-left.html: * fast/scrolling/rtl-scrollbars-listbox-select-right-expected.html: * fast/scrolling/rtl-scrollbars-listbox-select-right.html: * fast/scrolling/rtl-scrollbars-listbox-simple.html: * fast/scrolling/rtl-scrollbars-listbox.html: * fast/scrolling/rtl-scrollbars-overflow-contents.html: * fast/scrolling/rtl-scrollbars-overflow-dir-rtl.html: * fast/scrolling/rtl-scrollbars-overflow-elementFromPoint.html: * fast/scrolling/rtl-scrollbars-overflow-expected.html: * fast/scrolling/rtl-scrollbars-overflow-padding.html: * fast/scrolling/rtl-scrollbars-overflow-position-absolute-expected.html: * fast/scrolling/rtl-scrollbars-overflow-position-absolute.html: * fast/scrolling/rtl-scrollbars-overflow-simple.html: * fast/scrolling/rtl-scrollbars-overflow-text-selection-scrolled.html: * fast/scrolling/rtl-scrollbars-overflow.html: * fast/scrolling/rtl-scrollbars-overlay-no-push-contents-expected.html: * fast/scrolling/rtl-scrollbars-overlay-no-push-contents.html: * fast/scrolling/rtl-scrollbars-position-absolute-expected.html: * fast/scrolling/rtl-scrollbars-position-absolute.html: * fast/scrolling/rtl-scrollbars-position-fixed-expected.html: * fast/scrolling/rtl-scrollbars-position-fixed.html: * fast/scrolling/rtl-scrollbars-positioning-expected.html: * fast/scrolling/rtl-scrollbars-positioning.html: * fast/scrolling/rtl-scrollbars-simple.html: * fast/scrolling/rtl-scrollbars-sticky-document-2-expected.html: * fast/scrolling/rtl-scrollbars-sticky-document-2.html: * fast/scrolling/rtl-scrollbars-sticky-document-expected.html: * fast/scrolling/rtl-scrollbars-sticky-document.html: * fast/scrolling/rtl-scrollbars-sticky-iframe-2-expected.html: * fast/scrolling/rtl-scrollbars-sticky-iframe-2.html: * fast/scrolling/rtl-scrollbars-sticky-iframe-expected.html: * fast/scrolling/rtl-scrollbars-sticky-iframe.html: * fast/scrolling/rtl-scrollbars-sticky-overflow-scroll-2-expected.html: * fast/scrolling/rtl-scrollbars-sticky-overflow-scroll-2.html: * fast/scrolling/rtl-scrollbars-sticky-overflow-scroll-expected.html: * fast/scrolling/rtl-scrollbars-sticky-overflow-scroll.html: * fast/scrolling/rtl-scrollbars-text-selection-expected.html: * fast/scrolling/rtl-scrollbars-text-selection-scrolled-expected.html: * fast/scrolling/rtl-scrollbars-text-selection-scrolled.html: * fast/scrolling/rtl-scrollbars-text-selection.html: * fast/scrolling/rtl-scrollbars.html: Canonical link: https://commits.webkit.org/231557@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@269784 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-11-13 17:46:58 +00:00
internals.settings.setUserInterfaceDirectionPolicy("System");
[WK2] [OS X] Create API for switching RTL scrollbar policy https://bugs.webkit.org/show_bug.cgi?id=156948 <rdar://problem/25707757> Reviewed by Darin Adler. Source/WebCore: There are two schools of thought for where to put scrollbars in RTL environments. The first is that we should obey the content's "dir" attribute, specified on each element. The second is that we should be consistent with the platform (AppKit's) behavior. There are some situations where the placement should be done according to the content. For example, this policy would be used in web browsers. However, there are also places where web content is designed to fit seamlessly amongst native content. In this situation, the placement of the scrollbars should be done according to the view. Because WebKit doesn't know which of these situations it is operating within, this patch adds a new API property, userInterfaceDirectionPolicy, to WKWebViewConfigurationPolicy. This allows clients to instruct us which policy to abide by. It is plumbed to the web process inside the WebPreferencesStore and is ultimately held inside the Page's Settings object. This Setting is consulted by RenderLayerModelObject, which serves as a good centralized place for this policy implementation. This is the class which decides if we should be consulting its RenderStyle or the platform itself when we decide where to put the scrollbars. Putting this decision inside the renderer is important because ScrollableArea often needs to know if scrollbars should be put on the left, but ScrollableArea doesn't know anything about RenderStyles. Therefore, the renderer must be the intermediary between ScrollableArea and the RenderStyle. (ScrollableArea also doesn't directly know anything about renderers either; however, each of the subclasses knows about an appropriate renderer.) Therefore, ScrollableArea gets a new virtual method which is implemented by the RenderLayerModelObject. Tests: fast/scrolling/rtl-scrollbars*.html * WebCore.xcodeproj/project.pbxproj: ScrollableAreaMac.mm is no longer necessary. * page/FrameView.cpp: (WebCore::FrameView::shouldPlaceBlockDirectionScrollbarOnLeft): Overridden ScrollableArea function. * page/FrameView.h: * page/Settings.h: * page/Settings.in: * platform/ScrollView.cpp: Adding two new settings: One to know if we should consult with the RenderStyle or the platform, and the other is whether or not the platform considers itself to be RTL. (WebCore::ScrollView::documentScrollPositionRelativeToViewOrigin): Update to use new mechanism. (WebCore::ScrollView::updateScrollbars): Ditto. (WebCore::ScrollView::scrollCornerRect): Ditto. (WebCore::ScrollView::locationOfContents): Ditto. * platform/ScrollableArea.cpp: (WebCore::ScrollableArea::verticalScrollbarIsOnLeft): Deleted. This was the old mechanism. (WebCore::ScrollableArea::systemLanguageIsRTL): Deleted. Ditto. * platform/ScrollableArea.h: * platform/mac/ScrollableAreaMac.mm: Removed. (WebCore::ScrollableArea::verticalScrollbarIsOnLeft): Deleted. (WebCore::ScrollableArea::systemLanguageIsRTL): Deleted. * platform/mac/ScrollbarThemeMac.mm: (WebCore::ScrollbarThemeMac::didCreateScrollerImp): Update to use new mechanism. * platform/text/WritingMode.h: These enums should match what's in WebKit2. * rendering/RenderBlock.cpp: (WebCore::RenderBlock::logicalLeftOffsetForContent): Update to use new mechanism. (WebCore::RenderBlock::logicalRightOffsetForContent): Ditto. * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::determineLogicalLeftPositionForChild): Ditto. * rendering/RenderBox.cpp: Ditto. (WebCore::RenderBox::contentBoxRect): (WebCore::RenderBox::overflowClipRect): (WebCore::RenderBox::computePositionedLogicalWidth): (WebCore::RenderBox::layoutOverflowRectForPropagation): * rendering/RenderBoxModelObject.cpp: Ditto. (WebCore::RenderBoxModelObject::constrainingRectForStickyPosition): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::resize): Ditto. (WebCore::cornerStart): Migrate to use references. (WebCore::cornerRect): Ditto. (WebCore::RenderLayer::scrollCornerRect): Ditto. (WebCore::resizerCornerRect): Ditto. (WebCore::RenderLayer::scrollCornerAndResizerRect): Ditto. (WebCore::RenderLayer::verticalScrollbarStart): Update to use new mechanism. (WebCore::RenderLayer::horizontalScrollbarStart): Ditto. (WebCore::RenderLayer::offsetFromResizeCorner): Ditto. (WebCore::RenderLayer::positionOverflowControls): Migrate to use references. (WebCore::RenderLayer::computeScrollDimensions): Ditto. (WebCore::RenderLayer::overflowControlsIntersectRect): Ditto. (WebCore::RenderLayer::drawPlatformResizerImage): Update to use new mechanism. (WebCore::RenderLayer::paintResizer): Migrate to use references. (WebCore::RenderLayer::isPointInResizeControl): Ditto. (WebCore::RenderLayer::hitTestOverflowControls): Ditto. (WebCore::RenderLayer::hitTestResizerInFragments): Ditto. * rendering/RenderLayer.h: ScrollableArea override * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::positionForClipLayer): Update to use new mechanism. * rendering/RenderLayerModelObject.cpp: (WebCore::RenderLayerModelObject::shouldPlaceBlockDirectionScrollbarOnLeft): This is the meat of this patch. This is where we decide if we should be interrogating the RenderStyle or the underlying platform. * rendering/RenderLayerModelObject.h: * rendering/RenderListBox.cpp: Update to use new mechanism. (WebCore::RenderListBox::itemBoundingBoxRect): (WebCore::RenderListBox::paintScrollbar): (WebCore::RenderListBox::isPointInOverflowControl): (WebCore::RenderListBox::listIndexAtOffset): (WebCore::RenderListBox::controlClipRect): (WebCore::RenderListBox::invalidateScrollbarRect): (WebCore::RenderListBox::convertFromScrollbarToContainingView): (WebCore::RenderListBox::convertFromContainingViewToScrollbar): * rendering/RenderListBox.h: * rendering/RenderView.cpp: Ditto. (WebCore::RenderView::repaintViewRectangle): * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::shouldPlaceBlockDirectionScrollbarOnLeft): This function is now much dumber. It just inspects its own style. * testing/InternalSettings.cpp: Allow mocking. (WebCore::InternalSettings::Backup::Backup): (WebCore::InternalSettings::Backup::restoreTo): (WebCore::InternalSettings::verticalScrollbarLocationPolicy): (WebCore::InternalSettings::setVerticalScrollbarLocationPolicy): (WebCore::InternalSettings::systemLayoutDirection): (WebCore::InternalSettings::setSystemLayoutDirection): * testing/InternalSettings.h: * testing/InternalSettings.idl: Source/WebKit2: Add the new API. * Shared/WebPreferencesDefinitions.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _initializeWithConfiguration:]): * UIProcess/API/Cocoa/WKWebViewConfiguration.h: * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration init]): (-[WKWebViewConfiguration encodeWithCoder:]): (-[WKWebViewConfiguration initWithCoder:]): (-[WKWebViewConfiguration copyWithZone:]): * UIProcess/WebPageProxy.cpp: * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): LayoutTests: Update tests to use new RTL scrollbar mechanism. * fast/scrolling/rtl-scrollbars-animation-property.html: * fast/scrolling/rtl-scrollbars-elementFromPoint-static.html: * fast/scrolling/rtl-scrollbars-elementFromPoint.html: * fast/scrolling/rtl-scrollbars-expected.html: * fast/scrolling/rtl-scrollbars-iframe-offset-expected.html: * fast/scrolling/rtl-scrollbars-iframe-offset.html: * fast/scrolling/rtl-scrollbars-iframe-position-absolute.html: * fast/scrolling/rtl-scrollbars-iframe-scrolled-expected.html: * fast/scrolling/rtl-scrollbars-iframe-scrolled.html: * fast/scrolling/rtl-scrollbars-iframe.html: * fast/scrolling/rtl-scrollbars-listbox-expected.html: * fast/scrolling/rtl-scrollbars-listbox-scroll-expected.html: * fast/scrolling/rtl-scrollbars-listbox-scroll.html: * fast/scrolling/rtl-scrollbars-listbox-select-left-expected.html: * fast/scrolling/rtl-scrollbars-listbox-select-left.html: * fast/scrolling/rtl-scrollbars-listbox-select-right-expected.html: * fast/scrolling/rtl-scrollbars-listbox-select-right.html: * fast/scrolling/rtl-scrollbars-listbox-simple-expected-mismatch.html: * fast/scrolling/rtl-scrollbars-listbox-simple.html: * fast/scrolling/rtl-scrollbars-listbox.html: * fast/scrolling/rtl-scrollbars-overflow-contents-expected.html: * fast/scrolling/rtl-scrollbars-overflow-contents.html: * fast/scrolling/rtl-scrollbars-overflow-dir-rtl-expected.html: * fast/scrolling/rtl-scrollbars-overflow-dir-rtl.html: * fast/scrolling/rtl-scrollbars-overflow-elementFromPoint.html: * fast/scrolling/rtl-scrollbars-overflow-expected.html: * fast/scrolling/rtl-scrollbars-overflow-padding-expected.html: * fast/scrolling/rtl-scrollbars-overflow-padding.html: * fast/scrolling/rtl-scrollbars-overflow-position-absolute-expected.html: * fast/scrolling/rtl-scrollbars-overflow-position-absolute.html: * fast/scrolling/rtl-scrollbars-overflow-simple-expected-mismatch.html: * fast/scrolling/rtl-scrollbars-overflow-simple.html: * fast/scrolling/rtl-scrollbars-overflow-text-selection-scrolled-expected.html: * fast/scrolling/rtl-scrollbars-overflow-text-selection-scrolled.html: * fast/scrolling/rtl-scrollbars-overflow.html: * fast/scrolling/rtl-scrollbars-overlay-no-push-contents-expected.html: * fast/scrolling/rtl-scrollbars-overlay-no-push-contents.html: * fast/scrolling/rtl-scrollbars-position-absolute-expected.html: * fast/scrolling/rtl-scrollbars-position-absolute.html: * fast/scrolling/rtl-scrollbars-position-fixed-expected.html: * fast/scrolling/rtl-scrollbars-position-fixed.html: * fast/scrolling/rtl-scrollbars-positioning-expected.html: * fast/scrolling/rtl-scrollbars-positioning.html: * fast/scrolling/rtl-scrollbars-simple-expected-mismatch.html: * fast/scrolling/rtl-scrollbars-simple.html: * fast/scrolling/rtl-scrollbars-sticky-document-2-expected.html: * fast/scrolling/rtl-scrollbars-sticky-document-2.html: * fast/scrolling/rtl-scrollbars-sticky-document-expected.html: * fast/scrolling/rtl-scrollbars-sticky-document.html: * fast/scrolling/rtl-scrollbars-sticky-iframe-2-expected.html: * fast/scrolling/rtl-scrollbars-sticky-iframe-2.html: * fast/scrolling/rtl-scrollbars-sticky-iframe-expected.html: * fast/scrolling/rtl-scrollbars-sticky-iframe.html: * fast/scrolling/rtl-scrollbars-sticky-overflow-scroll-2-expected.html: * fast/scrolling/rtl-scrollbars-sticky-overflow-scroll-2.html: * fast/scrolling/rtl-scrollbars-sticky-overflow-scroll-expected.html: * fast/scrolling/rtl-scrollbars-sticky-overflow-scroll.html: * fast/scrolling/rtl-scrollbars-text-selection-expected.html: * fast/scrolling/rtl-scrollbars-text-selection-scrolled-expected.html: * fast/scrolling/rtl-scrollbars-text-selection-scrolled.html: * fast/scrolling/rtl-scrollbars-text-selection.html: * fast/scrolling/rtl-scrollbars.html: * platform/mac/fast/scrolling/rtl-scrollbars-animation-property-expected.png: Added. Canonical link: https://commits.webkit.org/175171@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@200116 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-27 01:25:26 +00:00
internals.settings.setSystemLayoutDirection("RTL");
}
</script>
[OS X] Scrollbars of overflow:scroll divs should appear on the left on RTL systems https://bugs.webkit.org/show_bug.cgi?id=155385 Reviewed by Simon Fraser. Source/WebCore: There is already some existing setup for RTL scrollbars. This patch hooks up this existing support to the OS X triggering mechanism introduced in r197956. It also fixes up the existing support to function even when the direction of the RTL-scrollbar div is LTR (this means the contents of the div must be pushed over by the width of the scrollbar). Tests: fast/scrolling/rtl-scrollbars-overflow-contents.html fast/scrolling/rtl-scrollbars-overflow-dir-rtl.html fast/scrolling/rtl-scrollbars-overflow-padding.html fast/scrolling/rtl-scrollbars-overflow-simple.html fast/scrolling/rtl-scrollbars-overflow.html * rendering/RenderBlock.cpp: (WebCore::RenderBlock::addOverflowFromPositionedObjects): (WebCore::RenderBlock::logicalLeftOffsetForContent): (WebCore::RenderBlock::logicalRightOffsetForContent): * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::determineLogicalLeftPositionForChild): * rendering/RenderBox.cpp: (WebCore::RenderBox::overflowClipRect): (WebCore::RenderBox::layoutOverflowRectForPropagation): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::computeScrollDimensions): * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::shouldPlaceBlockDirectionScrollbarOnLogicalLeft): * rendering/style/RenderStyle.h: LayoutTests: * platform/mac-wk1/TestExpectations: * platform/mac/TestExpectations: * platform/efl/TestExpectations: * platform/gtk/TestExpectations: * platform/ios-simulator/TestExpectations: * platform/win/TestExpectations: * fast/scrolling/rtl-scrollbars-overflow-contents-expected.html: Added. * fast/scrolling/rtl-scrollbars-overflow-contents.html: Added. * fast/scrolling/rtl-scrollbars-overflow-dir-rtl-expected.html: Added. * fast/scrolling/rtl-scrollbars-overflow-dir-rtl.html: Added. * fast/scrolling/rtl-scrollbars-overflow-expected.html: Added. * fast/scrolling/rtl-scrollbars-overflow-padding-expected.html: Added. * fast/scrolling/rtl-scrollbars-overflow-padding.html: Added. * fast/scrolling/rtl-scrollbars-overflow-simple-expected-mismatch.html: Added. * fast/scrolling/rtl-scrollbars-overflow-simple.html: Added. * fast/scrolling/rtl-scrollbars-overflow.html: Added. Canonical link: https://commits.webkit.org/173512@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198069 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-12 21:18:25 +00:00
</head>
<body>
<div style="overflow: hidden; width: 700px; height: 500px; position: relative;">
<div id="element" style="overflow: scroll; width: 700px; height: 500px; position: absolute; left: -15px; bottom: -15px;">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus ultrices dapibus nunc, id porttitor quam mollis id. Morbi tincidunt mi neque, eget convallis ante convallis at. Donec gravida leo lacus, sit amet cursus ex vehicula eget. Vivamus vitae elit vel felis luctus posuere at in arcu. Ut eu bibendum lectus. Aliquam erat volutpat. Nullam nisl urna, malesuada eget feugiat vitae, tempus vel diam. Curabitur venenatis finibus egestas. Sed imperdiet molestie fermentum. Nullam pulvinar ultrices justo, eu gravida lacus sodales ac. Donec efficitur porttitor nisi, sit amet aliquam libero vulputate consectetur. Sed malesuada diam at euismod aliquam. Vestibulum maximus eu purus vitae porttitor.</p>
<p>Etiam ut ipsum vitae neque malesuada accumsan. Nam sit amet turpis quis magna condimentum euismod at sed ante. Sed a metus ac tortor cursus mollis. Aenean vitae libero eu lorem egestas faucibus. Fusce eget velit sollicitudin, efficitur erat sit amet, auctor massa. Donec non est dolor. Phasellus efficitur fringilla euismod. Aliquam finibus sapien non volutpat venenatis. Maecenas id urna sit amet magna feugiat sagittis vel et ligula. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas molestie hendrerit dolor, imperdiet posuere est. Etiam molestie dictum tincidunt.</p>
<p>Cras tincidunt lorem eu nisl tempor elementum. Vivamus tempor mi eu ligula eleifend, ut posuere metus imperdiet. Nam tristique commodo commodo. Proin vitae auctor ante. Mauris ullamcorper vitae urna in lacinia. Praesent euismod scelerisque felis, nec eleifend nulla vulputate non. Mauris nec rutrum diam. Morbi vitae magna sollicitudin, pellentesque diam vitae, faucibus turpis. Sed pellentesque eros quis condimentum cursus. Ut id viverra dui. Integer convallis nulla vel ipsum pretium, eget imperdiet ligula tincidunt.</p>
<p>Sed lacus enim, pretium et sapien vel, auctor euismod ex. Nulla vestibulum nulla ut nisi tincidunt condimentum. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed lobortis id mauris dignissim vehicula. Vivamus sed ex ipsum. Vivamus suscipit neque quis ultrices posuere. Sed dignissim sapien non sapien venenatis, at lacinia felis efficitur.</p>
<p>Nunc viverra nulla eget lacus imperdiet, et ullamcorper augue viverra. Nunc maximus consectetur malesuada. Nulla eget volutpat turpis. Nulla nec cursus purus, at consectetur sem. Sed pretium ipsum eu risus bibendum lacinia. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec laoreet nunc et lacus consequat, ut malesuada tortor bibendum. Maecenas vitae erat consectetur, lacinia libero nec, placerat leo. Suspendisse rutrum nisl nec urna tempus ultricies. Cras pharetra tortor quis lorem ultrices pharetra. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Pellentesque consectetur nunc malesuada, accumsan leo vel, cursus massa. In sodales libero nec ligula maximus ullamcorper. Maecenas porttitor condimentum dignissim.</p>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse a risus nisi. Maecenas ut metus gravida, tincidunt arcu nec, ultrices dui. Vivamus at pretium purus, in feugiat odio. Phasellus facilisis mi id condimentum congue. Aenean sollicitudin risus a accumsan facilisis. Sed ac fringilla felis. Morbi malesuada vehicula sapien.</p>
</div>
</div>
</body>
[WK2] [OS X] Create API for switching RTL scrollbar policy https://bugs.webkit.org/show_bug.cgi?id=156948 <rdar://problem/25707757> Reviewed by Darin Adler. Source/WebCore: There are two schools of thought for where to put scrollbars in RTL environments. The first is that we should obey the content's "dir" attribute, specified on each element. The second is that we should be consistent with the platform (AppKit's) behavior. There are some situations where the placement should be done according to the content. For example, this policy would be used in web browsers. However, there are also places where web content is designed to fit seamlessly amongst native content. In this situation, the placement of the scrollbars should be done according to the view. Because WebKit doesn't know which of these situations it is operating within, this patch adds a new API property, userInterfaceDirectionPolicy, to WKWebViewConfigurationPolicy. This allows clients to instruct us which policy to abide by. It is plumbed to the web process inside the WebPreferencesStore and is ultimately held inside the Page's Settings object. This Setting is consulted by RenderLayerModelObject, which serves as a good centralized place for this policy implementation. This is the class which decides if we should be consulting its RenderStyle or the platform itself when we decide where to put the scrollbars. Putting this decision inside the renderer is important because ScrollableArea often needs to know if scrollbars should be put on the left, but ScrollableArea doesn't know anything about RenderStyles. Therefore, the renderer must be the intermediary between ScrollableArea and the RenderStyle. (ScrollableArea also doesn't directly know anything about renderers either; however, each of the subclasses knows about an appropriate renderer.) Therefore, ScrollableArea gets a new virtual method which is implemented by the RenderLayerModelObject. Tests: fast/scrolling/rtl-scrollbars*.html * WebCore.xcodeproj/project.pbxproj: ScrollableAreaMac.mm is no longer necessary. * page/FrameView.cpp: (WebCore::FrameView::shouldPlaceBlockDirectionScrollbarOnLeft): Overridden ScrollableArea function. * page/FrameView.h: * page/Settings.h: * page/Settings.in: * platform/ScrollView.cpp: Adding two new settings: One to know if we should consult with the RenderStyle or the platform, and the other is whether or not the platform considers itself to be RTL. (WebCore::ScrollView::documentScrollPositionRelativeToViewOrigin): Update to use new mechanism. (WebCore::ScrollView::updateScrollbars): Ditto. (WebCore::ScrollView::scrollCornerRect): Ditto. (WebCore::ScrollView::locationOfContents): Ditto. * platform/ScrollableArea.cpp: (WebCore::ScrollableArea::verticalScrollbarIsOnLeft): Deleted. This was the old mechanism. (WebCore::ScrollableArea::systemLanguageIsRTL): Deleted. Ditto. * platform/ScrollableArea.h: * platform/mac/ScrollableAreaMac.mm: Removed. (WebCore::ScrollableArea::verticalScrollbarIsOnLeft): Deleted. (WebCore::ScrollableArea::systemLanguageIsRTL): Deleted. * platform/mac/ScrollbarThemeMac.mm: (WebCore::ScrollbarThemeMac::didCreateScrollerImp): Update to use new mechanism. * platform/text/WritingMode.h: These enums should match what's in WebKit2. * rendering/RenderBlock.cpp: (WebCore::RenderBlock::logicalLeftOffsetForContent): Update to use new mechanism. (WebCore::RenderBlock::logicalRightOffsetForContent): Ditto. * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::determineLogicalLeftPositionForChild): Ditto. * rendering/RenderBox.cpp: Ditto. (WebCore::RenderBox::contentBoxRect): (WebCore::RenderBox::overflowClipRect): (WebCore::RenderBox::computePositionedLogicalWidth): (WebCore::RenderBox::layoutOverflowRectForPropagation): * rendering/RenderBoxModelObject.cpp: Ditto. (WebCore::RenderBoxModelObject::constrainingRectForStickyPosition): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::resize): Ditto. (WebCore::cornerStart): Migrate to use references. (WebCore::cornerRect): Ditto. (WebCore::RenderLayer::scrollCornerRect): Ditto. (WebCore::resizerCornerRect): Ditto. (WebCore::RenderLayer::scrollCornerAndResizerRect): Ditto. (WebCore::RenderLayer::verticalScrollbarStart): Update to use new mechanism. (WebCore::RenderLayer::horizontalScrollbarStart): Ditto. (WebCore::RenderLayer::offsetFromResizeCorner): Ditto. (WebCore::RenderLayer::positionOverflowControls): Migrate to use references. (WebCore::RenderLayer::computeScrollDimensions): Ditto. (WebCore::RenderLayer::overflowControlsIntersectRect): Ditto. (WebCore::RenderLayer::drawPlatformResizerImage): Update to use new mechanism. (WebCore::RenderLayer::paintResizer): Migrate to use references. (WebCore::RenderLayer::isPointInResizeControl): Ditto. (WebCore::RenderLayer::hitTestOverflowControls): Ditto. (WebCore::RenderLayer::hitTestResizerInFragments): Ditto. * rendering/RenderLayer.h: ScrollableArea override * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::positionForClipLayer): Update to use new mechanism. * rendering/RenderLayerModelObject.cpp: (WebCore::RenderLayerModelObject::shouldPlaceBlockDirectionScrollbarOnLeft): This is the meat of this patch. This is where we decide if we should be interrogating the RenderStyle or the underlying platform. * rendering/RenderLayerModelObject.h: * rendering/RenderListBox.cpp: Update to use new mechanism. (WebCore::RenderListBox::itemBoundingBoxRect): (WebCore::RenderListBox::paintScrollbar): (WebCore::RenderListBox::isPointInOverflowControl): (WebCore::RenderListBox::listIndexAtOffset): (WebCore::RenderListBox::controlClipRect): (WebCore::RenderListBox::invalidateScrollbarRect): (WebCore::RenderListBox::convertFromScrollbarToContainingView): (WebCore::RenderListBox::convertFromContainingViewToScrollbar): * rendering/RenderListBox.h: * rendering/RenderView.cpp: Ditto. (WebCore::RenderView::repaintViewRectangle): * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::shouldPlaceBlockDirectionScrollbarOnLeft): This function is now much dumber. It just inspects its own style. * testing/InternalSettings.cpp: Allow mocking. (WebCore::InternalSettings::Backup::Backup): (WebCore::InternalSettings::Backup::restoreTo): (WebCore::InternalSettings::verticalScrollbarLocationPolicy): (WebCore::InternalSettings::setVerticalScrollbarLocationPolicy): (WebCore::InternalSettings::systemLayoutDirection): (WebCore::InternalSettings::setSystemLayoutDirection): * testing/InternalSettings.h: * testing/InternalSettings.idl: Source/WebKit2: Add the new API. * Shared/WebPreferencesDefinitions.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _initializeWithConfiguration:]): * UIProcess/API/Cocoa/WKWebViewConfiguration.h: * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration init]): (-[WKWebViewConfiguration encodeWithCoder:]): (-[WKWebViewConfiguration initWithCoder:]): (-[WKWebViewConfiguration copyWithZone:]): * UIProcess/WebPageProxy.cpp: * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): LayoutTests: Update tests to use new RTL scrollbar mechanism. * fast/scrolling/rtl-scrollbars-animation-property.html: * fast/scrolling/rtl-scrollbars-elementFromPoint-static.html: * fast/scrolling/rtl-scrollbars-elementFromPoint.html: * fast/scrolling/rtl-scrollbars-expected.html: * fast/scrolling/rtl-scrollbars-iframe-offset-expected.html: * fast/scrolling/rtl-scrollbars-iframe-offset.html: * fast/scrolling/rtl-scrollbars-iframe-position-absolute.html: * fast/scrolling/rtl-scrollbars-iframe-scrolled-expected.html: * fast/scrolling/rtl-scrollbars-iframe-scrolled.html: * fast/scrolling/rtl-scrollbars-iframe.html: * fast/scrolling/rtl-scrollbars-listbox-expected.html: * fast/scrolling/rtl-scrollbars-listbox-scroll-expected.html: * fast/scrolling/rtl-scrollbars-listbox-scroll.html: * fast/scrolling/rtl-scrollbars-listbox-select-left-expected.html: * fast/scrolling/rtl-scrollbars-listbox-select-left.html: * fast/scrolling/rtl-scrollbars-listbox-select-right-expected.html: * fast/scrolling/rtl-scrollbars-listbox-select-right.html: * fast/scrolling/rtl-scrollbars-listbox-simple-expected-mismatch.html: * fast/scrolling/rtl-scrollbars-listbox-simple.html: * fast/scrolling/rtl-scrollbars-listbox.html: * fast/scrolling/rtl-scrollbars-overflow-contents-expected.html: * fast/scrolling/rtl-scrollbars-overflow-contents.html: * fast/scrolling/rtl-scrollbars-overflow-dir-rtl-expected.html: * fast/scrolling/rtl-scrollbars-overflow-dir-rtl.html: * fast/scrolling/rtl-scrollbars-overflow-elementFromPoint.html: * fast/scrolling/rtl-scrollbars-overflow-expected.html: * fast/scrolling/rtl-scrollbars-overflow-padding-expected.html: * fast/scrolling/rtl-scrollbars-overflow-padding.html: * fast/scrolling/rtl-scrollbars-overflow-position-absolute-expected.html: * fast/scrolling/rtl-scrollbars-overflow-position-absolute.html: * fast/scrolling/rtl-scrollbars-overflow-simple-expected-mismatch.html: * fast/scrolling/rtl-scrollbars-overflow-simple.html: * fast/scrolling/rtl-scrollbars-overflow-text-selection-scrolled-expected.html: * fast/scrolling/rtl-scrollbars-overflow-text-selection-scrolled.html: * fast/scrolling/rtl-scrollbars-overflow.html: * fast/scrolling/rtl-scrollbars-overlay-no-push-contents-expected.html: * fast/scrolling/rtl-scrollbars-overlay-no-push-contents.html: * fast/scrolling/rtl-scrollbars-position-absolute-expected.html: * fast/scrolling/rtl-scrollbars-position-absolute.html: * fast/scrolling/rtl-scrollbars-position-fixed-expected.html: * fast/scrolling/rtl-scrollbars-position-fixed.html: * fast/scrolling/rtl-scrollbars-positioning-expected.html: * fast/scrolling/rtl-scrollbars-positioning.html: * fast/scrolling/rtl-scrollbars-simple-expected-mismatch.html: * fast/scrolling/rtl-scrollbars-simple.html: * fast/scrolling/rtl-scrollbars-sticky-document-2-expected.html: * fast/scrolling/rtl-scrollbars-sticky-document-2.html: * fast/scrolling/rtl-scrollbars-sticky-document-expected.html: * fast/scrolling/rtl-scrollbars-sticky-document.html: * fast/scrolling/rtl-scrollbars-sticky-iframe-2-expected.html: * fast/scrolling/rtl-scrollbars-sticky-iframe-2.html: * fast/scrolling/rtl-scrollbars-sticky-iframe-expected.html: * fast/scrolling/rtl-scrollbars-sticky-iframe.html: * fast/scrolling/rtl-scrollbars-sticky-overflow-scroll-2-expected.html: * fast/scrolling/rtl-scrollbars-sticky-overflow-scroll-2.html: * fast/scrolling/rtl-scrollbars-sticky-overflow-scroll-expected.html: * fast/scrolling/rtl-scrollbars-sticky-overflow-scroll.html: * fast/scrolling/rtl-scrollbars-text-selection-expected.html: * fast/scrolling/rtl-scrollbars-text-selection-scrolled-expected.html: * fast/scrolling/rtl-scrollbars-text-selection-scrolled.html: * fast/scrolling/rtl-scrollbars-text-selection.html: * fast/scrolling/rtl-scrollbars.html: * platform/mac/fast/scrolling/rtl-scrollbars-animation-property-expected.png: Added. Canonical link: https://commits.webkit.org/175171@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@200116 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-27 01:25:26 +00:00
</html>