Hardcode Visual Viewports on everywhere except iOS WK1
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 22 Feb 2019 07:04:03 +0000 (07:04 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 22 Feb 2019 07:04:03 +0000 (07:04 +0000)
https://bugs.webkit.org/show_bug.cgi?id=194928

Reviewed by Zalan Bujtas.
Source/WebCore:

Remove the WK1 and WK2 preferences and MiniBrowser menu item for "visual viewports",
change the default value of the Setting to 'true', and hardcode WebView on iOS to
set it to false. The setting has shipped for several years and there's no need to turn
it off now.

Similarly, disable the "Visual Viewport API" on iOS WK1, since it makes no sense if
Visual Viewports are not enabled.

Remove the "visualViewportEnabled" flag and unused code paths from scrolling tree code
that only runs in WK2

* page/Settings.yaml:
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
(WebCore::AsyncScrollingCoordinator::reconcileScrollingState):
(WebCore::AsyncScrollingCoordinator::visualViewportEnabled const): Deleted.
* page/scrolling/AsyncScrollingCoordinator.h:
* page/scrolling/ScrollingStateFrameScrollingNode.cpp:
(WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
(WebCore::ScrollingStateFrameScrollingNode::setAllPropertiesChanged):
(WebCore::ScrollingStateFrameScrollingNode::dumpProperties const):
(WebCore::ScrollingStateFrameScrollingNode::setVisualViewportEnabled): Deleted.
* page/scrolling/ScrollingStateFrameScrollingNode.h:
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::commitTreeState):
* page/scrolling/ScrollingTree.h:
(WebCore::ScrollingTree::visualViewportEnabled const): Deleted.
(WebCore::ScrollingTree::setVisualViewportEnabled): Deleted.
* page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
(WebCore::ScrollingTreeFrameScrollingNode::layoutViewportForScrollPosition const):
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
(WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollPositionWithoutContentEdgeConstraints):
(WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollLayerPosition):

Source/WebKit:

Remove the WK1 and WK2 preferences and MiniBrowser menu item for "visual viewports",
change the default value of the Setting to 'true', and hardcode WebView on iOS to
set it to false. The setting has shipped for several years and there's no need to turn
it off now.

Similarly, disable the "Visual Viewport API" on iOS WK1, since it makes no sense if
Visual Viewports are not enabled.

Remove the "visualViewportEnabled" flag and unused code paths from scrolling tree code
that only runs in WK2

* Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
(ArgumentCoder<ScrollingStateFrameScrollingNode>::encode):
(ArgumentCoder<ScrollingStateFrameScrollingNode>::decode):
* Shared/WebPreferences.yaml:
* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences _visualViewportEnabled]): Deleted.
(-[WKPreferences _setVisualViewportEnabled:]): Deleted.
* UIProcess/API/Cocoa/WKPreferencesPrivate.h:
* UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
(WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
* UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
(WebKit::RemoteScrollingCoordinatorProxy::visualViewportEnabled const): Deleted.
* UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
(WebKit::RemoteScrollingCoordinatorProxy::customFixedPositionRect const):
* UIProcess/WebPageProxy.h:
* UIProcess/ios/WKContentView.mm:
(-[WKContentView didUpdateVisibleRect:unobscuredRect:contentInsets:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::computeCustomFixedPositionRect const):
* WebProcess/Automation/WebAutomationSessionProxy.cpp:
(WebKit::WebAutomationSessionProxy::computeElementLayout):
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::getFocusedElementInformation):
(WebKit::WebPage::dynamicViewportSizeUpdate):
(WebKit::WebPage::updateVisibleContentRects):

Source/WebKitLegacy/mac:

Remove the WK1 and WK2 preferences and MiniBrowser menu item for "visual viewports",
change the default value of the Setting to 'true', and hardcode WebView on iOS to
set it to false. The setting has shipped for several years and there's no need to turn
it off now.

Similarly, disable the "Visual Viewport API" on iOS WK1, since it makes no sense if
Visual Viewports are not enabled.

Remove the "visualViewportEnabled" flag and unused code paths from scrolling tree code
that only runs in WK2

* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):
(-[WebPreferences visualViewportEnabled]): Deleted.
(-[WebPreferences setVisualViewportEnabled:]): Deleted.
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

Tools:

Remove the WK1 and WK2 preferences and MiniBrowser menu item for "visual viewports",
change the default value of the Setting to 'true', and hardcode WebView on iOS to
set it to false. The setting has shipped for several years and there's no need to turn
it off now.

Similarly, disable the "Visual Viewport API" on iOS WK1, since it makes no sense if
Visual Viewports are not enabled.

Remove the "visualViewportEnabled" flag and unused code paths from scrolling tree code
that only runs in WK2

* MiniBrowser/mac/SettingsController.h:
* MiniBrowser/mac/SettingsController.m:
(-[SettingsController init]):
(-[SettingsController _populateMenu]):
(-[SettingsController validateMenuItem:]):
(-[SettingsController visualViewportEnabled]): Deleted.
(-[SettingsController toggleVisualViewportEnabled:]): Deleted.
* MiniBrowser/mac/WK1BrowserWindowController.m:
(-[WK1BrowserWindowController didChangeSettings]):
* MiniBrowser/mac/WK2BrowserWindowController.m:
(-[WK2BrowserWindowController didChangeSettings]):

LayoutTests:

Remove "(visual viewport enabled 1)" from scrolling tree dumps. Remove calls
to "internals.settings.setVisualViewportEnabled(true)"

* fast/dom/elementFromPoint-scaled-scrolled-layout-viewport.html:
* fast/events/ios/rotation/resources/rotation-utils.js:
* fast/visual-viewport/client-coordinates-relative-to-layout-viewport.html:
* fast/visual-viewport/client-rects-relative-to-layout-viewport-zoomed.html:
* fast/visual-viewport/client-rects-relative-to-layout-viewport.html:
* fast/visual-viewport/nonzoomed-rects.html:
* fast/visual-viewport/resize-event-fired-window-resized.html:
* fast/visual-viewport/resize-event-fired.html:
* fast/visual-viewport/rtl-nonzoomed-rects.html:
* fast/visual-viewport/rtl-zoomed-rects.html:
* fast/visual-viewport/rubberbanding-viewport-rects-extended-background.html:
* fast/visual-viewport/rubberbanding-viewport-rects-header-footer.html:
* fast/visual-viewport/rubberbanding-viewport-rects.html:
* fast/visual-viewport/scroll-event-fired.html:
* fast/visual-viewport/tiled-drawing/zoomed-fixed-scrolled-down-expected.txt:
* fast/visual-viewport/tiled-drawing/zoomed-fixed-scrolled-down-then-up-expected.txt:
* fast/visual-viewport/tiled-drawing/zoomed-fixed-scrolled-down-then-up.html:
* fast/visual-viewport/tiled-drawing/zoomed-fixed-scrolled-down.html:
* fast/visual-viewport/tiled-drawing/zoomed-fixed-scrolling-layers-state-expected.txt:
* fast/visual-viewport/tiled-drawing/zoomed-fixed-scrolling-layers-state.html:
* fast/visual-viewport/viewport-dimensions-exclude-custom-scrollbars.html:
* fast/visual-viewport/viewport-dimensions-exclude-scrollbars.html:
* fast/visual-viewport/viewport-dimensions-iframe.html:
* fast/visual-viewport/viewport-dimensions-under-page-zoom.html:
* fast/visual-viewport/viewport-dimensions.html:
* fast/visual-viewport/visual-viewport-same-object.html:
* fast/visual-viewport/zoomed-fixed-header-and-footer.html:
* fast/visual-viewport/zoomed-fixed-scroll-down-then-up.html:
* fast/visual-viewport/zoomed-fixed.html:
* fast/visual-viewport/zoomed-rects.html:
* fast/visual-viewport/zoomed-scroll-into-view-fixed.html:
* fast/visual-viewport/zoomed-scroll-to-anchor-in-position-fixed.html:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/coordinated-frame-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/coordinated-frame-gain-scrolling-ancestor-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/coordinated-frame-in-fixed-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/coordinated-frame-lose-scrolling-ancestor-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/fixed-inside-frame-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/gain-scrolling-node-parent-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/lose-scrolling-node-parent-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/overflow-in-fixed-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/remove-coordinated-frame-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/remove-scrolling-role-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/reparent-across-compositing-layers-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/reparent-with-layer-removal-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/scrolling-tree-includes-frame-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/scrolling-tree-is-z-order-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/toggle-coordinated-frame-scrolling-expected.txt:
* scrollingcoordinator/scrolling-tree/coordinated-frame-expected.txt:
* scrollingcoordinator/scrolling-tree/coordinated-frame-gain-scrolling-ancestor-expected.txt:
* scrollingcoordinator/scrolling-tree/coordinated-frame-in-fixed-expected.txt:
* scrollingcoordinator/scrolling-tree/coordinated-frame-lose-scrolling-ancestor-expected.txt:
* scrollingcoordinator/scrolling-tree/fixed-inside-frame-expected.txt:
* scrollingcoordinator/scrolling-tree/gain-scrolling-node-parent-expected.txt:
* scrollingcoordinator/scrolling-tree/lose-scrolling-node-parent-expected.txt:
* scrollingcoordinator/scrolling-tree/overflow-in-fixed-expected.txt:
* scrollingcoordinator/scrolling-tree/remove-coordinated-frame-expected.txt:
* scrollingcoordinator/scrolling-tree/remove-scrolling-role-expected.txt:
* scrollingcoordinator/scrolling-tree/reparent-across-compositing-layers-expected.txt:
* scrollingcoordinator/scrolling-tree/reparent-with-layer-removal-expected.txt:
* scrollingcoordinator/scrolling-tree/scrolling-tree-includes-frame-expected.txt:
* scrollingcoordinator/scrolling-tree/scrolling-tree-is-z-order-expected.txt:
* scrollingcoordinator/scrolling-tree/toggle-coordinated-frame-scrolling-expected.txt:
* scrollingcoordinator/scrolling-tree/toggle-coordinated-frame-scrolling.html: Don't insert the first scrolling tree
dump until the end, to avoid it affecting main frame height before we get the second layer tree.
* tiled-drawing/scrolling/clamp-out-of-bounds-scrolls-expected.txt:
* tiled-drawing/scrolling/fixed/absolute-inside-fixed-expected.txt:
* tiled-drawing/scrolling/fixed/absolute-inside-out-of-view-fixed-expected.txt:
* tiled-drawing/scrolling/fixed/fixed-in-overflow-expected.txt:
* tiled-drawing/scrolling/fixed/fixed-position-out-of-view-expected.txt:
* tiled-drawing/scrolling/fixed/fixed-position-out-of-view-negative-zindex-expected.txt:
* tiled-drawing/scrolling/fixed/four-bars-expected.txt:
* tiled-drawing/scrolling/fixed/four-bars-with-header-and-footer-expected.txt:
* tiled-drawing/scrolling/fixed/four-bars-zoomed-expected.txt:
* tiled-drawing/scrolling/fixed/negative-scroll-offset-expected.txt:
* tiled-drawing/scrolling/fixed/negative-scroll-offset-in-view-expected.txt:
* tiled-drawing/scrolling/fixed/nested-fixed-expected.txt:
* tiled-drawing/scrolling/fixed/percentage-inside-fixed-expected.txt:
* tiled-drawing/scrolling/frames/scroll-region-after-frame-layout-expected.txt:
* tiled-drawing/scrolling/scrolling-tree-after-scroll-expected.txt:
* tiled-drawing/scrolling/scrolling-tree-slow-scrolling-expected.txt:
* tiled-drawing/scrolling/sticky/negative-scroll-offset-expected.txt:
* tiled-drawing/scrolling/sticky/sticky-horizontal-expected.txt:
* tiled-drawing/scrolling/sticky/sticky-vertical-expected.txt:

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

120 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/dom/elementFromPoint-scaled-scrolled-layout-viewport.html
LayoutTests/fast/events/ios/rotation/resources/rotation-utils.js
LayoutTests/fast/scrolling/ios/change-scrollability-on-content-resize-expected.txt
LayoutTests/fast/scrolling/ios/change-scrollability-on-content-resize-nested-expected.txt
LayoutTests/fast/visual-viewport/client-coordinates-relative-to-layout-viewport.html
LayoutTests/fast/visual-viewport/client-rects-relative-to-layout-viewport-zoomed.html
LayoutTests/fast/visual-viewport/client-rects-relative-to-layout-viewport.html
LayoutTests/fast/visual-viewport/nonzoomed-rects.html
LayoutTests/fast/visual-viewport/resize-event-fired-window-resized.html
LayoutTests/fast/visual-viewport/resize-event-fired.html
LayoutTests/fast/visual-viewport/rtl-nonzoomed-rects.html
LayoutTests/fast/visual-viewport/rtl-zoomed-rects.html
LayoutTests/fast/visual-viewport/rubberbanding-viewport-rects-extended-background.html
LayoutTests/fast/visual-viewport/rubberbanding-viewport-rects-header-footer.html
LayoutTests/fast/visual-viewport/rubberbanding-viewport-rects.html
LayoutTests/fast/visual-viewport/scroll-event-fired.html
LayoutTests/fast/visual-viewport/tiled-drawing/zoomed-fixed-scrolled-down-expected.txt
LayoutTests/fast/visual-viewport/tiled-drawing/zoomed-fixed-scrolled-down-then-up-expected.txt
LayoutTests/fast/visual-viewport/tiled-drawing/zoomed-fixed-scrolled-down-then-up.html
LayoutTests/fast/visual-viewport/tiled-drawing/zoomed-fixed-scrolled-down.html
LayoutTests/fast/visual-viewport/tiled-drawing/zoomed-fixed-scrolling-layers-state-expected.txt
LayoutTests/fast/visual-viewport/tiled-drawing/zoomed-fixed-scrolling-layers-state.html
LayoutTests/fast/visual-viewport/viewport-dimensions-exclude-custom-scrollbars.html
LayoutTests/fast/visual-viewport/viewport-dimensions-exclude-scrollbars.html
LayoutTests/fast/visual-viewport/viewport-dimensions-iframe.html
LayoutTests/fast/visual-viewport/viewport-dimensions-under-page-zoom.html
LayoutTests/fast/visual-viewport/viewport-dimensions.html
LayoutTests/fast/visual-viewport/visual-viewport-same-object.html
LayoutTests/fast/visual-viewport/zoomed-fixed-header-and-footer.html
LayoutTests/fast/visual-viewport/zoomed-fixed-scroll-down-then-up.html
LayoutTests/fast/visual-viewport/zoomed-fixed.html
LayoutTests/fast/visual-viewport/zoomed-rects.html
LayoutTests/fast/visual-viewport/zoomed-scroll-into-view-fixed.html
LayoutTests/fast/visual-viewport/zoomed-scroll-to-anchor-in-position-fixed.html
LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/coordinated-frame-expected.txt
LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/coordinated-frame-gain-scrolling-ancestor-expected.txt
LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/coordinated-frame-in-fixed-expected.txt
LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/coordinated-frame-lose-scrolling-ancestor-expected.txt
LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/fixed-inside-frame-expected.txt
LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/gain-scrolling-node-parent-expected.txt
LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/lose-scrolling-node-parent-expected.txt
LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/overflow-in-fixed-expected.txt
LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/remove-coordinated-frame-expected.txt
LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/remove-scrolling-role-expected.txt
LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/reparent-across-compositing-layers-expected.txt
LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/reparent-with-layer-removal-expected.txt
LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/scrolling-tree-includes-frame-expected.txt
LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/scrolling-tree-is-z-order-expected.txt
LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/toggle-coordinated-frame-scrolling-expected.txt
LayoutTests/scrollingcoordinator/scrolling-tree/coordinated-frame-expected.txt
LayoutTests/scrollingcoordinator/scrolling-tree/coordinated-frame-gain-scrolling-ancestor-expected.txt
LayoutTests/scrollingcoordinator/scrolling-tree/coordinated-frame-in-fixed-expected.txt
LayoutTests/scrollingcoordinator/scrolling-tree/coordinated-frame-lose-scrolling-ancestor-expected.txt
LayoutTests/scrollingcoordinator/scrolling-tree/fixed-inside-frame-expected.txt
LayoutTests/scrollingcoordinator/scrolling-tree/gain-scrolling-node-parent-expected.txt
LayoutTests/scrollingcoordinator/scrolling-tree/lose-scrolling-node-parent-expected.txt
LayoutTests/scrollingcoordinator/scrolling-tree/overflow-in-fixed-expected.txt
LayoutTests/scrollingcoordinator/scrolling-tree/remove-coordinated-frame-expected.txt
LayoutTests/scrollingcoordinator/scrolling-tree/remove-scrolling-role-expected.txt
LayoutTests/scrollingcoordinator/scrolling-tree/reparent-across-compositing-layers-expected.txt
LayoutTests/scrollingcoordinator/scrolling-tree/reparent-with-layer-removal-expected.txt
LayoutTests/scrollingcoordinator/scrolling-tree/resources/scroll-toggling-frame.html
LayoutTests/scrollingcoordinator/scrolling-tree/scrolling-tree-includes-frame-expected.txt
LayoutTests/scrollingcoordinator/scrolling-tree/scrolling-tree-is-z-order-expected.txt
LayoutTests/scrollingcoordinator/scrolling-tree/toggle-coordinated-frame-scrolling-expected.txt
LayoutTests/scrollingcoordinator/scrolling-tree/toggle-coordinated-frame-scrolling.html
LayoutTests/tiled-drawing/scrolling/clamp-out-of-bounds-scrolls-expected.txt
LayoutTests/tiled-drawing/scrolling/fixed/absolute-inside-fixed-expected.txt
LayoutTests/tiled-drawing/scrolling/fixed/absolute-inside-out-of-view-fixed-expected.txt
LayoutTests/tiled-drawing/scrolling/fixed/fixed-in-overflow-expected.txt
LayoutTests/tiled-drawing/scrolling/fixed/fixed-position-out-of-view-expected.txt
LayoutTests/tiled-drawing/scrolling/fixed/fixed-position-out-of-view-negative-zindex-expected.txt
LayoutTests/tiled-drawing/scrolling/fixed/four-bars-expected.txt
LayoutTests/tiled-drawing/scrolling/fixed/four-bars-with-header-and-footer-expected.txt
LayoutTests/tiled-drawing/scrolling/fixed/four-bars-zoomed-expected.txt
LayoutTests/tiled-drawing/scrolling/fixed/negative-scroll-offset-expected.txt
LayoutTests/tiled-drawing/scrolling/fixed/negative-scroll-offset-in-view-expected.txt
LayoutTests/tiled-drawing/scrolling/fixed/nested-fixed-expected.txt
LayoutTests/tiled-drawing/scrolling/fixed/percentage-inside-fixed-expected.txt
LayoutTests/tiled-drawing/scrolling/frames/scroll-region-after-frame-layout-expected.txt
LayoutTests/tiled-drawing/scrolling/scrolling-tree-after-scroll-expected.txt
LayoutTests/tiled-drawing/scrolling/scrolling-tree-slow-scrolling-expected.txt
LayoutTests/tiled-drawing/scrolling/sticky/negative-scroll-offset-expected.txt
LayoutTests/tiled-drawing/scrolling/sticky/sticky-horizontal-expected.txt
LayoutTests/tiled-drawing/scrolling/sticky/sticky-vertical-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/page/Settings.yaml
Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp
Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h
Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.cpp
Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.h
Source/WebCore/page/scrolling/ScrollingTree.cpp
Source/WebCore/page/scrolling/ScrollingTree.h
Source/WebCore/page/scrolling/ScrollingTreeFrameScrollingNode.cpp
Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm
Source/WebKit/ChangeLog
Source/WebKit/Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp
Source/WebKit/Shared/WebPreferences.yaml
Source/WebKit/UIProcess/API/Cocoa/WKPreferences.mm
Source/WebKit/UIProcess/API/Cocoa/WKPreferencesPrivate.h
Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm
Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h
Source/WebKit/UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm
Source/WebKit/UIProcess/WebPageProxy.h
Source/WebKit/UIProcess/ios/WKContentView.mm
Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm
Source/WebKit/WebProcess/Automation/WebAutomationSessionProxy.cpp
Source/WebKit/WebProcess/InjectedBundle/InjectedBundle.cpp
Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm
Source/WebKitLegacy/mac/ChangeLog
Source/WebKitLegacy/mac/WebView/WebPreferenceKeysPrivate.h
Source/WebKitLegacy/mac/WebView/WebPreferences.mm
Source/WebKitLegacy/mac/WebView/WebPreferencesPrivate.h
Source/WebKitLegacy/mac/WebView/WebView.mm
Tools/ChangeLog
Tools/MiniBrowser/mac/SettingsController.h
Tools/MiniBrowser/mac/SettingsController.m
Tools/MiniBrowser/mac/WK1BrowserWindowController.m
Tools/MiniBrowser/mac/WK2BrowserWindowController.m

