Diff
Modified: trunk/LayoutTests/ChangeLog (247838 => 247839)
--- trunk/LayoutTests/ChangeLog 2019-07-25 20:55:06 UTC (rev 247838)
+++ trunk/LayoutTests/ChangeLog 2019-07-25 21:12:01 UTC (rev 247839)
@@ -229,6 +229,20 @@
* fast/canvas/setTransfrom-aliases-transform-expected.html: Added.
* fast/canvas/setTransfrom-aliases-transform.html: Added.
+2019-07-24 Simon Fraser <simon.fra...@apple.com>
+
+ [iOS WK2] A top fixed bar can flicker when scrolling with the keyboard up
+ https://bugs.webkit.org/show_bug.cgi?id=200105
+ rdar://problem/52871975
+
+ Reviewed by Wenson Hsieh.
+
+ * resources/ui-helper.js:
+ (window.UIHelper.ensureStablePresentationUpdate.return.new.Promise):
+ (window.UIHelper.ensureStablePresentationUpdate):
+ * scrollingcoordinator/ios/fixed-scrolling-with-keyboard-expected.txt: Added.
+ * scrollingcoordinator/ios/fixed-scrolling-with-keyboard.html: Added.
+
2019-07-23 Tim Horton <timothy_hor...@apple.com>
Long press hint of AirPods buy buttons are tall and narrow during animation
Modified: trunk/LayoutTests/resources/ui-helper.js (247838 => 247839)
--- trunk/LayoutTests/resources/ui-helper.js 2019-07-25 20:55:06 UTC (rev 247838)
+++ trunk/LayoutTests/resources/ui-helper.js 2019-07-25 21:12:01 UTC (rev 247839)
@@ -254,6 +254,21 @@
});
}
+ static ensureStablePresentationUpdate()
+ {
+ if (!this.isWebKit2()) {
+ testRunner.display();
+ return Promise.resolve();
+ }
+
+ return new Promise(resolve => {
+ testRunner.runUIScript(`
+ uiController.doAfterNextStablePresentationUpdate(function() {
+ uiController.uiScriptComplete();
+ });`, resolve);
+ });
+ }
+
static ensurePositionInformationUpdateForElement(element)
{
const boundingRect = element.getBoundingClientRect();
@@ -969,4 +984,16 @@
})()`, resolve);
});
}
+
+ static getScrollingTree()
+ {
+ if (!this.isWebKit2() || !this.isIOSFamily())
+ return Promise.resolve();
+
+ return new Promise(resolve => {
+ testRunner.runUIScript(`(() => {
+ return uiController.scrollingTreeAsText;
+ })()`, resolve);
+ });
+ }
}
Added: trunk/LayoutTests/scrollingcoordinator/ios/fixed-scrolling-with-keyboard-expected.txt (0 => 247839)
--- trunk/LayoutTests/scrollingcoordinator/ios/fixed-scrolling-with-keyboard-expected.txt (rev 0)
+++ trunk/LayoutTests/scrollingcoordinator/ios/fixed-scrolling-with-keyboard-expected.txt 2019-07-25 21:12:01 UTC (rev 247839)
@@ -0,0 +1,23 @@
+
+
+(scrolling tree
+ (frame scrolling node
+ (scrollable area size width=220 height=377)
+ (total content size width=320 height=4021)
+ (last committed scroll position (0,0))
+ (scrollable area parameters
+ (horizontal scroll elasticity 1)
+ (vertical scroll elasticity 1)
+ (horizontal scrollbar mode 0)
+ (vertical scrollbar mode 0))
+ (layout viewport (0,0) width=320 height=548)
+ (min layoutViewport origin (0,0))
+ (max layoutViewport origin (100,3644))
+ (override visual viewport size width=220.20 height=346.83)
+ (behavior for fixed 0)
+ (visual viewport is smaller than layout viewport 1)
+ (fixed node
+ (fixed constraints
+ (viewport-rect-at-last-layout (0,0) width=320 height=548)
+ (layer-position-at-last-layout (0,0)))
+ (layer top left (0,0)))))
Added: trunk/LayoutTests/scrollingcoordinator/ios/fixed-scrolling-with-keyboard.html (0 => 247839)
--- trunk/LayoutTests/scrollingcoordinator/ios/fixed-scrolling-with-keyboard.html (rev 0)
+++ trunk/LayoutTests/scrollingcoordinator/ios/fixed-scrolling-with-keyboard.html 2019-07-25 21:12:01 UTC (rev 247839)
@@ -0,0 +1,45 @@
+<!DOCTYPE html> <!-- webkit-test-runner [ useFlexibleViewport=true ] -->
+<html>
+<head>
+ <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
+
+ <style>
+ body {
+ height: 4000px;
+ }
+ .header {
+ position: fixed;
+ top: 0;
+ left: 0;
+ height: 30px;
+ width: 100%;
+ background-color: rgba(0, 0, 0, 0.5);
+ }
+ </style>
+
+ <script src=""
+ <script>
+ if (window.testRunner) {
+ testRunner.waitUntilDone();
+ testRunner.dumpAsText();
+ }
+
+ window.addEventListener('load', async () => {
+
+ await UIHelper.activateAndWaitForInputSessionAt(5, 5);
+ document.getElementById('input').value = 'hi'; // Trigger a layout and flush.
+ await UIHelper.ensureStablePresentationUpdate();
+
+ let scrollingTree = await UIHelper.getScrollingTree();
+ document.getElementById('scrolling-tree').textContent = scrollingTree;
+ testRunner.notifyDone();
+ }, false);
+ </script>
+</head>
+<body>
+ <div class="header">
+ <input id="input">
+ </div>
+<pre id="scrolling-tree"></pre>
+</body>
+</html>
Modified: trunk/Source/WebCore/ChangeLog (247838 => 247839)
--- trunk/Source/WebCore/ChangeLog 2019-07-25 20:55:06 UTC (rev 247838)
+++ trunk/Source/WebCore/ChangeLog 2019-07-25 21:12:01 UTC (rev 247839)
@@ -784,6 +784,44 @@
* html/canvas/CanvasRenderingContext2DBase.cpp:
(WebCore::CanvasRenderingContext2DBase::setTransform):
+2019-07-24 Simon Fraser <simon.fra...@apple.com>
+
+ [iOS WK2] A top fixed bar can flicker when scrolling with the keyboard up
+ https://bugs.webkit.org/show_bug.cgi?id=200105
+ rdar://problem/52871975
+
+ Reviewed by Wenson Hsieh.
+
+ ScrollingTreeFrameScrollingNode::layoutViewportForScrollPosition() computes a visual viewport
+ from the current scroll position and scrollableAreaSize(). This doesn't know anything about
+ the impact of keyboards on the visual viewport, so it computes a too-large visual viewport
+ when the keyboard is up, triggering incorrect manipulations of the layout viewport. This
+ leads to the top bar flashing to position 0 when it should be hidden off the top.
+
+ Fix by feeding into the scrolling tree the height of the visual viewport which takes
+ FrameView::visualViewportOverrideRect() into account. This is stored on ScrollingStateFrameScrollingNode/
+ ScrollingTreeFrameScrollingNode.
+
+ Test: scrollingcoordinator/ios/fixed-scrolling-with-keyboard.html
+
+ * page/FrameView.h:
+ * page/scrolling/AsyncScrollingCoordinator.cpp:
+ (WebCore::AsyncScrollingCoordinator::setFrameScrollingNodeState):
+ * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
+ (WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
+ (WebCore::ScrollingStateFrameScrollingNode::setPropertyChangedBitsAfterReattach):
+ (WebCore::ScrollingStateFrameScrollingNode::setOverrideVisualViewportSize):
+ (WebCore::ScrollingStateFrameScrollingNode::dumpProperties const):
+ * page/scrolling/ScrollingStateFrameScrollingNode.h:
+ * page/scrolling/ScrollingTree.cpp:
+ (WebCore::ScrollingTree::commitTreeState): LOG_WITH_STREAM() doesn't evaluate scrollingTreeAsText()
+ every time.
+ * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
+ (WebCore::ScrollingTreeFrameScrollingNode::commitStateBeforeChildren):
+ (WebCore::ScrollingTreeFrameScrollingNode::layoutViewportForScrollPosition const):
+ (WebCore::ScrollingTreeFrameScrollingNode::dumpProperties const):
+ * page/scrolling/ScrollingTreeFrameScrollingNode.h:
+
2019-07-23 Tim Horton <timothy_hor...@apple.com>
Long press hint of AirPods buy buttons are tall and narrow during animation
Modified: trunk/Source/WebCore/page/FrameView.h (247838 => 247839)
--- trunk/Source/WebCore/page/FrameView.h 2019-07-25 20:55:06 UTC (rev 247838)
+++ trunk/Source/WebCore/page/FrameView.h 2019-07-25 21:12:01 UTC (rev 247839)
@@ -258,6 +258,7 @@
Optional<LayoutRect> layoutViewportOverrideRect() const { return m_layoutViewportOverrideRect; }
WEBCORE_EXPORT void setVisualViewportOverrideRect(Optional<LayoutRect>);
+ Optional<LayoutRect> visualViewportOverrideRect() const { return m_visualViewportOverrideRect; }
// These are in document coordinates, unaffected by page scale (but affected by zooming).
WEBCORE_EXPORT LayoutRect layoutViewportRect() const;
Modified: trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp (247838 => 247839)
--- trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp 2019-07-25 20:55:06 UTC (rev 247838)
+++ trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp 2019-07-25 21:12:01 UTC (rev 247839)
@@ -652,6 +652,11 @@
frameScrollingNode.setMinLayoutViewportOrigin(frameView.minStableLayoutViewportOrigin());
frameScrollingNode.setMaxLayoutViewportOrigin(frameView.maxStableLayoutViewportOrigin());
+ if (auto visualOverrideRect = frameView.visualViewportOverrideRect())
+ frameScrollingNode.setOverrideVisualViewportSize(FloatSize(visualOverrideRect.value().size()));
+ else
+ frameScrollingNode.setOverrideVisualViewportSize(WTF::nullopt);
+
frameScrollingNode.setFixedElementsLayoutRelativeToFrame(frameView.fixedElementsLayoutRelativeToFrame());
auto visualViewportIsSmallerThanLayoutViewport = [](const FrameView& frameView) {
Modified: trunk/Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.cpp (247838 => 247839)
--- trunk/Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.cpp 2019-07-25 20:55:06 UTC (rev 247838)
+++ trunk/Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.cpp 2019-07-25 21:12:01 UTC (rev 247839)
@@ -50,6 +50,7 @@
, m_layoutViewport(stateNode.layoutViewport())
, m_minLayoutViewportOrigin(stateNode.minLayoutViewportOrigin())
, m_maxLayoutViewportOrigin(stateNode.maxLayoutViewportOrigin())
+ , m_overrideVisualViewportSize(stateNode.overrideVisualViewportSize())
, m_frameScaleFactor(stateNode.frameScaleFactor())
, m_topContentInset(stateNode.topContentInset())
, m_headerHeight(stateNode.headerHeight())
@@ -108,6 +109,7 @@
setPropertyChangedBit(LayoutViewport);
setPropertyChangedBit(MinLayoutViewportOrigin);
setPropertyChangedBit(MaxLayoutViewportOrigin);
+ setPropertyChangedBit(OverrideVisualViewportSize);
ScrollingStateScrollingNode::setPropertyChangedBitsAfterReattach();
}
@@ -176,6 +178,15 @@
setPropertyChanged(MaxLayoutViewportOrigin);
}
+void ScrollingStateFrameScrollingNode::setOverrideVisualViewportSize(Optional<FloatSize> viewportSize)
+{
+ if (viewportSize == m_overrideVisualViewportSize)
+ return;
+
+ m_overrideVisualViewportSize = viewportSize;
+ setPropertyChanged(OverrideVisualViewportSize);
+}
+
void ScrollingStateFrameScrollingNode::setHeaderHeight(int headerHeight)
{
if (m_headerHeight == headerHeight)
@@ -312,6 +323,9 @@
ts.dumpProperty("min layout viewport origin", m_minLayoutViewportOrigin);
ts.dumpProperty("max layout viewport origin", m_maxLayoutViewportOrigin);
+ if (m_overrideVisualViewportSize)
+ ts.dumpProperty("override visual viewport size", m_overrideVisualViewportSize.value());
+
if (m_behaviorForFixed == StickToViewportBounds)
ts.dumpProperty("behavior for fixed", m_behaviorForFixed);
Modified: trunk/Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.h (247838 => 247839)
--- trunk/Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.h 2019-07-25 20:55:06 UTC (rev 247838)
+++ trunk/Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.h 2019-07-25 21:12:01 UTC (rev 247839)
@@ -66,6 +66,7 @@
LayoutViewport,
MinLayoutViewportOrigin,
MaxLayoutViewportOrigin,
+ OverrideVisualViewportSize,
};
float frameScaleFactor() const { return m_frameScaleFactor; }
@@ -89,6 +90,9 @@
FloatPoint maxLayoutViewportOrigin() const { return m_maxLayoutViewportOrigin; }
WEBCORE_EXPORT void setMaxLayoutViewportOrigin(const FloatPoint&);
+ Optional<FloatSize> overrideVisualViewportSize() const { return m_overrideVisualViewportSize; };
+ WEBCORE_EXPORT void setOverrideVisualViewportSize(Optional<FloatSize>);
+
int headerHeight() const { return m_headerHeight; }
WEBCORE_EXPORT void setHeaderHeight(int);
@@ -154,6 +158,7 @@
FloatRect m_layoutViewport;
FloatPoint m_minLayoutViewportOrigin;
FloatPoint m_maxLayoutViewportOrigin;
+ Optional<FloatSize> m_overrideVisualViewportSize;
float m_frameScaleFactor { 1 };
float m_topContentInset { 0 };
Modified: trunk/Source/WebCore/page/scrolling/ScrollingTree.cpp (247838 => 247839)
--- trunk/Source/WebCore/page/scrolling/ScrollingTree.cpp 2019-07-25 20:55:06 UTC (rev 247838)
+++ trunk/Source/WebCore/page/scrolling/ScrollingTree.cpp 2019-07-25 21:12:01 UTC (rev 247839)
@@ -186,7 +186,7 @@
m_nodeMap.remove(nodeID);
}
- LOG(Scrolling, "committed ScrollingTree\n%s", scrollingTreeAsText(ScrollingStateTreeAsTextBehaviorDebug).utf8().data());
+ LOG_WITH_STREAM(Scrolling, stream << "committed ScrollingTree" << scrollingTreeAsText(ScrollingStateTreeAsTextBehaviorDebug));
}
void ScrollingTree::updateTreeFromStateNode(const ScrollingStateNode* stateNode, OrphanScrollingNodeMap& orphanNodes, HashSet<ScrollingNodeID>& unvisitedNodes)
Modified: trunk/Source/WebCore/page/scrolling/ScrollingTreeFrameScrollingNode.cpp (247838 => 247839)
--- trunk/Source/WebCore/page/scrolling/ScrollingTreeFrameScrollingNode.cpp 2019-07-25 20:55:06 UTC (rev 247838)
+++ trunk/Source/WebCore/page/scrolling/ScrollingTreeFrameScrollingNode.cpp 2019-07-25 21:12:01 UTC (rev 247839)
@@ -85,6 +85,9 @@
if (state.hasChangedProperty(ScrollingStateFrameScrollingNode::MaxLayoutViewportOrigin))
m_maxLayoutViewportOrigin = state.maxLayoutViewportOrigin();
+
+ if (state.hasChangedProperty(ScrollingStateFrameScrollingNode::OverrideVisualViewportSize))
+ m_overrideVisualViewportSize = state.overrideVisualViewportSize();
}
bool ScrollingTreeFrameScrollingNode::scrollPositionAndLayoutViewportMatch(const FloatPoint& position, Optional<FloatRect> overrideLayoutViewport)
@@ -94,11 +97,12 @@
FloatRect ScrollingTreeFrameScrollingNode::layoutViewportForScrollPosition(const FloatPoint& visibleContentOrigin, float scale) const
{
- FloatRect visibleContentRect(visibleContentOrigin, scrollableAreaSize());
+ FloatSize visualViewportSize = m_overrideVisualViewportSize.valueOr(scrollableAreaSize());
+ FloatRect visibleContentRect(visibleContentOrigin, visualViewportSize);
LayoutRect visualViewport(FrameView::visibleDocumentRect(visibleContentRect, headerHeight(), footerHeight(), totalContentsSize(), scale));
LayoutRect layoutViewport(m_layoutViewport);
- LOG_WITH_STREAM(Scrolling, stream << "\nScrolling thread: " << "(visibleContentOrigin " << visibleContentOrigin << ") fixed behavior " << m_behaviorForFixed);
+ LOG_WITH_STREAM(Scrolling, stream << "\nScrolling thread: " << "(visibleContentOrigin " << visibleContentOrigin << ", visualViewportSize " << visualViewportSize << ") fixed behavior " << m_behaviorForFixed);
LOG_WITH_STREAM(Scrolling, stream << " layoutViewport: " << layoutViewport);
LOG_WITH_STREAM(Scrolling, stream << " visualViewport: " << visualViewport);
LOG_WITH_STREAM(Scrolling, stream << " scroll positions: min: " << minLayoutViewportOrigin() << " max: "<< maxLayoutViewportOrigin());
@@ -146,6 +150,9 @@
ts.dumpProperty("min layoutViewport origin", m_minLayoutViewportOrigin);
ts.dumpProperty("max layoutViewport origin", m_maxLayoutViewportOrigin);
+ if (m_overrideVisualViewportSize)
+ ts.dumpProperty("override visual viewport size", m_overrideVisualViewportSize.value());
+
if (m_frameScaleFactor != 1)
ts.dumpProperty("frame scale factor", m_frameScaleFactor);
if (m_topContentInset)
Modified: trunk/Source/WebCore/page/scrolling/ScrollingTreeFrameScrollingNode.h (247838 => 247839)
--- trunk/Source/WebCore/page/scrolling/ScrollingTreeFrameScrollingNode.h 2019-07-25 20:55:06 UTC (rev 247838)
+++ trunk/Source/WebCore/page/scrolling/ScrollingTreeFrameScrollingNode.h 2019-07-25 21:12:01 UTC (rev 247839)
@@ -78,6 +78,7 @@
FloatRect m_layoutViewport;
FloatPoint m_minLayoutViewportOrigin;
FloatPoint m_maxLayoutViewportOrigin;
+ Optional<FloatSize> m_overrideVisualViewportSize;
float m_frameScaleFactor { 1 };
float m_topContentInset { 0 };
Modified: trunk/Source/WebKit/ChangeLog (247838 => 247839)
--- trunk/Source/WebKit/ChangeLog 2019-07-25 20:55:06 UTC (rev 247838)
+++ trunk/Source/WebKit/ChangeLog 2019-07-25 21:12:01 UTC (rev 247839)
@@ -661,6 +661,28 @@
(WebKit::WebProcessPool::sendWebProcessDataStoreParameters):
* UIProcess/WebProcessPool.h:
+2019-07-24 Simon Fraser <simon.fra...@apple.com>
+
+ [iOS WK2] A top fixed bar can flicker when scrolling with the keyboard up
+ https://bugs.webkit.org/show_bug.cgi?id=200105
+ rdar://problem/52871975
+
+ Reviewed by Wenson Hsieh.
+
+ ScrollingTreeFrameScrollingNode::layoutViewportForScrollPosition() computes a visual viewport
+ from the current scroll position and scrollableAreaSize(). This doesn't know anything about
+ the impact of keyboards on the visual viewport, so it computes a too-large visual viewport
+ when the keyboard is up, triggering incorrect manipulations of the layout viewport. This
+ leads to the top bar flashing to position 0 when it should be hidden off the top.
+
+ Fix by feeding into the scrolling tree the height of the visual viewport which takes
+ FrameView::visualViewportOverrideRect() into account. This is stored on ScrollingStateFrameScrollingNode/
+ ScrollingTreeFrameScrollingNode.
+
+ * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
+ (ArgumentCoder<ScrollingStateFrameScrollingNode>::encode):
+ (ArgumentCoder<ScrollingStateFrameScrollingNode>::decode):
+
2019-07-23 Alex Christensen <achristen...@webkit.org>
Add SPI for setting media cache and key location on _WKWebsiteDataStoreConfiguration
Modified: trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp (247838 => 247839)
--- trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp 2019-07-25 20:55:06 UTC (rev 247838)
+++ trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp 2019-07-25 21:12:01 UTC (rev 247839)
@@ -183,6 +183,7 @@
SCROLLING_NODE_ENCODE(ScrollingStateFrameScrollingNode::LayoutViewport, layoutViewport)
SCROLLING_NODE_ENCODE(ScrollingStateFrameScrollingNode::MinLayoutViewportOrigin, minLayoutViewportOrigin)
SCROLLING_NODE_ENCODE(ScrollingStateFrameScrollingNode::MaxLayoutViewportOrigin, maxLayoutViewportOrigin)
+ SCROLLING_NODE_ENCODE(ScrollingStateFrameScrollingNode::OverrideVisualViewportSize, overrideVisualViewportSize)
if (node.hasChangedProperty(ScrollingStateFrameScrollingNode::CounterScrollingLayer))
encoder << static_cast<GraphicsLayer::PlatformLayerID>(node.counterScrollingLayer());
@@ -311,6 +312,7 @@
SCROLLING_NODE_DECODE(ScrollingStateFrameScrollingNode::LayoutViewport, FloatRect, setLayoutViewport)
SCROLLING_NODE_DECODE(ScrollingStateFrameScrollingNode::MinLayoutViewportOrigin, FloatPoint, setMinLayoutViewportOrigin)
SCROLLING_NODE_DECODE(ScrollingStateFrameScrollingNode::MaxLayoutViewportOrigin, FloatPoint, setMaxLayoutViewportOrigin)
+ SCROLLING_NODE_DECODE(ScrollingStateFrameScrollingNode::OverrideVisualViewportSize, Optional<FloatSize>, setOverrideVisualViewportSize)
if (node.hasChangedProperty(ScrollingStateFrameScrollingNode::CounterScrollingLayer)) {
GraphicsLayer::PlatformLayerID layerID;