index ed806f1..82b3882 100644 (file)
@@ -1,3 +1,97 @@
+2019-02-21  Simon Fraser  <simon.fraser@apple.com>
+
+        Hardcode Visual Viewports on everywhere except iOS WK1
+        https://bugs.webkit.org/show_bug.cgi?id=194928
+
+        Reviewed by Zalan Bujtas.
+        
+        Remove "(visual viewport enabled 1)" from scrolling tree dumps. Remove calls
+        to "internals.settings.setVisualViewportEnabled(true)"
+
+        * fast/dom/elementFromPoint-scaled-scrolled-layout-viewport.html:
+        * fast/events/ios/rotation/resources/rotation-utils.js:
+        * fast/visual-viewport/client-coordinates-relative-to-layout-viewport.html:
+        * fast/visual-viewport/client-rects-relative-to-layout-viewport-zoomed.html:
+        * fast/visual-viewport/client-rects-relative-to-layout-viewport.html:
+        * fast/visual-viewport/nonzoomed-rects.html:
+        * fast/visual-viewport/resize-event-fired-window-resized.html:
+        * fast/visual-viewport/resize-event-fired.html:
+        * fast/visual-viewport/rtl-nonzoomed-rects.html:
+        * fast/visual-viewport/rtl-zoomed-rects.html:
+        * fast/visual-viewport/rubberbanding-viewport-rects-extended-background.html:
+        * fast/visual-viewport/rubberbanding-viewport-rects-header-footer.html:
+        * fast/visual-viewport/rubberbanding-viewport-rects.html:
+        * fast/visual-viewport/scroll-event-fired.html:
+        * fast/visual-viewport/tiled-drawing/zoomed-fixed-scrolled-down-expected.txt:
+        * fast/visual-viewport/tiled-drawing/zoomed-fixed-scrolled-down-then-up-expected.txt:
+        * fast/visual-viewport/tiled-drawing/zoomed-fixed-scrolled-down-then-up.html:
+        * fast/visual-viewport/tiled-drawing/zoomed-fixed-scrolled-down.html:
+        * fast/visual-viewport/tiled-drawing/zoomed-fixed-scrolling-layers-state-expected.txt:
+        * fast/visual-viewport/tiled-drawing/zoomed-fixed-scrolling-layers-state.html:
+        * fast/visual-viewport/viewport-dimensions-exclude-custom-scrollbars.html:
+        * fast/visual-viewport/viewport-dimensions-exclude-scrollbars.html:
+        * fast/visual-viewport/viewport-dimensions-iframe.html:
+        * fast/visual-viewport/viewport-dimensions-under-page-zoom.html:
+        * fast/visual-viewport/viewport-dimensions.html:
+        * fast/visual-viewport/visual-viewport-same-object.html:
+        * fast/visual-viewport/zoomed-fixed-header-and-footer.html:
+        * fast/visual-viewport/zoomed-fixed-scroll-down-then-up.html:
+        * fast/visual-viewport/zoomed-fixed.html:
+        * fast/visual-viewport/zoomed-rects.html:
+        * fast/visual-viewport/zoomed-scroll-into-view-fixed.html:
+        * fast/visual-viewport/zoomed-scroll-to-anchor-in-position-fixed.html:
+        * platform/ios-wk2/scrollingcoordinator/scrolling-tree/coordinated-frame-expected.txt:
+        * platform/ios-wk2/scrollingcoordinator/scrolling-tree/coordinated-frame-gain-scrolling-ancestor-expected.txt:
+        * platform/ios-wk2/scrollingcoordinator/scrolling-tree/coordinated-frame-in-fixed-expected.txt:
+        * platform/ios-wk2/scrollingcoordinator/scrolling-tree/coordinated-frame-lose-scrolling-ancestor-expected.txt:
+        * platform/ios-wk2/scrollingcoordinator/scrolling-tree/fixed-inside-frame-expected.txt:
+        * platform/ios-wk2/scrollingcoordinator/scrolling-tree/gain-scrolling-node-parent-expected.txt:
+        * platform/ios-wk2/scrollingcoordinator/scrolling-tree/lose-scrolling-node-parent-expected.txt:
+        * platform/ios-wk2/scrollingcoordinator/scrolling-tree/overflow-in-fixed-expected.txt:
+        * platform/ios-wk2/scrollingcoordinator/scrolling-tree/remove-coordinated-frame-expected.txt:
+        * platform/ios-wk2/scrollingcoordinator/scrolling-tree/remove-scrolling-role-expected.txt:
+        * platform/ios-wk2/scrollingcoordinator/scrolling-tree/reparent-across-compositing-layers-expected.txt:
+        * platform/ios-wk2/scrollingcoordinator/scrolling-tree/reparent-with-layer-removal-expected.txt:
+        * platform/ios-wk2/scrollingcoordinator/scrolling-tree/scrolling-tree-includes-frame-expected.txt:
+        * platform/ios-wk2/scrollingcoordinator/scrolling-tree/scrolling-tree-is-z-order-expected.txt:
+        * platform/ios-wk2/scrollingcoordinator/scrolling-tree/toggle-coordinated-frame-scrolling-expected.txt:
+        * scrollingcoordinator/scrolling-tree/coordinated-frame-expected.txt:
+        * scrollingcoordinator/scrolling-tree/coordinated-frame-gain-scrolling-ancestor-expected.txt:
+        * scrollingcoordinator/scrolling-tree/coordinated-frame-in-fixed-expected.txt:
+        * scrollingcoordinator/scrolling-tree/coordinated-frame-lose-scrolling-ancestor-expected.txt:
+        * scrollingcoordinator/scrolling-tree/fixed-inside-frame-expected.txt:
+        * scrollingcoordinator/scrolling-tree/gain-scrolling-node-parent-expected.txt:
+        * scrollingcoordinator/scrolling-tree/lose-scrolling-node-parent-expected.txt:
+        * scrollingcoordinator/scrolling-tree/overflow-in-fixed-expected.txt:
+        * scrollingcoordinator/scrolling-tree/remove-coordinated-frame-expected.txt:
+        * scrollingcoordinator/scrolling-tree/remove-scrolling-role-expected.txt:
+        * scrollingcoordinator/scrolling-tree/reparent-across-compositing-layers-expected.txt:
+        * scrollingcoordinator/scrolling-tree/reparent-with-layer-removal-expected.txt:
+        * scrollingcoordinator/scrolling-tree/scrolling-tree-includes-frame-expected.txt:
+        * scrollingcoordinator/scrolling-tree/scrolling-tree-is-z-order-expected.txt:
+        * scrollingcoordinator/scrolling-tree/toggle-coordinated-frame-scrolling-expected.txt:
+        * scrollingcoordinator/scrolling-tree/toggle-coordinated-frame-scrolling.html: Don't insert the first scrolling tree
+        dump until the end, to avoid it affecting main frame height before we get the second layer tree.
+        * tiled-drawing/scrolling/clamp-out-of-bounds-scrolls-expected.txt:
+        * tiled-drawing/scrolling/fixed/absolute-inside-fixed-expected.txt:
+        * tiled-drawing/scrolling/fixed/absolute-inside-out-of-view-fixed-expected.txt:
+        * tiled-drawing/scrolling/fixed/fixed-in-overflow-expected.txt:
+        * tiled-drawing/scrolling/fixed/fixed-position-out-of-view-expected.txt:
+        * tiled-drawing/scrolling/fixed/fixed-position-out-of-view-negative-zindex-expected.txt:
+        * tiled-drawing/scrolling/fixed/four-bars-expected.txt:
+        * tiled-drawing/scrolling/fixed/four-bars-with-header-and-footer-expected.txt:
+        * tiled-drawing/scrolling/fixed/four-bars-zoomed-expected.txt:
+        * tiled-drawing/scrolling/fixed/negative-scroll-offset-expected.txt:
+        * tiled-drawing/scrolling/fixed/negative-scroll-offset-in-view-expected.txt:
+        * tiled-drawing/scrolling/fixed/nested-fixed-expected.txt:
+        * tiled-drawing/scrolling/fixed/percentage-inside-fixed-expected.txt:
+        * tiled-drawing/scrolling/frames/scroll-region-after-frame-layout-expected.txt:
+        * tiled-drawing/scrolling/scrolling-tree-after-scroll-expected.txt:
+        * tiled-drawing/scrolling/scrolling-tree-slow-scrolling-expected.txt:
+        * tiled-drawing/scrolling/sticky/negative-scroll-offset-expected.txt:
+        * tiled-drawing/scrolling/sticky/sticky-horizontal-expected.txt:
+        * tiled-drawing/scrolling/sticky/sticky-vertical-expected.txt:
+
 2019-02-21  Darin Adler  <darin@apple.com>
 
         Some refinements for Node and Document
index 5b936a5..355504a 100644 (file)
@@ -29,7 +29,6 @@
 function runTest() {
     description("This test applies page scale and scrolls the page, and checks that elementFromPoint returns the correct element.");
     if (window.internals) {
-        window.internals.settings.setVisualViewportEnabled(true);
         window.internals.settings.setClientCoordinatesRelativeToLayoutViewport(true);
         window.internals.setPageScaleFactor(2, 0, 0);
     }
index a639eef..b623b8a 100644 (file)
@@ -1,8 +1,5 @@
 jsTestIsAsync = true;
 
-if (window.internals)
-    internals.settings.setVisualViewportEnabled(true);
-
 function stringFromRect(domRect)
 {
     return `${domRect.x}, ${domRect.y} - ${domRect.width} x ${domRect.height}`;
index 1353a0a..aa1858a 100644 (file)
     (vertical scroll elasticity 1)
     (horizontal scrollbar mode 0)
     (vertical scrollbar mode 0))
-  (visual viewport enabled 1)
   (layout viewport at (0,0) size 800x600)
   (min layout viewport origin (0,0))
   (max layout viewport origin (0,0))
index 60572d3..05bd15b 100644 (file)
@@ -73,7 +73,6 @@
     (vertical scroll elasticity 1)
     (horizontal scrollbar mode 0)
     (vertical scrollbar mode 0))
-  (visual viewport enabled 1)
   (layout viewport at (0,0) size 800x600)
   (min layout viewport origin (0,0))
   (max layout viewport origin (0,0))
index 73ed323..262efcc 100644 (file)
@@ -43,9 +43,6 @@
         if (window.testRunner)
             testRunner.waitUntilDone();
 
-        if (window.internals)
-            internals.settings.setVisualViewportEnabled(true);
-
         function getUIScript()
         {
             return `(function() {
index f9217bf..8c3c7e5 100644 (file)
@@ -28,9 +28,6 @@
     <script>
         description("This test zooms and scrolls the page and checks that client rects are correct.");
 
-        if (window.internals)
-            internals.settings.setVisualViewportEnabled(true);
-
         window.jsTestIsAsync = true;
 
         function stringFromRect(domRect)
index 6ad520a..328e35e 100644 (file)
@@ -28,9 +28,6 @@
     <script>
         description("This test zooms and scrolls the page and checks that client rects are correct.");
 
-        if (window.internals)
-            internals.settings.setVisualViewportEnabled(true);
-
         window.jsTestIsAsync = true;
 
         function stringFromRect(domRect)
index fd32a07..b922384 100644 (file)
@@ -12,9 +12,6 @@
     <script>
         description("This test scrolls the page and checks that the layout and visual viewports respond as expected.");
 
-        if (window.internals)
-            internals.settings.setVisualViewportEnabled(true);
-
         window.jsTestIsAsync = true;
 
         function doTest()
index 92c2b5a..ebcc820 100644 (file)
@@ -2,9 +2,6 @@
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
 <script>
-    if (window.internals)
-        internals.settings.setVisualViewportEnabled(true);
-
     var test = async_test('Verify that a resize event gets fired when the window is resized.');
 
     function resizeHandler() {
index 7b49531..6c40844 100644 (file)
@@ -11,9 +11,6 @@
 <script>
     var pageScaleFactor = 2;
 
-    if (window.internals)
-        internals.settings.setVisualViewportEnabled(true);
-
     var test = async_test('Verify a resize event gets fired on window.visualViewport after pinch-zoom');
 
     var resizeDone = false;
index a768c5b..dde9774 100644 (file)
@@ -12,9 +12,6 @@
     <script>
         description("This test scrolls the page and checks that the layout and visual viewports respond as expected.");
 
-        if (window.internals)
-            internals.settings.setVisualViewportEnabled(true);
-
         window.jsTestIsAsync = true;
 
         function doTest()
index f5ba780..091bf4c 100644 (file)
@@ -12,9 +12,6 @@
     <script>
         description("This test zooms and scrolls the page and checks that the layout and visual viewports respond as expected.");
 
-        if (window.internals)
-            internals.settings.setVisualViewportEnabled(true);
-
         window.jsTestIsAsync = true;
 
         function doAfterZooming()
index e20e941..d3cd294 100644 (file)
@@ -13,7 +13,6 @@
         description("This test scrolls the page with extended backgrounds enabled and checks that the layout and visual viewports respond as expected.");
 
         if (window.internals) {
-            internals.settings.setVisualViewportEnabled(true);
             internals.settings.setAllowUnclampedScrollPosition(true);
             internals.settings.setBackgroundShouldExtendBeyondPage(true);
         }
index 4e7f257..094ce49 100644 (file)
@@ -13,7 +13,6 @@
         description("This test scrolls the page and checks that the layout and visual viewports respond as expected.");
 
         if (window.internals) {
-            internals.settings.setVisualViewportEnabled(true);
             internals.settings.setAllowUnclampedScrollPosition(true);
             internals.setHeaderHeight(52);
             internals.setFooterHeight(43);
index b1c94cf..984fcf0 100644 (file)
     <script>
         description("This test scrolls the page and checks that the layout and visual viewports respond as expected.");
 
-        if (window.internals) {
-            internals.settings.setVisualViewportEnabled(true);
+        if (window.internals)
             internals.settings.setAllowUnclampedScrollPosition(true);
-        }
 
         window.jsTestIsAsync = true;
 
index e00db02..d468d66 100644 (file)
@@ -11,9 +11,6 @@
 <script>
     var pageScaleFactor = 2;
 
-    if (window.internals)
-        internals.settings.setVisualViewportEnabled(true);
-
     var test = async_test('Verify that a scroll event gets fired on window.visualViewport when its offset changes');
 
     function scrollEventHandler() {
index 22ca548..391b8de 100644 (file)
@@ -13,7 +13,6 @@
     (has enabled horizontal scrollbar 1)
     (has enabled vertical scrollbar 1))
   (frame scale factor 2.00)
-  (visual viewport enabled 1)
   (layout viewport at (0,207.50) size 785x585)
   (min layout viewport origin (0,0))
   (max layout viewport origin (1223,1436))
index 1b3965f..ec399b0 100644 (file)
@@ -13,7 +13,6 @@
     (has enabled horizontal scrollbar 1)
     (has enabled vertical scrollbar 1))
   (frame scale factor 2.00)
-  (visual viewport enabled 1)
   (layout viewport at (0,230) size 785x585)
   (min layout viewport origin (0,0))
   (max layout viewport origin (1223,1436))
index 0143c60..5f00f4a 100644 (file)
@@ -37,9 +37,6 @@
             testRunner.waitUntilDone();
         }
 
-        if (window.internals)
-            internals.settings.setVisualViewportEnabled(true);
-        
         function doAfterZooming()
         {
             window.scrollTo(20, 875);
index 9f7466c..b62fd3e 100644 (file)
@@ -37,9 +37,6 @@
             testRunner.waitUntilDone();
         }
 
-        if (window.internals)
-            internals.settings.setVisualViewportEnabled(true);
-        
         function doAfterZooming()
         {
             window.scrollTo(20, 500);
index 3f20e5a..21250df 100644 (file)
@@ -11,7 +11,6 @@
     (has enabled horizontal scrollbar 1)
     (has enabled vertical scrollbar 1))
   (frame scale factor 2.00)
-  (visual viewport enabled 1)
   (layout viewport at (0,0) size 785x585)
   (min layout viewport origin (0,0))
   (max layout viewport origin (1223,1436))
index 3970530..1c024bf 100644 (file)
@@ -37,9 +37,6 @@
             testRunner.waitUntilDone();
         }
 
-        if (window.internals)
-            internals.settings.setVisualViewportEnabled(true);
-        
         function doAfterZooming()
         {
             // Zooming may scroll the view away from the origin.
index 163c401..935ec2a 100644 (file)
@@ -25,9 +25,6 @@
     var pageScaleFactor = 2;
     var scrollbarThicknessInCSSPixels;
 
-    if (window.internals)
-        internals.settings.setVisualViewportEnabled(true);
-
     function viewport() {
         return window.visualViewport;
     }
index 1b58f19..5e0b1e2 100644 (file)
@@ -12,9 +12,6 @@
     var pageScaleFactor = 2;
     var scrollbarThicknessInCSSPixels;
 
-    if (window.internals)
-        internals.settings.setVisualViewportEnabled(true);
-
     function viewport() {
         return window.visualViewport;
     }
index e287aae..32a4303 100644 (file)
@@ -15,9 +15,6 @@
     var pageScaleFactor = 2;
     var scrollbarThicknessInCSSPixels;
 
-    if (window.internals)
-        internals.settings.setVisualViewportEnabled(true);
-
     function frameViewport() {
         var frame = document.getElementById("frame");
         return frame.contentWindow.visualViewport;
index b50b11d..a266fcb 100644 (file)
@@ -12,9 +12,6 @@
     var pageZoomFactor = 2;
     var scrollbarThicknessInCSSPixels;
 
-    if (window.internals)
-        internals.settings.setVisualViewportEnabled(true);
-
     function viewport() {
         return window.visualViewport;
     }
index f533330..d9be25c 100644 (file)
@@ -13,9 +13,6 @@
     var pageScaleFactor = 2;
     var scrollbarThicknessInCSSPixels;
 
-    if (window.internals)
-        internals.settings.setVisualViewportEnabled(true);
-
     function viewport() {
         return window.visualViewport;
     }
index c641a24..f34deef 100644 (file)
@@ -3,9 +3,6 @@
 <script src="../../resources/testharnessreport.js"></script>
 <script src="../../resources/gc.js"></script>
 <script>
-if (window.internals)
-    internals.settings.setVisualViewportEnabled(true);
-
 test(() => {
     window.visualViewport.newValue = 23;
     gc();
index 3b78951..400ac66 100644 (file)
@@ -38,7 +38,6 @@
         if (window.internals) {
             internals.setHeaderHeight(43);
             internals.setFooterHeight(56);
-            internals.settings.setVisualViewportEnabled(true);
         }
 
         window.jsTestIsAsync = true;
index 4b4d3ce..002241a 100644 (file)
@@ -35,9 +35,6 @@
         if (window.testRunner)
             testRunner.waitUntilDone();
 
-        if (window.internals)
-            internals.settings.setVisualViewportEnabled(true);
-        
         function doAfterZooming()
         {
             window.scrollTo(275, 525);
index c7a003f..f0b9ecd 100644 (file)
@@ -35,9 +35,6 @@
     <script>
         description("This test zooms and scrolls the page and checks the positions of fixed-position objects.");
 
-        if (window.internals)
-            internals.settings.setVisualViewportEnabled(true);
-
         window.jsTestIsAsync = true;
 
         var fixedElement;
index 5535668..fcc13ff 100644 (file)
@@ -12,9 +12,6 @@
     <script>
         description("This test zooms and scrolls the page and checks that the layout and visual viewports respond as expected.");
 
-        if (window.internals)
-            internals.settings.setVisualViewportEnabled(true);
-
         window.jsTestIsAsync = true;
 
         function doAfterZooming()
index a6cb54b..17f7a61 100644 (file)
@@ -56,9 +56,6 @@
     <script src="../../resources/js-test-pre.js"></script>
     <script>
 
-    if (window.internals)
-        internals.settings.setVisualViewportEnabled(true);
-
     description("Tests revealing elements inside position:fixed after zooming.");
 
     window.jsTestIsAsync = true;
index ba24b91..49f9c1b 100644 (file)
     </style>
     <script src="../../resources/js-test-pre.js"></script>
     <script>
-
-    if (window.internals)
-        internals.settings.setVisualViewportEnabled(true);
-
     description("Tests scrolling to an anchor inside position:fixed after zooming doesn't try to scroll the page");
 
     window.jsTestIsAsync = true;
index e5a76e7..5339eb2 100644 (file)
@@ -8,7 +8,6 @@
     (vertical scroll elasticity 1)
     (horizontal scrollbar mode 0)
     (vertical scrollbar mode 0))
-  (visual viewport enabled 1)
   (layout viewport at (0,0) size 800x600)
   (min layout viewport origin (0,0))
   (max layout viewport origin (0,416))
@@ -26,7 +25,6 @@
             (vertical scroll elasticity 1)
             (horizontal scrollbar mode 0)
             (vertical scrollbar mode 0))
-          (visual viewport enabled 1)
           (layout viewport at (0,0) size 500x300)
           (min layout viewport origin (0,0))
           (max layout viewport origin (0,120))
index 3e2c9c7..d40172f 100644 (file)
@@ -8,7 +8,6 @@
     (vertical scroll elasticity 1)
     (horizontal scrollbar mode 0)
     (vertical scrollbar mode 0))
-  (visual viewport enabled 1)
   (layout viewport at (0,0) size 800x600)
   (min layout viewport origin (0,0))
   (max layout viewport origin (0,416))
@@ -31,7 +30,6 @@
                 (vertical scroll elasticity 1)
                 (horizontal scrollbar mode 1)
                 (vertical scrollbar mode 1))
-              (visual viewport enabled 1)
               (layout viewport at (0,0) size 500x300)
               (min layout viewport origin (0,0))
               (max layout viewport origin (0,120))
index 1609cae..4cd5d2b 100644 (file)
@@ -8,7 +8,6 @@
     (vertical scroll elasticity 1)
     (horizontal scrollbar mode 0)
     (vertical scrollbar mode 0))
-  (visual viewport enabled 1)
   (layout viewport at (0,0) size 800x600)
   (min layout viewport origin (0,0))
   (max layout viewport origin (0,416))
@@ -31,7 +30,6 @@
                 (vertical scroll elasticity 1)
                 (horizontal scrollbar mode 0)
                 (vertical scrollbar mode 0))
-              (visual viewport enabled 1)
               (layout viewport at (0,0) size 500x300)
               (min layout viewport origin (0,0))
               (max layout viewport origin (0,120))
index f80a475..14620b7 100644 (file)
@@ -8,7 +8,6 @@
     (vertical scroll elasticity 1)
     (horizontal scrollbar mode 0)
     (vertical scrollbar mode 0))
-  (visual viewport enabled 1)
   (layout viewport at (0,0) size 800x600)
   (min layout viewport origin (0,0))
   (max layout viewport origin (0,416))
@@ -26,7 +25,6 @@
             (vertical scroll elasticity 1)
             (horizontal scrollbar mode 1)
             (vertical scrollbar mode 1))
-          (visual viewport enabled 1)
           (layout viewport at (0,0) size 500x300)
           (min layout viewport origin (0,0))
           (max layout viewport origin (0,120))
index 9db90e5..1e6ed8b 100644 (file)
@@ -9,7 +9,6 @@
     (vertical scroll elasticity 1)
     (horizontal scrollbar mode 0)
     (vertical scrollbar mode 0))
-  (visual viewport enabled 1)
   (layout viewport at (0,0) size 800x600)
   (min layout viewport origin (0,0))
   (max layout viewport origin (0,57))
@@ -29,7 +28,6 @@
             (vertical scroll elasticity 1)
             (horizontal scrollbar mode 0)
             (vertical scrollbar mode 0))
-          (visual viewport enabled 1)
           (layout viewport at (0,120) size 480x400)
           (min layout viewport origin (0,0))
           (max layout viewport origin (0,616))
index 5fc7fa0..2f15ddc 100644 (file)
@@ -11,7 +11,6 @@ Inner scrolling content
     (vertical scroll elasticity 1)
     (horizontal scrollbar mode 0)
     (vertical scrollbar mode 0))
-  (visual viewport enabled 1)
   (layout viewport at (0,0) size 800x600)
   (min layout viewport origin (0,0))
   (max layout viewport origin (0,0))
index 5fc7fa0..2f15ddc 100644 (file)
@@ -11,7 +11,6 @@ Inner scrolling content
     (vertical scroll elasticity 1)
     (horizontal scrollbar mode 0)
     (vertical scrollbar mode 0))
-  (visual viewport enabled 1)
   (layout viewport at (0,0) size 800x600)
   (min layout viewport origin (0,0))
   (max layout viewport origin (0,0))
index 8abfcb9..79ad9c6 100644 (file)
@@ -9,7 +9,6 @@ Scrolling content
     (vertical scroll elasticity 1)
     (horizontal scrollbar mode 0)
     (vertical scrollbar mode 0))
-  (visual viewport enabled 1)
   (layout viewport at (0,0) size 800x600)
   (min layout viewport origin (0,0))
   (max layout viewport origin (0,0))
index 7a44392..6c04b47 100644 (file)
@@ -8,7 +8,6 @@
     (vertical scroll elasticity 1)
     (horizontal scrollbar mode 0)
     (vertical scrollbar mode 0))
-  (visual viewport enabled 1)
   (layout viewport at (0,0) size 800x600)
   (min layout viewport origin (0,0))
   (max layout viewport origin (0,416))
index bb7951a..72250e9 100644 (file)
@@ -8,7 +8,6 @@
     (vertical scroll elasticity 1)
     (horizontal scrollbar mode 0)
     (vertical scrollbar mode 0))
-  (visual viewport enabled 1)
   (layout viewport at (0,0) size 800x600)
   (min layout viewport origin (0,0))
   (max layout viewport origin (0,1913))
index 1843ab3..17bb70d 100644 (file)
@@ -11,7 +11,6 @@ Inner scrolling content
     (vertical scroll elasticity 1)
     (horizontal scrollbar mode 0)
     (vertical scrollbar mode 0))
-  (visual viewport enabled 1)
   (layout viewport at (0,0) size 800x600)
   (min layout viewport origin (0,0))
   (max layout viewport origin (0,0))
index 485f568..da3973e 100644 (file)
@@ -11,7 +11,6 @@ Inner scrolling content
     (vertical scroll elasticity 1)
     (horizontal scrollbar mode 0)
     (vertical scrollbar mode 0))
-  (visual viewport enabled 1)
   (layout viewport at (0,0) size 800x600)
   (min layout viewport origin (0,0))
   (max layout viewport origin (0,441))
index acd7100..ca445b3 100644 (file)
@@ -9,7 +9,6 @@
     (vertical scroll elasticity 1)
     (horizontal scrollbar mode 0)
     (vertical scrollbar mode 0))
-  (visual viewport enabled 1)
   (layout viewport at (0,0) size 800x600)
   (min layout viewport origin (0,0))
   (max layout viewport origin (0,0))
@@ -27,7 +26,6 @@
             (vertical scroll elasticity 1)
             (horizontal scrollbar mode 0)
             (vertical scrollbar mode 0))
-          (visual viewport enabled 1)
           (layout viewport at (0,0) size 100x200)
           (min layout viewport origin (0,0))
           (max layout viewport origin (208,216))
index b0e3c0b..58656f6 100644 (file)
@@ -9,7 +9,6 @@ FirstSecondThird
     (vertical scroll elasticity 1)
     (horizontal scrollbar mode 0)
     (vertical scrollbar mode 0))
-  (visual viewport enabled 1)
   (layout viewport at (0,0) size 800x600)
   (min layout viewport origin (0,0))
   (max layout viewport origin (0,0))
index 731282f..76ff8bd 100644 (file)
@@ -11,7 +11,6 @@ Scrolling tree on non-scrollable
     (vertical scroll elasticity 1)
     (horizontal scrollbar mode 0)
     (vertical scrollbar mode 0))
-  (visual viewport enabled 1)
   (layout viewport at (0,0) size 800x600)
   (min layout viewport origin (0,0))
   (max layout viewport origin (0,45))
@@ -22,17 +21,16 @@ Scrolling tree on non-scrollable
       (children 1
         (Frame scrolling node
           (scrollable area size 600 500)
-          (contents size 600 1024)
+          (contents size 600 500)
           (parent relative scrollable rect at (0,0) size 600x500)
           (scrollable area parameters 
             (horizontal scroll elasticity 1)
             (vertical scroll elasticity 1)
             (horizontal scrollbar mode 0)
             (vertical scrollbar mode 0))
-          (visual viewport enabled 1)
           (layout viewport at (0,0) size 600x500)
           (min layout viewport origin (0,0))
-          (max layout viewport origin (0,524))
+          (max layout viewport origin (0,0))
           (behavior for fixed 0)
           (children 1
             (Frame hosting node
@@ -47,7 +45,6 @@ Scrolling tree on non-scrollable
                     (vertical scroll elasticity 1)
                     (horizontal scrollbar mode 0)
                     (vertical scrollbar mode 0))
-                  (visual viewport enabled 1)
                   (layout viewport at (0,0) size 500x400)
                   (min layout viewport origin (0,0))
                   (max layout viewport origin (0,624))
@@ -67,17 +64,16 @@ Scrolling tree on scrollable
 
 (Frame scrolling node
   (scrollable area size 800 600)
-  (contents size 800 1515)
+  (contents size 800 645)
   (parent relative scrollable rect at (0,0) size 800x600)
   (scrollable area parameters 
     (horizontal scroll elasticity 1)
     (vertical scroll elasticity 1)
     (horizontal scrollbar mode 0)
     (vertical scrollbar mode 0))
-  (visual viewport enabled 1)
   (layout viewport at (0,0) size 800x600)
   (min layout viewport origin (0,0))
-  (max layout viewport origin (0,915))
+  (max layout viewport origin (0,45))
   (behavior for fixed 0)
   (children 1
     (Frame hosting node
@@ -85,17 +81,16 @@ Scrolling tree on scrollable
       (children 1
         (Frame scrolling node
           (scrollable area size 600 500)
-          (contents size 600 500)
+          (contents size 600 1024)
           (parent relative scrollable rect at (0,0) size 600x500)
           (scrollable area parameters 
             (horizontal scroll elasticity 1)
             (vertical scroll elasticity 1)
             (horizontal scrollbar mode 0)
             (vertical scrollbar mode 0))
-          (visual viewport enabled 1)
           (layout viewport at (0,0) size 600x500)
           (min layout viewport origin (0,0))
-          (max layout viewport origin (0,0))
+          (max layout viewport origin (0,524))
           (behavior for fixed 0)
           (children 1
             (Frame hosting node
@@ -110,7 +105,6 @@ Scrolling tree on scrollable
                     (vertical scroll elasticity 1)
                     (horizontal scrollbar mode 0)
                     (vertical scrollbar mode 0))
-                  (visual viewport enabled 1)
                   (layout viewport at (0,0) size 500x400)
                   (min layout viewport origin (0,0))
                   (max layout viewport origin (0,624))
index 0e4fe25..042dd1b 100644 (file)
@@ -9,7 +9,6 @@
     (horizontal scrollbar mode 0)
     (vertical scrollbar mode 0)
     (has enabled vertical scrollbar 1))
-  (visual viewport enabled 1)
   (layout viewport at (0,0) size 785x600)
   (min layout viewport origin (0,0))
   (max layout viewport origin (0,416))
@@ -30,7 +29,6 @@
             (horizontal scrollbar mode 0)
             (vertical scrollbar mode 0)
             (has enabled vertical scrollbar 1))
-          (visual viewport enabled 1)
           (layout viewport at (0,0) size 485x300)
           (min layout viewport origin (0,0))
           (max layout viewport origin (0,120))
index 88fde80..fd1691d 100644 (file)
@@ -9,7 +9,6 @@
     (horizontal scrollbar mode 0)
     (vertical scrollbar mode 0)
     (has enabled vertical scrollbar 1))
-  (visual viewport enabled 1)
   (layout viewport at (0,0) size 785x600)
   (min layout viewport origin (0,0))
   (max layout viewport origin (0,416))
@@ -34,7 +33,6 @@
                 (vertical scroll elasticity 0)
                 (horizontal scrollbar mode 1)
                 (vertical scrollbar mode 1))
-              (visual viewport enabled 1)
               (layout viewport at (0,0) size 500x300)
               (min layout viewport origin (0,0))
               (max layout viewport origin (0,120))
index beaff96..42aecb0 100644 (file)
@@ -9,7 +9,6 @@
     (horizontal scrollbar mode 0)
     (vertical scrollbar mode 0)
     (has enabled vertical scrollbar 1))
-  (visual viewport enabled 1)
   (layout viewport at (0,0) size 785x600)
   (min layout viewport origin (0,0))
   (max layout viewport origin (0,416))
@@ -35,7 +34,6 @@
                 (horizontal scrollbar mode 0)
                 (vertical scrollbar mode 0)
                 (has enabled vertical scrollbar 1))
-              (visual viewport enabled 1)
               (layout viewport at (0,0) size 485x300)
               (min layout viewport origin (0,0))
               (max layout viewport origin (0,120))
index 143134a..797508d 100644 (file)
@@ -9,7 +9,6 @@
     (horizontal scrollbar mode 0)
     (vertical scrollbar mode 0)
     (has enabled vertical scrollbar 1))
-  (visual viewport enabled 1)
   (layout viewport at (0,0) size 785x600)
   (min layout viewport origin (0,0))
   (max layout viewport origin (0,416))
@@ -29,7 +28,6 @@
             (vertical scroll elasticity 0)
             (horizontal scrollbar mode 1)
             (vertical scrollbar mode 1))
-          (visual viewport enabled 1)
           (layout viewport at (0,0) size 500x300)
           (min layout viewport origin (0,0))
           (max layout viewport origin (0,120))
index daa3049..0e625ad 100644 (file)
@@ -10,7 +10,6 @@
     (horizontal scrollbar mode 0)
     (vertical scrollbar mode 0)
     (has enabled vertical scrollbar 1))
-  (visual viewport enabled 1)
   (layout viewport at (0,0) size 785x600)
   (min layout viewport origin (0,0))
   (max layout viewport origin (0,57))
@@ -31,7 +30,6 @@
             (horizontal scrollbar mode 0)
             (vertical scrollbar mode 0)
             (has enabled vertical scrollbar 1))
-          (visual viewport enabled 1)
           (layout viewport at (0,120) size 465x400)
           (min layout viewport origin (0,0))
           (max layout viewport origin (0,616))
index 18c26fa..3ca6a74 100644 (file)
@@ -11,7 +11,6 @@ Inner scrolling content
     (vertical scroll elasticity 2)
     (horizontal scrollbar mode 0)
     (vertical scrollbar mode 0))
-  (visual viewport enabled 1)
   (layout viewport at (0,0) size 800x600)
   (min layout viewport origin (0,0))
   (max layout viewport origin (0,0))
index 18c26fa..3ca6a74 100644 (file)
@@ -11,7 +11,6 @@ Inner scrolling content
     (vertical scroll elasticity 2)
     (horizontal scrollbar mode 0)
     (vertical scrollbar mode 0))
-  (visual viewport enabled 1)
   (layout viewport at (0,0) size 800x600)
   (min layout viewport origin (0,0))
   (max layout viewport origin (0,0))
index ca3c47f..15f9b99 100644 (file)
@@ -9,7 +9,6 @@ Scrolling content
     (vertical scroll elasticity 2)
     (horizontal scrollbar mode 0)
     (vertical scrollbar mode 0))
-  (visual viewport enabled 1)
   (layout viewport at (0,0) size 800x600)
   (min layout viewport origin (0,0))
   (max layout viewport origin (0,0))
index 9623402..d18a44a 100644 (file)
@@ -9,7 +9,6 @@
     (horizontal scrollbar mode 0)
     (vertical scrollbar mode 0)
     (has enabled vertical scrollbar 1))
-  (visual viewport enabled 1)
   (layout viewport at (0,0) size 785x600)
   (min layout viewport origin (0,0))
   (max layout viewport origin (0,416))
index 575858c..2b07022 100644 (file)
@@ -9,7 +9,6 @@
     (horizontal scrollbar mode 0)
     (vertical scrollbar mode 0)
     (has enabled vertical scrollbar 1))
-  (visual viewport enabled 1)
   (layout viewport at (0,0) size 785x600)
   (min layout viewport origin (0,0))
   (max layout viewport origin (0,1913))
index 6c17932..d96c3d2 100644 (file)
@@ -11,7 +11,6 @@ Inner scrolling content
     (vertical scroll elasticity 2)
     (horizontal scrollbar mode 0)
     (vertical scrollbar mode 0))
-  (visual viewport enabled 1)
   (layout viewport at (0,0) size 800x600)
   (min layout viewport origin (0,0))
   (max layout viewport origin (0,0))
index d2f664b..2babd2c 100644 (file)
@@ -12,7 +12,6 @@ Inner scrolling content
     (horizontal scrollbar mode 0)
     (vertical scrollbar mode 0)
     (has enabled vertical scrollbar 1))
-  (visual viewport enabled 1)
   (layout viewport at (0,0) size 785x600)
   (min layout viewport origin (0,0))
   (max layout viewport origin (0,441))
index a0d4da4..8e7d178 100644 (file)
         window.addEventListener('load', () => {
             requestAnimationFrame(() => {
                 document.body.classList.add('changed');
+                document.body.offsetWidth;
                 parent.subFrameBecameNonScrollable();
 
                 requestAnimationFrame(() => {
                     document.body.classList.remove('changed');
+                    document.body.offsetWidth;
                     parent.subFrameBecameScrollable();
                 });
             });
index 51a7951..2bde8ae 100644 (file)
@@ -9,7 +9,6 @@
     (vertical scroll elasticity 2)
     (horizontal scrollbar mode 0)
     (vertical scrollbar mode 0))
-  (visual viewport enabled 1)
   (layout viewport at (0,0) size 800x600)
   (min layout viewport origin (0,0))
   (max layout viewport origin (0,0))
@@ -29,7 +28,6 @@
             (vertical scrollbar mode 0)
             (has enabled horizontal scrollbar 1)
             (has enabled vertical scrollbar 1))
-          (visual viewport enabled 1)
           (layout viewport at (0,0) size 85x185)
           (min layout viewport origin (0,0))
           (max layout viewport origin (223,231))
index 7a30992..84644f1 100644 (file)
@@ -9,7 +9,6 @@ FirstSecondThird
     (vertical scroll elasticity 2)
     (horizontal scrollbar mode 0)
     (vertical scrollbar mode 0))
-  (visual viewport enabled 1)
   (layout viewport at (0,0) size 800x600)
   (min layout viewport origin (0,0))
   (max layout viewport origin (0,0))
index f1a58cd..49c98e2 100644 (file)
@@ -12,7 +12,6 @@ Scrolling tree on non-scrollable
     (horizontal scrollbar mode 0)
     (vertical scrollbar mode 0)
     (has enabled vertical scrollbar 1))
-  (visual viewport enabled 1)
   (layout viewport at (0,0) size 785x600)
   (min layout viewport origin (0,0))
   (max layout viewport origin (0,40))
@@ -22,19 +21,17 @@ Scrolling tree on non-scrollable
       (parent relative scrollable rect at (30,30) size 600x500)
       (children 1
         (Frame scrolling node
-          (scrollable area size 585 500)
-          (contents size 585 1024)
+          (scrollable area size 600 500)
+          (contents size 600 500)
           (parent relative scrollable rect at (0,0) size 600x500)
           (scrollable area parameters 
             (horizontal scroll elasticity 0)
             (vertical scroll elasticity 0)
             (horizontal scrollbar mode 0)
-            (vertical scrollbar mode 0)
-            (has enabled vertical scrollbar 1))
-          (visual viewport enabled 1)
-          (layout viewport at (0,0) size 585x500)
+            (vertical scrollbar mode 0))
+          (layout viewport at (0,0) size 600x500)
           (min layout viewport origin (0,0))
-          (max layout viewport origin (0,524))
+          (max layout viewport origin (0,0))
           (behavior for fixed 0)
           (children 1
             (Frame hosting node
@@ -50,7 +47,6 @@ Scrolling tree on non-scrollable
                     (horizontal scrollbar mode 0)
                     (vertical scrollbar mode 0)
                     (has enabled vertical scrollbar 1))
-                  (visual viewport enabled 1)
                   (layout viewport at (0,0) size 485x400)
                   (min layout viewport origin (0,0))
                   (max layout viewport origin (0,624))
@@ -70,7 +66,7 @@ Scrolling tree on scrollable
 
 (Frame scrolling node
   (scrollable area size 785 600)
-  (contents size 785 1616)
+  (contents size 785 640)
   (parent relative scrollable rect at (0,0) size 800x600)
   (scrollable area parameters 
     (horizontal scroll elasticity 2)
@@ -78,28 +74,27 @@ Scrolling tree on scrollable
     (horizontal scrollbar mode 0)
     (vertical scrollbar mode 0)
     (has enabled vertical scrollbar 1))
-  (visual viewport enabled 1)
   (layout viewport at (0,0) size 785x600)
   (min layout viewport origin (0,0))
-  (max layout viewport origin (0,1016))
+  (max layout viewport origin (0,40))
   (behavior for fixed 0)
   (children 1
     (Frame hosting node
       (parent relative scrollable rect at (30,30) size 600x500)
       (children 1
         (Frame scrolling node
-          (scrollable area size 600 500)
-          (contents size 600 500)
+          (scrollable area size 585 500)
+          (contents size 585 1024)
           (parent relative scrollable rect at (0,0) size 600x500)
           (scrollable area parameters 
             (horizontal scroll elasticity 0)
             (vertical scroll elasticity 0)
             (horizontal scrollbar mode 0)
-            (vertical scrollbar mode 0))
-          (visual viewport enabled 1)
-          (layout viewport at (0,0) size 600x500)
+            (vertical scrollbar mode 0)
+            (has enabled vertical scrollbar 1))
+          (layout viewport at (0,0) size 585x500)
           (min layout viewport origin (0,0))
-          (max layout viewport origin (0,0))
+          (max layout viewport origin (0,524))
           (behavior for fixed 0)
           (children 1
             (Frame hosting node
@@ -115,7 +110,6 @@ Scrolling tree on scrollable
                     (horizontal scrollbar mode 0)
                     (vertical scrollbar mode 0)
                     (has enabled vertical scrollbar 1))
-                  (visual viewport enabled 1)
                   (layout viewport at (0,0) size 485x400)
                   (min layout viewport origin (0,0))
                   (max layout viewport origin (0,624))
index d043bb3..ff1ebfe 100644 (file)
       if (window.internals)\r
           window.internals.settings.setAsyncFrameScrollingEnabled(true);\r
 \r
+      var firstScrollingTree = "";\r
+      var secondScrollingTree = "";\r
+      \r
       function subFrameBecameNonScrollable()\r
       {\r
           if (window.internals)\r
-              document.getElementById('scrollingTree1').innerText = window.internals.scrollingStateTreeAsText() + "\n";\r
+              firstScrollingTree = window.internals.scrollingStateTreeAsText() + "\n";\r
       }\r
 \r
       function subFrameBecameScrollable()\r
       {\r
           if (window.internals)\r
-              document.getElementById('scrollingTree2').innerText = window.internals.scrollingStateTreeAsText() + "\n";\r
+              secondScrollingTree = window.internals.scrollingStateTreeAsText() + "\n";\r
+              \r
+          document.getElementById('scrollingTree1').innerText = firstScrollingTree;\r
+          document.getElementById('scrollingTree2').innerText = secondScrollingTree;\r
 \r
           if (window.testRunner)\r
               testRunner.notifyDone();\r
index b351ab2..7220573 100644 (file)
@@ -11,7 +11,6 @@ Attempted scroll to -5000, 0
     (vertical scrollbar mode 0)
     (has enabled horizontal scrollbar 1)
     (has enabled vertical scrollbar 1))
-  (visual viewport enabled 1)
   (layout viewport at (0,0) size 785x585)
   (min layout viewport origin (0,0))
   (max layout viewport origin (4223,4436))
@@ -31,7 +30,6 @@ Attempted scroll to 0, -5000
     (vertical scrollbar mode 0)
     (has enabled horizontal scrollbar 1)
     (has enabled vertical scrollbar 1))
-  (visual viewport enabled 1)
   (layout viewport at (0,0) size 785x585)
   (min layout viewport origin (0,0))
   (max layout viewport origin (4223,4436))
@@ -51,7 +49,6 @@ Attempted scroll to -5000, -5000
     (vertical scrollbar mode 0)
     (has enabled horizontal scrollbar 1)
     (has enabled vertical scrollbar 1))
-  (visual viewport enabled 1)
   (layout viewport at (0,0) size 785x585)
   (min layout viewport origin (0,0))
   (max layout viewport origin (4223,4436))
@@ -73,7 +70,6 @@ Attempted scroll to 10000, 0
     (vertical scrollbar mode 0)
     (has enabled horizontal scrollbar 1)
     (has enabled vertical scrollbar 1))
-  (visual viewport enabled 1)
   (layout viewport at (0,0) size 785x585)
   (min layout viewport origin (0,0))
   (max layout viewport origin (4223,4436))
@@ -95,7 +91,6 @@ Attempted scroll to 0, 10000
     (vertical scrollbar mode 0)
     (has enabled horizontal scrollbar 1)
     (has enabled vertical scrollbar 1))
-  (visual viewport enabled 1)
   (layout viewport at (4223,0) size 785x585)
   (min layout viewport origin (0,0))
   (max layout viewport origin (4223,4436))
@@ -117,7 +112,6 @@ Attempted scroll to 10000, 10000
     (vertical scrollbar mode 0)
     (has enabled horizontal scrollbar 1)
     (has enabled vertical scrollbar 1))
-  (visual viewport enabled 1)
   (layout viewport at (0,4436) size 785x585)
   (min layout viewport origin (0,0))
   (max layout viewport origin (4223,4436))
index 177cb4c..706270d 100644 (file)
@@ -11,7 +11,6 @@
     (horizontal scrollbar mode 0)
     (vertical scrollbar mode 0)
     (has enabled vertical scrollbar 1))
-  (visual viewport enabled 1)
   (layout viewport at (0,200) size 785x600)
   (min layout viewport origin (0,0))
   (max layout viewport origin (0,2110))
index 8c21447..f71c736 100644 (file)
@@ -11,7 +11,6 @@
     (horizontal scrollbar mode 0)
     (vertical scrollbar mode 0)
     (has enabled vertical scrollbar 1))
-  (visual viewport enabled 1)
   (layout viewport at (0,200) size 785x600)
   (min layout viewport origin (0,0))
   (max layout viewport origin (0,1913))
index 0c3c3c9..41c9bbd 100644 (file)
@@ -11,7 +11,6 @@
     (horizontal scrollbar mode 0)
     (vertical scrollbar mode 0)
     (has enabled vertical scrollbar 1))
-  (visual viewport enabled 1)
   (layout viewport at (0,200) size 785x600)
   (min layout viewport origin (0,0))
   (max layout viewport origin (0,1613))
index 24cdde0..b4db96f 100644 (file)
@@ -9,7 +9,6 @@
     (horizontal scrollbar mode 0)
     (vertical scrollbar mode 0)
     (has enabled vertical scrollbar 1))
-  (visual viewport enabled 1)
   (layout viewport at (0,0) size 785x600)
   (min layout viewport origin (0,0))
   (max layout viewport origin (0,421))
index 24cdde0..b4db96f 100644 (file)
@@ -9,7 +9,6 @@
     (horizontal scrollbar mode 0)
     (vertical scrollbar mode 0)
     (has enabled vertical scrollbar 1))
-  (visual viewport enabled 1)
   (layout viewport at (0,0) size 785x600)
   (min layout viewport origin (0,0))
   (max layout viewport origin (0,421))
index 11fa988..b5e4e49 100644 (file)
@@ -11,7 +11,6 @@
     (horizontal scrollbar mode 0)
     (vertical scrollbar mode 0)
     (has enabled vertical scrollbar 1))
-  (visual viewport enabled 1)
   (layout viewport at (0,200) size 785x600)
   (min layout viewport origin (0,0))
   (max layout viewport origin (0,1621))
index 168965a..a9fd4dc 100644 (file)
@@ -13,7 +13,6 @@
     (has enabled vertical scrollbar 1))
   (header height 100)
   (footer height 100)
-  (visual viewport enabled 1)
   (layout viewport at (0,100) size 785x600)
   (min layout viewport origin (0,0))
   (max layout viewport origin (0,1621))
index 10ddec0..5a40c1a 100644 (file)
@@ -10,7 +10,6 @@
     (has enabled horizontal scrollbar 1)
     (has enabled vertical scrollbar 1))
   (frame scale factor 2.30)
-  (visual viewport enabled 1)
   (layout viewport at (0,0) size 785x585)
   (min layout viewport origin (0,0))
   (max layout viewport origin (0,1636))
index 8eba230..2ca6761 100644 (file)
@@ -9,7 +9,6 @@
     (horizontal scrollbar mode 0)
     (vertical scrollbar mode 0)
     (has enabled vertical scrollbar 1))
-  (visual viewport enabled 1)
   (layout viewport at (0,0) size 785x600)
   (min layout viewport origin (0,0))
   (max layout viewport origin (0,1621))
index c081d04..f7afd9b 100644 (file)
@@ -9,7 +9,6 @@
     (horizontal scrollbar mode 0)
     (vertical scrollbar mode 0)
     (has enabled vertical scrollbar 1))
-  (visual viewport enabled 1)
   (layout viewport at (0,0) size 785x600)
   (min layout viewport origin (0,0))
   (max layout viewport origin (0,1621))
index 1e0873d..de62597 100644 (file)
@@ -11,7 +11,6 @@
     (horizontal scrollbar mode 0)
     (vertical scrollbar mode 0)
     (has enabled vertical scrollbar 1))
-  (visual viewport enabled 1)
   (layout viewport at (0,200) size 785x600)
   (min layout viewport origin (0,0))
   (max layout viewport origin (0,1613))
index 98fdb8c..53a3a91 100644 (file)
@@ -11,7 +11,6 @@
     (horizontal scrollbar mode 0)
     (vertical scrollbar mode 0)
     (has enabled vertical scrollbar 1))
-  (visual viewport enabled 1)
   (layout viewport at (0,200) size 785x600)
   (min layout viewport origin (0,0))
   (max layout viewport origin (0,1913))
index f2437bc..e1f0bc0 100644 (file)
@@ -10,7 +10,6 @@
     (horizontal scrollbar mode 0)
     (vertical scrollbar mode 0)
     (has enabled vertical scrollbar 1))
-  (visual viewport enabled 1)
   (layout viewport at (0,0) size 785x600)
   (min layout viewport origin (0,0))
   (max layout viewport origin (0,157))
index 91a966f..5024b34 100644 (file)
@@ -11,7 +11,6 @@
     (horizontal scrollbar mode 0)
     (vertical scrollbar mode 0)
     (has enabled vertical scrollbar 1))
-  (visual viewport enabled 1)
   (layout viewport at (0,0) size 785x600)
   (min layout viewport origin (0,0))
   (max layout viewport origin (0,4421))
index 73b51b6..3ad1a94 100644 (file)
@@ -8,7 +8,6 @@
     (vertical scroll elasticity 2)
     (horizontal scrollbar mode 0)
     (vertical scrollbar mode 0))
-  (visual viewport enabled 1)
   (layout viewport at (0,0) size 800x600)
   (min layout viewport origin (0,0))
   (max layout viewport origin (0,0))
index 3c297b5..034c041 100644 (file)
@@ -9,7 +9,6 @@
     (horizontal scrollbar mode 0)
     (vertical scrollbar mode 0)
     (has enabled vertical scrollbar 1))
-  (visual viewport enabled 1)
   (layout viewport at (0,0) size 785x600)
   (min layout viewport origin (0,0))
   (max layout viewport origin (0,1616))
index c0ed0bd..def9c96 100644 (file)
@@ -12,7 +12,6 @@ Left sticky Right sticky Left % sticky Right % sticky Left and Right Left and Ri
     (horizontal scrollbar mode 0)
     (vertical scrollbar mode 0)
     (has enabled horizontal scrollbar 1))
-  (visual viewport enabled 1)
   (layout viewport at (800,0) size 800x585)
   (min layout viewport origin (0,0))
   (max layout viewport origin (1208,0))
index 502e925..f5ae384 100644 (file)
@@ -16,7 +16,6 @@ Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor
     (horizontal scrollbar mode 0)
     (vertical scrollbar mode 0)
     (has enabled vertical scrollbar 1))
-  (visual viewport enabled 1)
   (layout viewport at (0,580) size 785x600)
   (min layout viewport origin (0,0))
   (max layout viewport origin (0,2308))
index f417402..78d8fb8 100644 (file)
@@ -1,3 +1,44 @@
+2019-02-21  Simon Fraser  <simon.fraser@apple.com>
+
+        Hardcode Visual Viewports on everywhere except iOS WK1
+        https://bugs.webkit.org/show_bug.cgi?id=194928
+
+        Reviewed by Zalan Bujtas.
+
+        Remove the WK1 and WK2 preferences and MiniBrowser menu item for "visual viewports",
+        change the default value of the Setting to 'true', and hardcode WebView on iOS to
+        set it to false. The setting has shipped for several years and there's no need to turn
+        it off now.
+
+        Similarly, disable the "Visual Viewport API" on iOS WK1, since it makes no sense if
+        Visual Viewports are not enabled.
+        
+        Remove the "visualViewportEnabled" flag and unused code paths from scrolling tree code
+        that only runs in WK2
+
+        * page/Settings.yaml:
+        * page/scrolling/AsyncScrollingCoordinator.cpp:
+        (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
+        (WebCore::AsyncScrollingCoordinator::reconcileScrollingState):
+        (WebCore::AsyncScrollingCoordinator::visualViewportEnabled const): Deleted.
+        * page/scrolling/AsyncScrollingCoordinator.h:
+        * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
+        (WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
+        (WebCore::ScrollingStateFrameScrollingNode::setAllPropertiesChanged):
+        (WebCore::ScrollingStateFrameScrollingNode::dumpProperties const):
+        (WebCore::ScrollingStateFrameScrollingNode::setVisualViewportEnabled): Deleted.
+        * page/scrolling/ScrollingStateFrameScrollingNode.h:
+        * page/scrolling/ScrollingTree.cpp:
+        (WebCore::ScrollingTree::commitTreeState):
+        * page/scrolling/ScrollingTree.h:
+        (WebCore::ScrollingTree::visualViewportEnabled const): Deleted.
+        (WebCore::ScrollingTree::setVisualViewportEnabled): Deleted.
+        * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
+        (WebCore::ScrollingTreeFrameScrollingNode::layoutViewportForScrollPosition const):
+        * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
+        (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollPositionWithoutContentEdgeConstraints):
+        (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollLayerPosition):
+
 2019-02-21  Darin Adler  <darin@apple.com>
 
         Some refinements for Node and Document
index 54585be..303d7f8 100644 (file)
@@ -571,7 +571,7 @@ layoutViewportHeightExpansionFactor:
 
 # Runtime-enabled features
 visualViewportEnabled:
-  initial: false
+  initial: true
   onChange: setNeedsRecalcStyleInAllFrames
 
 visualViewportAPIEnabled:
index 537c0d0..0585ab6 100644 (file)
@@ -145,7 +145,6 @@ void AsyncScrollingCoordinator::frameViewLayoutUpdated(FrameView& frameView)
     frameScrollingNode.setFooterHeight(frameView.footerHeight());
     frameScrollingNode.setTopContentInset(frameView.topContentInset());
 
-    frameScrollingNode.setVisualViewportEnabled(visualViewportEnabled());
     frameScrollingNode.setLayoutViewport(frameView.layoutViewportRect());
     frameScrollingNode.setAsyncFrameOrOverflowScrollingEnabled(asyncFrameOrOverflowScrollingEnabled());
 
@@ -387,17 +386,13 @@ void AsyncScrollingCoordinator::reconcileScrollingState(FrameView& frameView, co
         [&frameView](Optional<FloatPoint> origin) {
             if (origin)
                 frameView.setBaseLayoutViewportOrigin(LayoutPoint(origin.value()), FrameView::TriggerLayoutOrNot::No);
-        }, [&frameView, &layoutViewportRect, viewportRectStability, visualViewportEnabled = visualViewportEnabled()](Optional<FloatRect> overrideRect) {
+        }, [&frameView, &layoutViewportRect, viewportRectStability](Optional<FloatRect> overrideRect) {
             if (!overrideRect)
                 return;
 
             layoutViewportRect = overrideRect;
-            if (visualViewportEnabled && viewportRectStability != ViewportRectStability::ChangingObscuredInsetsInteractively)
+            if (viewportRectStability != ViewportRectStability::ChangingObscuredInsetsInteractively)
                 frameView.setLayoutViewportOverrideRect(LayoutRect(overrideRect.value()), viewportRectStability == ViewportRectStability::Stable ? FrameView::TriggerLayoutOrNot::Yes : FrameView::TriggerLayoutOrNot::No);
-#if PLATFORM(IOS_FAMILY)
-            else if (viewportRectStability == ViewportRectStability::Stable)
-                frameView.setCustomFixedPositionLayoutRect(enclosingIntRect(overrideRect.value()));
-#endif
         }
     );
 
@@ -696,11 +691,6 @@ void AsyncScrollingCoordinator::setScrollPinningBehavior(ScrollPinningBehavior p
     scrollingTree()->setScrollPinningBehavior(pinning);
 }
 
-bool AsyncScrollingCoordinator::visualViewportEnabled() const
-{
-    return m_page->mainFrame().settings().visualViewportEnabled();
-}
-
 bool AsyncScrollingCoordinator::asyncFrameOrOverflowScrollingEnabled() const
 {
     auto& settings = m_page->mainFrame().settings();
index 104cc82..aaba5e1 100644 (file)
@@ -89,7 +89,6 @@ private:
 
     bool hasVisibleSlowRepaintViewportConstrainedObjects(const FrameView&) const override { return false; }
     
-    bool visualViewportEnabled() const;
     bool asyncFrameOrOverflowScrollingEnabled() const;
 
     WEBCORE_EXPORT void frameViewLayoutUpdated(FrameView&) override;
index 01961fc..d9b50bd 100644 (file)
@@ -63,7 +63,6 @@ ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode(const Scrolli
     , m_behaviorForFixed(stateNode.scrollBehaviorForFixedElements())
     , m_requestedScrollPositionRepresentsProgrammaticScroll(stateNode.requestedScrollPositionRepresentsProgrammaticScroll())
     , m_fixedElementsLayoutRelativeToFrame(stateNode.fixedElementsLayoutRelativeToFrame())
-    , m_visualViewportEnabled(stateNode.visualViewportEnabled())
     , m_asyncFrameOrOverflowScrollingEnabled(stateNode.asyncFrameOrOverflowScrollingEnabled())
 {
     if (hasChangedProperty(RootContentsLayer))
@@ -118,7 +117,6 @@ void ScrollingStateFrameScrollingNode::setAllPropertiesChanged()
     setPropertyChangedBit(BehaviorForFixedElements);
     setPropertyChangedBit(TopContentInset);
     setPropertyChangedBit(FixedElementsLayoutRelativeToFrame);
-    setPropertyChangedBit(VisualViewportEnabled);
     setPropertyChangedBit(AsyncFrameOrOverflowScrollingEnabled);
     setPropertyChangedBit(LayoutViewport);
     setPropertyChangedBit(MinLayoutViewportOrigin);
@@ -299,16 +297,6 @@ void ScrollingStateFrameScrollingNode::setFixedElementsLayoutRelativeToFrame(boo
     setPropertyChanged(FixedElementsLayoutRelativeToFrame);
 }
 
-// Only needed while visual viewports are runtime-switchable.
-void ScrollingStateFrameScrollingNode::setVisualViewportEnabled(bool visualViewportEnabled)
-{
-    if (visualViewportEnabled == m_visualViewportEnabled)
-        return;
-    
-    m_visualViewportEnabled = visualViewportEnabled;
-    setPropertyChanged(VisualViewportEnabled);
-}
-
 void ScrollingStateFrameScrollingNode::setAsyncFrameOrOverflowScrollingEnabled(bool enabled)
 {
     if (enabled == m_asyncFrameOrOverflowScrollingEnabled)
@@ -348,12 +336,9 @@ void ScrollingStateFrameScrollingNode::dumpProperties(TextStream& ts, ScrollingS
     if (m_footerHeight)
         ts.dumpProperty("footer height", m_footerHeight);
     
-    if (m_visualViewportEnabled) {
-        ts.dumpProperty("visual viewport enabled", m_visualViewportEnabled);
-        ts.dumpProperty("layout viewport", m_layoutViewport);
-        ts.dumpProperty("min layout viewport origin", m_minLayoutViewportOrigin);
-        ts.dumpProperty("max layout viewport origin", m_maxLayoutViewportOrigin);
-    }
+    ts.dumpProperty("layout viewport", m_layoutViewport);
+    ts.dumpProperty("min layout viewport origin", m_minLayoutViewportOrigin);
+    ts.dumpProperty("max layout viewport origin", m_maxLayoutViewportOrigin);
     
     if (m_behaviorForFixed == StickToViewportBounds)
         ts.dumpProperty("behavior for fixed", m_behaviorForFixed);
index 99dcb3d..cf98d04 100644 (file)
@@ -64,7 +64,6 @@ public:
         BehaviorForFixedElements,
         TopContentInset,
         FixedElementsLayoutRelativeToFrame,
-        VisualViewportEnabled,
         AsyncFrameOrOverflowScrollingEnabled,
         LayoutViewport,
         MinLayoutViewportOrigin,
@@ -136,9 +135,6 @@ public:
     bool fixedElementsLayoutRelativeToFrame() const { return m_fixedElementsLayoutRelativeToFrame; }
     WEBCORE_EXPORT void setFixedElementsLayoutRelativeToFrame(bool);
 
-    bool visualViewportEnabled() const { return m_visualViewportEnabled; };
-    WEBCORE_EXPORT void setVisualViewportEnabled(bool);
-
     bool asyncFrameOrOverflowScrollingEnabled() const { return m_asyncFrameOrOverflowScrollingEnabled; }
     void setAsyncFrameOrOverflowScrollingEnabled(bool);
 
@@ -185,7 +181,6 @@ private:
     ScrollBehaviorForFixedElements m_behaviorForFixed { StickToDocumentBounds };
     bool m_requestedScrollPositionRepresentsProgrammaticScroll { false };
     bool m_fixedElementsLayoutRelativeToFrame { false };
-    bool m_visualViewportEnabled { false };
     bool m_asyncFrameOrOverflowScrollingEnabled { false };
 };
 
index 1735b97..19d4a98 100644 (file)
@@ -155,7 +155,6 @@ void ScrollingTree::commitTreeState(std::unique_ptr<ScrollingStateTree> scrollin
         && (rootStateNodeChanged
             || rootNode->hasChangedProperty(ScrollingStateFrameScrollingNode::EventTrackingRegion)
             || rootNode->hasChangedProperty(ScrollingStateScrollingNode::ScrolledContentsLayer)
-            || rootNode->hasChangedProperty(ScrollingStateFrameScrollingNode::VisualViewportEnabled)
             || rootNode->hasChangedProperty(ScrollingStateFrameScrollingNode::AsyncFrameOrOverflowScrollingEnabled))) {
         LockHolder lock(m_mutex);
 
@@ -165,9 +164,6 @@ void ScrollingTree::commitTreeState(std::unique_ptr<ScrollingStateTree> scrollin
         if (rootStateNodeChanged || rootNode->hasChangedProperty(ScrollingStateFrameScrollingNode::EventTrackingRegion))
             m_eventTrackingRegions = scrollingStateTree->rootStateNode()->eventTrackingRegions();
 
-        if (rootStateNodeChanged || rootNode->hasChangedProperty(ScrollingStateFrameScrollingNode::VisualViewportEnabled))
-            m_visualViewportEnabled = scrollingStateTree->rootStateNode()->visualViewportEnabled();
-
         if (rootStateNodeChanged || rootNode->hasChangedProperty(ScrollingStateFrameScrollingNode::AsyncFrameOrOverflowScrollingEnabled))
             m_asyncFrameOrOverflowScrollingEnabled = scrollingStateTree->rootStateNode()->asyncFrameOrOverflowScrollingEnabled();
     }
index d937853..68ba220 100644 (file)
@@ -54,8 +54,6 @@ public:
     virtual bool isRemoteScrollingTree() const { return false; }
     virtual bool isScrollingTreeIOS() const { return false; }
 
-    bool visualViewportEnabled() const { return m_visualViewportEnabled; }
-
     // This implies that we'll do hit-testing in the scrolling tree.
     bool asyncFrameOrOverflowScrollingEnabled() const { return m_asyncFrameOrOverflowScrollingEnabled; }
     void setAsyncFrameOrOverflowScrollingEnabled(bool);
@@ -156,7 +154,6 @@ public:
     
 protected:
     void setMainFrameScrollPosition(FloatPoint);
-    void setVisualViewportEnabled(bool b) { m_visualViewportEnabled = b; }
 
     WEBCORE_EXPORT virtual ScrollingEventResult handleWheelEvent(const PlatformWheelEvent&);
 
@@ -193,7 +190,6 @@ private:
     bool m_mainFrameIsScrollSnapping { false };
     bool m_scrollingPerformanceLoggingEnabled { false };
     bool m_isHandlingProgrammaticScroll { false };
-    bool m_visualViewportEnabled { false };
     bool m_asyncFrameOrOverflowScrollingEnabled { false };
 };
     
index 258bb93..8509c46 100644 (file)
@@ -90,8 +90,6 @@ void ScrollingTreeFrameScrollingNode::setScrollPosition(const FloatPoint& scroll
 
 FloatRect ScrollingTreeFrameScrollingNode::layoutViewportForScrollPosition(const FloatPoint& visibleContentOrigin, float scale) const
 {
-    ASSERT(scrollingTree().visualViewportEnabled());
-
     FloatRect visibleContentRect(visibleContentOrigin, scrollableAreaSize());
     LayoutRect visualViewport(FrameView::visibleDocumentRect(visibleContentRect, headerHeight(), footerHeight(), totalContentsSize(), scale));
     LayoutRect layoutViewport(m_layoutViewport);
index 1bed757..c731fd8 100644 (file)
@@ -244,13 +244,11 @@ void ScrollingTreeFrameScrollingNodeMac::setScrollPositionWithoutContentEdgeCons
 {
     updateMainFramePinState(scrollPosition);
 
-    Optional<FloatPoint> layoutViewportOrigin;
-    if (scrollingTree().visualViewportEnabled()) {
-        FloatPoint visibleContentOrigin = scrollPosition;
-        FloatRect newLayoutViewport = layoutViewportForScrollPosition(visibleContentOrigin, frameScaleFactor());
-        setLayoutViewport(newLayoutViewport);
-        layoutViewportOrigin = newLayoutViewport.location();
-    }
+    Optional<FloatPoint> layoutViewportOrigin; // FIXME
+    FloatPoint visibleContentOrigin = scrollPosition;
+    FloatRect newLayoutViewport = layoutViewportForScrollPosition(visibleContentOrigin, frameScaleFactor());
+    setLayoutViewport(newLayoutViewport);
+    layoutViewportOrigin = newLayoutViewport.location();
 
     if (shouldUpdateScrollLayerPositionSynchronously()) {
         m_probableMainThreadScrollPosition = scrollPosition;
@@ -269,22 +267,9 @@ void ScrollingTreeFrameScrollingNodeMac::setScrollLayerPosition(const FloatPoint
     scrolledContentsLayer().position = -position;
 
     FloatRect visibleContentRect(position, scrollableAreaSize());
-    FloatRect fixedPositionRect;
-    ScrollBehaviorForFixedElements behaviorForFixed = StickToViewportBounds;
-
-    if (scrollingTree().visualViewportEnabled())
-        fixedPositionRect = layoutViewport;
-    else {
-        behaviorForFixed = scrollBehaviorForFixedElements();
-        
-        FloatPoint scrollPositionForFixedChildren = FrameView::scrollPositionForFixedPosition(enclosingLayoutRect(visibleContentRect), LayoutSize(totalContentsSize()),
-            LayoutPoint(position), scrollOrigin(), frameScaleFactor(), fixedElementsLayoutRelativeToFrame(), behaviorForFixed, headerHeight(), footerHeight());
-
-        fixedPositionRect = { scrollPositionForFixedChildren, visibleContentRect.size() };
-    }
-    
+
     if (m_counterScrollingLayer)
-        m_counterScrollingLayer.get().position = fixedPositionRect.location();
+        m_counterScrollingLayer.get().position = layoutViewport.location();
 
     float topContentInset = this->topContentInset();
     if (m_insetClipLayer && m_rootContentsLayer && topContentInset) {
@@ -297,13 +282,8 @@ void ScrollingTreeFrameScrollingNodeMac::setScrollLayerPosition(const FloatPoint
     if (m_headerLayer || m_footerLayer) {
         // Generally the banners should have the same horizontal-position computation as a fixed element. However,
         // the banners are not affected by the frameScaleFactor(), so if there is currently a non-1 frameScaleFactor()
-        // then we should recompute fixedPositionRect.x() for the banner with a scale factor of 1.
-        float horizontalScrollOffsetForBanner = fixedPositionRect.x();
-        if (!scrollingTree().visualViewportEnabled() && frameScaleFactor() != 1) {
-            horizontalScrollOffsetForBanner = FrameView::scrollPositionForFixedPosition(enclosingLayoutRect(visibleContentRect), LayoutSize(totalContentsSize()),
-                LayoutPoint(position), scrollOrigin(), 1, fixedElementsLayoutRelativeToFrame(), behaviorForFixed, headerHeight(), footerHeight()).x();
-        }
-
+        // then we should recompute layoutViewport.x() for the banner with a scale factor of 1.
+        float horizontalScrollOffsetForBanner = layoutViewport.x();
         if (m_headerLayer)
             m_headerLayer.get().position = FloatPoint(horizontalScrollOffsetForBanner, FrameView::yPositionForHeaderLayer(position, topContentInset));
 
@@ -337,7 +317,7 @@ void ScrollingTreeFrameScrollingNodeMac::setScrollLayerPosition(const FloatPoint
         return;
 
     for (auto& child : *m_children)
-        child->updateLayersAfterAncestorChange(*this, fixedPositionRect, FloatSize());
+        child->updateLayersAfterAncestorChange(*this, layoutViewport, FloatSize());
 }
 
 void ScrollingTreeFrameScrollingNodeMac::updateLayersAfterViewportChange(const FloatRect&, double)
index bc5d4b1..cdeef16 100644 (file)
@@ -1,3 +1,49 @@
+2019-02-21  Simon Fraser  <simon.fraser@apple.com>
+
+        Hardcode Visual Viewports on everywhere except iOS WK1
+        https://bugs.webkit.org/show_bug.cgi?id=194928
+
+        Reviewed by Zalan Bujtas.
+
+        Remove the WK1 and WK2 preferences and MiniBrowser menu item for "visual viewports",
+        change the default value of the Setting to 'true', and hardcode WebView on iOS to
+        set it to false. The setting has shipped for several years and there's no need to turn
+        it off now.
+
+        Similarly, disable the "Visual Viewport API" on iOS WK1, since it makes no sense if
+        Visual Viewports are not enabled.
+        
+        Remove the "visualViewportEnabled" flag and unused code paths from scrolling tree code
+        that only runs in WK2
+
+        * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
+        (ArgumentCoder<ScrollingStateFrameScrollingNode>::encode):
+        (ArgumentCoder<ScrollingStateFrameScrollingNode>::decode):
+        * Shared/WebPreferences.yaml:
+        * UIProcess/API/Cocoa/WKPreferences.mm:
+        (-[WKPreferences _visualViewportEnabled]): Deleted.
+        (-[WKPreferences _setVisualViewportEnabled:]): Deleted.
+        * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
+        * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
+        (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
+        * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
+        (WebKit::RemoteScrollingCoordinatorProxy::visualViewportEnabled const): Deleted.
+        * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
+        (WebKit::RemoteScrollingCoordinatorProxy::customFixedPositionRect const):
+        * UIProcess/WebPageProxy.h:
+        * UIProcess/ios/WKContentView.mm:
+        (-[WKContentView didUpdateVisibleRect:unobscuredRect:contentInsets:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
+        * UIProcess/ios/WebPageProxyIOS.mm:
+        (WebKit::WebPageProxy::computeCustomFixedPositionRect const):
+        * WebProcess/Automation/WebAutomationSessionProxy.cpp:
+        (WebKit::WebAutomationSessionProxy::computeElementLayout):
+        * WebProcess/InjectedBundle/InjectedBundle.cpp:
+        (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
+        * WebProcess/WebPage/ios/WebPageIOS.mm:
+        (WebKit::WebPage::getFocusedElementInformation):
+        (WebKit::WebPage::dynamicViewportSizeUpdate):
+        (WebKit::WebPage::updateVisibleContentRects):
+
 2019-02-21  Carlos Garcia Campos  <cgarcia@igalia.com>
 
         [GTK] Epiphany searching for plugins even if plugins are disabled
index 4946691..0b2faf1 100644 (file)
@@ -159,7 +159,6 @@ void ArgumentCoder<ScrollingStateFrameScrollingNode>::encode(Encoder& encoder, c
     SCROLLING_NODE_ENCODE(ScrollingStateFrameScrollingNode::FooterHeight, footerHeight)
     SCROLLING_NODE_ENCODE(ScrollingStateFrameScrollingNode::TopContentInset, topContentInset)
     SCROLLING_NODE_ENCODE(ScrollingStateFrameScrollingNode::FixedElementsLayoutRelativeToFrame, fixedElementsLayoutRelativeToFrame)
-    SCROLLING_NODE_ENCODE(ScrollingStateFrameScrollingNode::VisualViewportEnabled, visualViewportEnabled)
     // AsyncFrameOrOverflowScrollingEnabled is not relevant for UI-side compositing.
     SCROLLING_NODE_ENCODE(ScrollingStateFrameScrollingNode::LayoutViewport, layoutViewport)
     SCROLLING_NODE_ENCODE(ScrollingStateFrameScrollingNode::MinLayoutViewportOrigin, minLayoutViewportOrigin)
@@ -274,7 +273,6 @@ bool ArgumentCoder<ScrollingStateFrameScrollingNode>::decode(Decoder& decoder, S
     SCROLLING_NODE_DECODE(ScrollingStateFrameScrollingNode::FooterHeight, int, setFooterHeight);
     SCROLLING_NODE_DECODE(ScrollingStateFrameScrollingNode::TopContentInset, float, setTopContentInset);
     SCROLLING_NODE_DECODE(ScrollingStateFrameScrollingNode::FixedElementsLayoutRelativeToFrame, bool, setFixedElementsLayoutRelativeToFrame);
-    SCROLLING_NODE_DECODE(ScrollingStateFrameScrollingNode::VisualViewportEnabled, bool, setVisualViewportEnabled)
     SCROLLING_NODE_DECODE(ScrollingStateFrameScrollingNode::LayoutViewport, FloatRect, setLayoutViewport)
     SCROLLING_NODE_DECODE(ScrollingStateFrameScrollingNode::MinLayoutViewportOrigin, FloatPoint, setMinLayoutViewportOrigin)
     SCROLLING_NODE_DECODE(ScrollingStateFrameScrollingNode::MaxLayoutViewportOrigin, FloatPoint, setMaxLayoutViewportOrigin)
index 74a122c..b9084be 100644 (file)
@@ -672,10 +672,6 @@ ApplePayCapabilityDisclosureAllowed:
   defaultValue: true
   condition: ENABLE(APPLE_PAY)
 
-VisualViewportEnabled:
-  type: bool
-  defaultValue: true
-
 LayoutViewportHeightExpansionFactor:
   type: double
   defaultValue: DEFAULT_VISUAL_VIEWPORT_HEIGHT_EXPANSION_FACTOR
index 337996b..a0cd2e2 100644 (file)
@@ -357,16 +357,6 @@ static _WKStorageBlockingPolicy toAPI(WebCore::SecurityOrigin::StorageBlockingPo
     _preferences->setDisplayListDrawingEnabled(displayListDrawingEnabled);
 }
 
-- (BOOL)_visualViewportEnabled
-{
-    return _preferences->visualViewportEnabled();
-}
-
-- (void)_setVisualViewportEnabled:(BOOL)_visualViewportEnabled
-{
-    _preferences->setVisualViewportEnabled(_visualViewportEnabled);
-}
-
 - (BOOL)_largeImageAsyncDecodingEnabled
 {
     return _preferences->largeImageAsyncDecodingEnabled();
index 87d0c7f..61da8b8 100644 (file)
@@ -76,7 +76,6 @@ typedef NS_ENUM(NSInteger, _WKEditableLinkBehavior) {
 @property (nonatomic, setter=_setSimpleLineLayoutDebugBordersEnabled:) BOOL _simpleLineLayoutDebugBordersEnabled WK_API_AVAILABLE(macosx(10.11), ios(9.0));
 @property (nonatomic, setter=_setAcceleratedDrawingEnabled:) BOOL _acceleratedDrawingEnabled WK_API_AVAILABLE(macosx(10.12), ios(10.0));
 @property (nonatomic, setter=_setDisplayListDrawingEnabled:) BOOL _displayListDrawingEnabled WK_API_AVAILABLE(macosx(10.12), ios(10.0));
-@property (nonatomic, setter=_setVisualViewportEnabled:) BOOL _visualViewportEnabled WK_API_AVAILABLE(macosx(10.12.3), ios(10.3));
 @property (nonatomic, setter=_setLargeImageAsyncDecodingEnabled:) BOOL _largeImageAsyncDecodingEnabled WK_API_AVAILABLE(macosx(10.12.3), ios(10.3));
 @property (nonatomic, setter=_setAnimatedImageAsyncDecodingEnabled:) BOOL _animatedImageAsyncDecodingEnabled WK_API_AVAILABLE(macosx(10.12.3), ios(10.3));
 @property (nonatomic, setter=_setTextAutosizingEnabled:) BOOL _textAutosizingEnabled WK_API_AVAILABLE(macosx(10.12), ios(10.0));
index a380a50..51a6fa7 100644 (file)
@@ -220,7 +220,7 @@ void RemoteLayerTreeDrawingAreaProxy::commitLayerTree(const RemoteLayerTreeTrans
 #if PLATFORM(IOS_FAMILY)
     if (m_webPageProxy.scrollingCoordinatorProxy()->hasFixedOrSticky()) {
         // If we got a new layer for a fixed or sticky node, its position from the WebProcess is probably stale. We need to re-run the "viewport" changed logic to udpate it with our UI-side state.
-        FloatRect customFixedPositionRect = m_webPageProxy.computeCustomFixedPositionRect(m_webPageProxy.unobscuredContentRect(), m_webPageProxy.unobscuredContentRectRespectingInputViewBounds(), m_webPageProxy.customFixedPositionRect(), m_webPageProxy.displayedContentScale(), FrameView::LayoutViewportConstraint::Unconstrained, m_webPageProxy.scrollingCoordinatorProxy()->visualViewportEnabled());
+        FloatRect customFixedPositionRect = m_webPageProxy.computeCustomFixedPositionRect(m_webPageProxy.unobscuredContentRect(), m_webPageProxy.unobscuredContentRectRespectingInputViewBounds(), m_webPageProxy.customFixedPositionRect(), m_webPageProxy.displayedContentScale(), FrameView::LayoutViewportConstraint::Unconstrained);
         m_webPageProxy.scrollingCoordinatorProxy()->viewportChangedViaDelegatedScrolling(m_webPageProxy.scrollingCoordinatorProxy()->rootScrollingNodeID(), customFixedPositionRect, m_webPageProxy.displayedContentScale());
     }
 #endif
index 0a30709..e5e46ad 100644 (file)
@@ -51,8 +51,6 @@ public:
     explicit RemoteScrollingCoordinatorProxy(WebPageProxy&);
     virtual ~RemoteScrollingCoordinatorProxy();
 
-    bool visualViewportEnabled() const { return m_scrollingTree && m_scrollingTree->visualViewportEnabled(); }
-
     // Inform the web process that the scroll position changed (called from the scrolling tree)
     void scrollingTreeNodeDidScroll(WebCore::ScrollingNodeID, const WebCore::FloatPoint& newScrollPosition, const Optional<WebCore::FloatPoint>& layoutViewportOrigin, WebCore::ScrollingLayerPositionAction);
     void scrollingTreeNodeRequestsScroll(WebCore::ScrollingNodeID, const WebCore::FloatPoint& scrollPosition, bool representsProgrammaticScroll);
index 9025269..5d4da04 100644 (file)
@@ -96,7 +96,7 @@ void RemoteScrollingCoordinatorProxy::connectStateNodeLayers(ScrollingStateTree&
 FloatRect RemoteScrollingCoordinatorProxy::customFixedPositionRect() const
 {
     return m_webPageProxy.computeCustomFixedPositionRect(m_webPageProxy.unobscuredContentRect(), m_webPageProxy.unobscuredContentRectRespectingInputViewBounds(), m_webPageProxy.customFixedPositionRect(),
-        m_webPageProxy.displayedContentScale(), FrameView::LayoutViewportConstraint::Unconstrained, visualViewportEnabled());
+        m_webPageProxy.displayedContentScale(), FrameView::LayoutViewportConstraint::Unconstrained);
 }
 
 void RemoteScrollingCoordinatorProxy::scrollingTreeNodeWillStartPanGesture()
index faaa5b7..70e81d5 100644 (file)
@@ -615,7 +615,7 @@ public:
     void updateVisibleContentRects(const VisibleContentRectUpdateInfo&);
     void resendLastVisibleContentRects();
 
-    WebCore::FloatRect computeCustomFixedPositionRect(const WebCore::FloatRect& unobscuredContentRect, const WebCore::FloatRect& unobscuredContentRectRespectingInputViewBounds, const WebCore::FloatRect& currentCustomFixedPositionRect, double displayedContentScale, WebCore::FrameView::LayoutViewportConstraint = WebCore::FrameView::LayoutViewportConstraint::Unconstrained, bool visualViewportEnabled = false) const;
+    WebCore::FloatRect computeCustomFixedPositionRect(const WebCore::FloatRect& unobscuredContentRect, const WebCore::FloatRect& unobscuredContentRectRespectingInputViewBounds, const WebCore::FloatRect& currentCustomFixedPositionRect, double displayedContentScale, WebCore::FrameView::LayoutViewportConstraint = WebCore::FrameView::LayoutViewportConstraint::Unconstrained) const;
 
     void scrollingNodeScrollViewWillStartPanGesture();
     void scrollingNodeScrollViewDidScroll();
index 304c23f..ce12221 100644 (file)
@@ -405,7 +405,7 @@ static WebCore::FloatBoxExtent floatBoxExtent(UIEdgeInsets insets)
     WebKit::RemoteScrollingCoordinatorProxy* scrollingCoordinator = _page->scrollingCoordinatorProxy();
 
     CGRect unobscuredContentRectRespectingInputViewBounds = [self _computeUnobscuredContentRectRespectingInputViewBounds:unobscuredContentRect inputViewBounds:inputViewBounds];
-    WebCore::FloatRect fixedPositionRectForLayout = _page->computeCustomFixedPositionRect(unobscuredContentRect, unobscuredContentRectRespectingInputViewBounds, _page->customFixedPositionRect(), zoomScale, WebCore::FrameView::LayoutViewportConstraint::ConstrainedToDocumentRect, scrollingCoordinator->visualViewportEnabled());
+    WebCore::FloatRect fixedPositionRectForLayout = _page->computeCustomFixedPositionRect(unobscuredContentRect, unobscuredContentRectRespectingInputViewBounds, _page->customFixedPositionRect(), zoomScale, WebCore::FrameView::LayoutViewportConstraint::ConstrainedToDocumentRect);
 
     WebKit::VisibleContentRectUpdateInfo visibleContentRectUpdateInfo(
         visibleContentRect,
@@ -435,7 +435,7 @@ static WebCore::FloatBoxExtent floatBoxExtent(UIEdgeInsets insets)
 
     _sizeChangedSinceLastVisibleContentRectUpdate = NO;
 
-    WebCore::FloatRect fixedPositionRect = _page->computeCustomFixedPositionRect(_page->unobscuredContentRect(), _page->unobscuredContentRectRespectingInputViewBounds(), _page->customFixedPositionRect(), zoomScale, WebCore::FrameView::LayoutViewportConstraint::Unconstrained, scrollingCoordinator->visualViewportEnabled());
+    WebCore::FloatRect fixedPositionRect = _page->computeCustomFixedPositionRect(_page->unobscuredContentRect(), _page->unobscuredContentRectRespectingInputViewBounds(), _page->customFixedPositionRect(), zoomScale, WebCore::FrameView::LayoutViewportConstraint::Unconstrained);
     scrollingCoordinator->viewportChangedViaDelegatedScrolling(scrollingCoordinator->rootScrollingNodeID(), fixedPositionRect, zoomScale);
 
     drawingArea->updateDebugIndicator();
index e5006ed..ffe3995 100644 (file)
@@ -253,14 +253,11 @@ static inline float adjustedUnexposedMaxEdge(float documentEdge, float exposedRe
 }
 
 // FIXME: rename this when visual viewports are the default.
-WebCore::FloatRect WebPageProxy::computeCustomFixedPositionRect(const FloatRect& unobscuredContentRect, const FloatRect& unobscuredContentRectRespectingInputViewBounds, const FloatRect& currentCustomFixedPositionRect, double displayedContentScale, FrameView::LayoutViewportConstraint constraint, bool visualViewportEnabled) const
+WebCore::FloatRect WebPageProxy::computeCustomFixedPositionRect(const FloatRect& unobscuredContentRect, const FloatRect& unobscuredContentRectRespectingInputViewBounds, const FloatRect& currentCustomFixedPositionRect, double displayedContentScale, FrameView::LayoutViewportConstraint constraint) const
 {
     FloatRect constrainedUnobscuredRect = unobscuredContentRect;
     FloatRect documentRect = pageClient().documentRect();
 
-    if (!visualViewportEnabled && pageClient().isFocusingElement())
-        return documentRect;
-
     if (constraint == FrameView::LayoutViewportConstraint::ConstrainedToDocumentRect)
         constrainedUnobscuredRect.intersect(documentRect);
 
@@ -276,9 +273,6 @@ WebCore::FloatRect WebPageProxy::computeCustomFixedPositionRect(const FloatRect&
         constrainedUnobscuredRect.setHeight(adjustedUnexposedMaxEdge(documentRect.maxY(), constrainedUnobscuredRect.maxY(), factor) - constrainedUnobscuredRect.y());
     }
 
-    if (!visualViewportEnabled)
-        return FrameView::rectForViewportConstrainedObjects(enclosingLayoutRect(constrainedUnobscuredRect), LayoutSize(documentRect.size()), displayedContentScale, false, StickToViewportBounds);
-        
     FloatSize constrainedSize = isBelowMinimumScale ? constrainedUnobscuredRect.size() : unobscuredContentRect.size();
     FloatRect unobscuredContentRectForViewport = isBelowMinimumScale ? constrainedUnobscuredRect : unobscuredContentRectRespectingInputViewBounds;
 
index 39461ad..8a5d414 100644 (file)
@@ -578,10 +578,7 @@ void WebAutomationSessionProxy::computeElementLayout(uint64_t pageID, uint64_t f
         break;
     case CoordinateSystem::LayoutViewport:
         // The element bounds are already in client coordinates.
-        if (frame->coreFrame()->settings().visualViewportEnabled())
-            resultElementBounds = WebCore::IntRect(mainView->clientToLayoutViewportRect(WebCore::FloatRect(rootElementBounds)));
-        else
-            resultElementBounds = rootElementBounds;
+        resultElementBounds = WebCore::IntRect(mainView->clientToLayoutViewportRect(WebCore::FloatRect(rootElementBounds)));
         break;
     }
 
@@ -597,10 +594,7 @@ void WebAutomationSessionProxy::computeElementLayout(uint64_t pageID, uint64_t f
                 break;
             case CoordinateSystem::LayoutViewport:
                 // The point is already in client coordinates.
-                if (frame->coreFrame()->settings().visualViewportEnabled())
-                    resultInViewCenterPoint = WebCore::IntPoint(mainView->clientToLayoutViewportPoint(rootInViewCenterPoint));
-                else
-                    resultInViewCenterPoint = rootInViewCenterPoint;
+                resultInViewCenterPoint = WebCore::IntPoint(mainView->clientToLayoutViewportPoint(rootInViewCenterPoint));
                 break;
             }
         }
index 1dbbdcf..9eecbe2 100644 (file)
@@ -281,7 +281,6 @@ void InjectedBundle::overrideBoolPreferenceForTestRunner(WebPageGroupProxy* page
     macro(WebKitXSSAuditorEnabled, XSSAuditorEnabled, xssAuditorEnabled) \
     macro(WebKitShouldRespectImageOrientation, ShouldRespectImageOrientation, shouldRespectImageOrientation) \
     macro(WebKitDisplayImagesKey, LoadsImagesAutomatically, loadsImagesAutomatically) \
-    macro(WebKitVisualViewportEnabled, VisualViewportEnabled, visualViewportEnabled) \
     macro(WebKitLargeImageAsyncDecodingEnabled, LargeImageAsyncDecodingEnabled, largeImageAsyncDecodingEnabled) \
     macro(WebKitAnimatedImageAsyncDecodingEnabled, AnimatedImageAsyncDecodingEnabled, animatedImageAsyncDecodingEnabled) \
     \
index e15e79b..50f85c1 100644 (file)
@@ -2401,14 +2401,6 @@ void WebPage::getFocusedElementInformation(FocusedElementInformation& informatio
         renderer->localToContainerPoint(FloatPoint(), nullptr, UseTransforms, &inFixed);
         information.insideFixedPosition = inFixed;
         information.isRTL = renderer->style().direction() == TextDirection::RTL;
-
-        auto* frameView = elementFrame.view();
-        if (inFixed && elementFrame.isMainFrame() && !frameView->frame().settings().visualViewportEnabled()) {
-            IntRect currentFixedPositionRect = frameView->customFixedPositionLayoutRect();
-            frameView->setCustomFixedPositionLayoutRect(frameView->renderView()->documentRect());
-            information.elementRect = frameView->contentsToRootView(renderer->absoluteBoundingBoxRect());
-            frameView->setCustomFixedPositionLayoutRect(currentFixedPositionRect);
-        }
     } else
         information.elementRect = IntRect();
 
@@ -2781,15 +2773,10 @@ void WebPage::dynamicViewportSizeUpdate(const FloatSize& viewLayoutSize, const W
     frameView.updateLayoutAndStyleIfNeededRecursive();
 
     auto& settings = frameView.frame().settings();
-    if (settings.visualViewportEnabled()) {
-        LayoutRect documentRect = IntRect(frameView.scrollOrigin(), frameView.contentsSize());
-        auto layoutViewportSize = FrameView::expandedLayoutViewportSize(frameView.baseLayoutViewportSize(), LayoutSize(documentRect.size()), settings.layoutViewportHeightExpansionFactor());
-        LayoutRect layoutViewportRect = FrameView::computeUpdatedLayoutViewportRect(frameView.layoutViewportRect(), documentRect, LayoutSize(newUnobscuredContentRect.size()), LayoutRect(newUnobscuredContentRect), layoutViewportSize, frameView.minStableLayoutViewportOrigin(), frameView.maxStableLayoutViewportOrigin(), FrameView::LayoutViewportConstraint::ConstrainedToDocumentRect);
-        frameView.setLayoutViewportOverrideRect(layoutViewportRect);
-    } else {
-        IntRect fixedPositionLayoutRect = enclosingIntRect(frameView.viewportConstrainedObjectsRect());
-        frameView.setCustomFixedPositionLayoutRect(fixedPositionLayoutRect);
-    }
+    LayoutRect documentRect = IntRect(frameView.scrollOrigin(), frameView.contentsSize());
+    auto layoutViewportSize = FrameView::expandedLayoutViewportSize(frameView.baseLayoutViewportSize(), LayoutSize(documentRect.size()), settings.layoutViewportHeightExpansionFactor());
+    LayoutRect layoutViewportRect = FrameView::computeUpdatedLayoutViewportRect(frameView.layoutViewportRect(), documentRect, LayoutSize(newUnobscuredContentRect.size()), LayoutRect(newUnobscuredContentRect), layoutViewportSize, frameView.minStableLayoutViewportOrigin(), frameView.maxStableLayoutViewportOrigin(), FrameView::LayoutViewportConstraint::ConstrainedToDocumentRect);
+    frameView.setLayoutViewportOverrideRect(layoutViewportRect);
 
     frameView.setCustomSizeForResizeEvent(expandedIntSize(targetUnobscuredRectInScrollViewCoordinates.size()));
     setDeviceOrientation(deviceOrientation);
@@ -3053,23 +3040,20 @@ void WebPage::updateVisibleContentRects(const VisibleContentRectUpdateInfo& visi
     frameView.setScrollVelocity(horizontalVelocity, verticalVelocity, scaleChangeRate, visibleContentRectUpdateInfo.timestamp());
 
     if (m_isInStableState) {
-        if (frameView.frame().settings().visualViewportEnabled()) {
-            if (visibleContentRectUpdateInfo.unobscuredContentRect() != visibleContentRectUpdateInfo.unobscuredContentRectRespectingInputViewBounds())
-                frameView.setVisualViewportOverrideRect(LayoutRect(visibleContentRectUpdateInfo.unobscuredContentRectRespectingInputViewBounds()));
-            else
-                frameView.setVisualViewportOverrideRect(WTF::nullopt);
-
-            LOG_WITH_STREAM(VisibleRects, stream << "WebPage::updateVisibleContentRects - setLayoutViewportOverrideRect " << visibleContentRectUpdateInfo.customFixedPositionRect());
-            frameView.setLayoutViewportOverrideRect(LayoutRect(visibleContentRectUpdateInfo.customFixedPositionRect()));
-            if (selectionIsInsideFixedPositionContainer(frame)) {
-                // Ensure that the next layer tree commit contains up-to-date caret/selection rects.
-                frameView.frame().selection().setCaretRectNeedsUpdate();
-                sendPartialEditorStateAndSchedulePostLayoutUpdate();
-            }
+        if (visibleContentRectUpdateInfo.unobscuredContentRect() != visibleContentRectUpdateInfo.unobscuredContentRectRespectingInputViewBounds())
+            frameView.setVisualViewportOverrideRect(LayoutRect(visibleContentRectUpdateInfo.unobscuredContentRectRespectingInputViewBounds()));
+        else
+            frameView.setVisualViewportOverrideRect(WTF::nullopt);
+
+        LOG_WITH_STREAM(VisibleRects, stream << "WebPage::updateVisibleContentRects - setLayoutViewportOverrideRect " << visibleContentRectUpdateInfo.customFixedPositionRect());
+        frameView.setLayoutViewportOverrideRect(LayoutRect(visibleContentRectUpdateInfo.customFixedPositionRect()));
+        if (selectionIsInsideFixedPositionContainer(frame)) {
+            // Ensure that the next layer tree commit contains up-to-date caret/selection rects.
+            frameView.frame().selection().setCaretRectNeedsUpdate();
+            sendPartialEditorStateAndSchedulePostLayoutUpdate();
+        }
 
-            frameView.didUpdateViewportOverrideRects();
-        } else
-            frameView.setCustomFixedPositionLayoutRect(enclosingIntRect(visibleContentRectUpdateInfo.customFixedPositionRect()));
+        frameView.didUpdateViewportOverrideRects();
     }
 
     if (!visibleContentRectUpdateInfo.isChangingObscuredInsetsInteractively())
index 8778ce0..0323a26 100644 (file)
@@ -1,3 +1,30 @@
+2019-02-21  Simon Fraser  <simon.fraser@apple.com>
+
+        Hardcode Visual Viewports on everywhere except iOS WK1
+        https://bugs.webkit.org/show_bug.cgi?id=194928
+
+        Reviewed by Zalan Bujtas.
+
+        Remove the WK1 and WK2 preferences and MiniBrowser menu item for "visual viewports",
+        change the default value of the Setting to 'true', and hardcode WebView on iOS to
+        set it to false. The setting has shipped for several years and there's no need to turn
+        it off now.
+
+        Similarly, disable the "Visual Viewport API" on iOS WK1, since it makes no sense if
+        Visual Viewports are not enabled.
+        
+        Remove the "visualViewportEnabled" flag and unused code paths from scrolling tree code
+        that only runs in WK2
+
+        * WebView/WebPreferenceKeysPrivate.h:
+        * WebView/WebPreferences.mm:
+        (+[WebPreferences initialize]):
+        (-[WebPreferences visualViewportEnabled]): Deleted.
+        (-[WebPreferences setVisualViewportEnabled:]): Deleted.
+        * WebView/WebPreferencesPrivate.h:
+        * WebView/WebView.mm:
+        (-[WebView _preferencesChanged:]):
+
 2019-02-21  Darin Adler  <darin@apple.com>
 
         Some refinements for Node and Document
index da4d627..ced3355 100644 (file)
 #define WebKitReadableByteStreamAPIEnabledPreferenceKey @"WebKitReadableByteStreamAPIEnabled"
 #define WebKitDownloadAttributeEnabledPreferenceKey @"WebKitDownloadAttributeEnabled"
 #define WebKitDirectoryUploadEnabledPreferenceKey @"WebKitDirectoryUploadEnabled"
-#define WebKitVisualViewportEnabledPreferenceKey @"WebKitVisualViewportEnabled"
 #define WebKitVisualViewportAPIEnabledPreferenceKey @"WebKitVisualViewportAPIEnabled"
 #define WebKitCSSOMViewScrollingAPIEnabledPreferenceKey @"WebKitCSSOMViewScrollingAPIEnabled"
 #define WebKitModernMediaControlsEnabledPreferenceKey @"WebKitModernMediaControlsEnabled"
index 261ff17..58d79b8 100644 (file)
@@ -651,11 +651,10 @@ public:
         [NSNumber numberWithBool:YES], WebKitWebAnimationsEnabledPreferenceKey,
 
 #if PLATFORM(IOS_FAMILY)
-        [NSNumber numberWithBool:NO], WebKitVisualViewportEnabledPreferenceKey,
+        @NO, WebKitVisualViewportAPIEnabledPreferenceKey,
 #else
-        [NSNumber numberWithBool:YES], WebKitVisualViewportEnabledPreferenceKey,
+        @YES, WebKitVisualViewportAPIEnabledPreferenceKey,
 #endif
-        [NSNumber numberWithBool:YES], WebKitVisualViewportAPIEnabledPreferenceKey,
 
         [NSNumber numberWithBool:NO], WebKitCSSOMViewScrollingAPIEnabledPreferenceKey,
         [NSNumber numberWithBool:YES], WebKitNeedsStorageAccessFromFileURLsQuirkKey,
@@ -3119,16 +3118,6 @@ static NSString *classIBCreatorID = nil;
     return [self _boolValueForKey:WebKitDirectoryUploadEnabledPreferenceKey];
 }
 
-- (BOOL)visualViewportEnabled
-{
-    return [self _boolValueForKey:WebKitVisualViewportEnabledPreferenceKey];
-}
-
-- (void)setVisualViewportEnabled:(BOOL)flag
-{
-    [self _setBoolValue:flag forKey:WebKitVisualViewportEnabledPreferenceKey];
-}
-
 - (BOOL)visualViewportAPIEnabled
 {
     return [self _boolValueForKey:WebKitVisualViewportAPIEnabledPreferenceKey];
index ffaf05a..6b9d7a5 100644 (file)
@@ -588,7 +588,6 @@ extern NSString *WebPreferencesCacheModelChangedInternalNotification WEBKIT_DEPR
 - (BOOL)adClickAttributionEnabled;
 - (void)setAdClickAttributionEnabled:(BOOL)flag;
 
-@property (nonatomic) BOOL visualViewportEnabled;
 @property (nonatomic) BOOL visualViewportAPIEnabled;
 @property (nonatomic) BOOL CSSOMViewScrollingAPIEnabled;
 @property (nonatomic) BOOL largeImageAsyncDecodingEnabled;
index 480f885..f1a2dba 100644 (file)
@@ -2970,7 +2970,6 @@ static bool needsSelfRetainWhileLoadingQuirk()
 
     settings.setJavaScriptCanOpenWindowsAutomatically([preferences javaScriptCanOpenWindowsAutomatically] || shouldAllowWindowOpenWithoutUserGesture());
 
-    settings.setVisualViewportEnabled([preferences visualViewportEnabled]);
     settings.setVisualViewportAPIEnabled([preferences visualViewportAPIEnabled]);
     settings.setCSSOMViewScrollingAPIEnabled([preferences CSSOMViewScrollingAPIEnabled]);
     settings.setMediaContentTypesRequiringHardwareSupport([preferences mediaContentTypesRequiringHardwareSupport]);
@@ -3005,6 +3004,8 @@ static bool needsSelfRetainWhileLoadingQuirk()
     settings.setAllowsAirPlayForMediaPlayback([preferences allowsAirPlayForMediaPlayback]);
 #endif
 #if PLATFORM(IOS_FAMILY)
+    settings.setVisualViewportEnabled(false);
+    settings.setVisualViewportAPIEnabled(false);
     settings.setStandalone([preferences _standalone]);
     settings.setTelephoneNumberParsingEnabled([preferences _telephoneNumberParsingEnabled]);
     settings.setAllowMultiElementImplicitSubmission([preferences _allowMultiElementImplicitFormSubmission]);
index 61e0731..7e0cec8 100644 (file)
@@ -1,3 +1,33 @@
+2019-02-21  Simon Fraser  <simon.fraser@apple.com>
+
+        Hardcode Visual Viewports on everywhere except iOS WK1
+        https://bugs.webkit.org/show_bug.cgi?id=194928
+
+        Reviewed by Zalan Bujtas.
+
+        Remove the WK1 and WK2 preferences and MiniBrowser menu item for "visual viewports",
+        change the default value of the Setting to 'true', and hardcode WebView on iOS to
+        set it to false. The setting has shipped for several years and there's no need to turn
+        it off now.
+
+        Similarly, disable the "Visual Viewport API" on iOS WK1, since it makes no sense if
+        Visual Viewports are not enabled.
+        
+        Remove the "visualViewportEnabled" flag and unused code paths from scrolling tree code
+        that only runs in WK2
+
+        * MiniBrowser/mac/SettingsController.h:
+        * MiniBrowser/mac/SettingsController.m:
+        (-[SettingsController init]):
+        (-[SettingsController _populateMenu]):
+        (-[SettingsController validateMenuItem:]):
+        (-[SettingsController visualViewportEnabled]): Deleted.
+        (-[SettingsController toggleVisualViewportEnabled:]): Deleted.
+        * MiniBrowser/mac/WK1BrowserWindowController.m:
+        (-[WK1BrowserWindowController didChangeSettings]):
+        * MiniBrowser/mac/WK2BrowserWindowController.m:
+        (-[WK2BrowserWindowController didChangeSettings]):
+
 2019-02-21  Ryosuke Niwa  <rniwa@webkit.org>
 
         Discard cached processes when clearing website data store
index 1827f61..7378ca7 100644 (file)
@@ -53,7 +53,6 @@
 @property (nonatomic, readonly) BOOL displayListDrawingEnabled;
 @property (nonatomic, readonly) BOOL subpixelAntialiasedLayerTextEnabled;
 @property (nonatomic, readonly) BOOL resourceLoadStatisticsEnabled;
-@property (nonatomic, readonly) BOOL visualViewportEnabled;
 @property (nonatomic, readonly) BOOL largeImageAsyncDecodingEnabled;
 @property (nonatomic, readonly) BOOL animatedImageAsyncDecodingEnabled;
 @property (nonatomic, readonly) BOOL appleColorFilterEnabled;
index 85836da..70494cc 100644 (file)
@@ -62,7 +62,6 @@ static NSString * const UseTransparentWindowsPreferenceKey = @"UseTransparentWin
 static NSString * const UsePaginatedModePreferenceKey = @"UsePaginatedMode";
 static NSString * const EnableSubPixelCSSOMMetricsPreferenceKey = @"EnableSubPixelCSSOMMetrics";
 
-static NSString * const VisualViewportEnabledPreferenceKey = @"VisualViewportEnabled";
 static NSString * const LargeImageAsyncDecodingEnabledPreferenceKey = @"LargeImageAsyncDecodingEnabled";
 static NSString * const AnimatedImageAsyncDecodingEnabledPreferenceKey = @"AnimatedImageAsyncDecodingEnabled";
 static NSString * const AppleColorFilterEnabledPreferenceKey = @"AppleColorFilterEnabled";
@@ -113,7 +112,6 @@ typedef NS_ENUM(NSInteger, DebugOverylayMenuItemTag) {
 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300
         SubpixelAntialiasedLayerTextEnabledPreferenceKey,
 #endif
-        VisualViewportEnabledPreferenceKey,
         LargeImageAsyncDecodingEnabledPreferenceKey,
         AnimatedImageAsyncDecodingEnabledPreferenceKey,
     ];
@@ -170,7 +168,6 @@ typedef NS_ENUM(NSInteger, DebugOverylayMenuItemTag) {
     [self _addItemWithTitle:@"Enable Accelerated Drawing" action:@selector(toggleAcceleratedDrawingEnabled:) indented:NO];
     [self _addItemWithTitle:@"Enable Display List Drawing" action:@selector(toggleDisplayListDrawingEnabled:) indented:NO];
     [self _addItemWithTitle:@"Enable Subpixel-antialiased Layer Text" action:@selector(toggleSubpixelAntialiasedLayerTextEnabled:) indented:NO];
-    [self _addItemWithTitle:@"Enable Visual Viewport" action:@selector(toggleVisualViewportEnabled:) indented:NO];
     [self _addItemWithTitle:@"Enable Resource Load Statistics" action:@selector(toggleResourceLoadStatisticsEnabled:) indented:NO];
     [self _addItemWithTitle:@"Enable Large Image Async Decoding" action:@selector(toggleLargeImageAsyncDecodingEnabled:) indented:NO];
     [self _addItemWithTitle:@"Enable Animated Image Async Decoding" action:@selector(toggleAnimatedImageAsyncDecodingEnabled:) indented:NO];
@@ -291,8 +288,6 @@ typedef NS_ENUM(NSInteger, DebugOverylayMenuItemTag) {
         [menuItem setState:[self punchOutWhiteBackgroundsInDarkMode] ? NSControlStateValueOn : NSControlStateValueOff];
     else if (action == @selector(toggleUseSystemAppearance:))
         [menuItem setState:[self useSystemAppearance] ? NSControlStateValueOn : NSControlStateValueOff];
-    else if (action == @selector(toggleVisualViewportEnabled:))
-        [menuItem setState:[self visualViewportEnabled] ? NSControlStateValueOn : NSControlStateValueOff];
     else if (action == @selector(toggleReserveSpaceForBanners:))
         [menuItem setState:[self isSpaceReservedForBanners] ? NSControlStateValueOn : NSControlStateValueOff];
     else if (action == @selector(toggleShowTiledScrollingIndicator:))
@@ -556,16 +551,6 @@ typedef NS_ENUM(NSInteger, DebugOverylayMenuItemTag) {
     [self _toggleBooleanDefault:ResourceLoadStatisticsEnabledPreferenceKey];
 }
 
-- (BOOL)visualViewportEnabled
-{
-    return [[NSUserDefaults standardUserDefaults] boolForKey:VisualViewportEnabledPreferenceKey];
-}
-
-- (void)toggleVisualViewportEnabled:(id)sender
-{
-    [self _toggleBooleanDefault:VisualViewportEnabledPreferenceKey];
-}
-
 - (BOOL)resourceLoadStatisticsEnabled
 {
     return [[NSUserDefaults standardUserDefaults] boolForKey:ResourceLoadStatisticsEnabledPreferenceKey];
index 62094d9..41d1a78 100644 (file)
@@ -308,7 +308,6 @@ static BOOL areEssentiallyEqual(double a, double b)
     [[WebPreferences standardPreferences] setAcceleratedDrawingEnabled:settings.acceleratedDrawingEnabled];
     [[WebPreferences standardPreferences] setSubpixelAntialiasedLayerTextEnabled:settings.subpixelAntialiasedLayerTextEnabled];
     [[WebPreferences standardPreferences] setResourceLoadStatisticsEnabled:settings.resourceLoadStatisticsEnabled];
-    [[WebPreferences standardPreferences] setVisualViewportEnabled:settings.visualViewportEnabled];
     [[WebPreferences standardPreferences] setLargeImageAsyncDecodingEnabled:settings.largeImageAsyncDecodingEnabled];
     [[WebPreferences standardPreferences] setAnimatedImageAsyncDecodingEnabled:settings.animatedImageAsyncDecodingEnabled];
     [[WebPreferences standardPreferences] setColorFilterEnabled:settings.appleColorFilterEnabled];
index 721e48d..5b77de5 100644 (file)
@@ -406,7 +406,6 @@ static BOOL areEssentiallyEqual(double a, double b)
     preferences._resourceUsageOverlayVisible = settings.resourceUsageOverlayVisible;
     preferences._displayListDrawingEnabled = settings.displayListDrawingEnabled;
     preferences._subpixelAntialiasedLayerTextEnabled = settings.subpixelAntialiasedLayerTextEnabled;
-    preferences._visualViewportEnabled = settings.visualViewportEnabled;
     preferences._largeImageAsyncDecodingEnabled = settings.largeImageAsyncDecodingEnabled;
     preferences._animatedImageAsyncDecodingEnabled = settings.animatedImageAsyncDecodingEnabled;
     preferences._colorFilterEnabled = settings.appleColorFilterEnabled;