WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-134085-20140620111344.patch (text/plain), 31.56 KB, created by
Simon Fraser (smfr)
on 2014-06-20 11:14:06 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Simon Fraser (smfr)
Created:
2014-06-20 11:14:06 PDT
Size:
31.56 KB
patch
obsolete
>Subversion Revision: 170131 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index b5decfa1133b7985c05f7bdd30ff3ae7cec18dce..0115d400aee932b0cddc4cb5db1a9412453c2497 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,5 +1,45 @@ > 2014-06-19 Simon Fraser <simon.fraser@apple.com> > >+ [iOS WebKit2] Make -webkit-overflow-scrolling:touch work in iframes (breaks MSWord previews) >+ https://bugs.webkit.org/show_bug.cgi?id=134085 >+ <rdar://problem/16440586> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ When nodes were detached from the scrolling tree, we would previously throw away >+ all descendant nodes, expecting that they would be re-attached as we walk the compositing >+ layer tree in RenderLayerCompositor. >+ >+ However, this doesn't work across frame boundaries; the subframe may never update >+ its compositing layers again, so would lose all its scrolling nodes. >+ >+ Fix by having ScrollingStateTree::detachNode() by default set aside subframe nodes >+ into a hash map. On reattach, we'll look in the hash map and pull out an existing node >+ (with its children intact) if possible. >+ >+ Tests: platform/mac-wk2/tiled-drawing/scrolling/frames/coordinated-frame-gain-scrolling-ancestor.html >+ platform/mac-wk2/tiled-drawing/scrolling/frames/coordinated-frame-lose-scrolling-ancestor.html >+ platform/mac-wk2/tiled-drawing/scrolling/frames/remove-coordinated-frame.html >+ >+ * page/scrolling/ScrollingStateNode.cpp: >+ (WebCore::ScrollingStateNode::ScrollingStateNode): >+ * page/scrolling/ScrollingStateTree.cpp: >+ (WebCore::ScrollingStateTree::attachNode): >+ (WebCore::ScrollingStateTree::detachNode): >+ (WebCore::ScrollingStateTree::clear): >+ (WebCore::ScrollingStateTree::removeNodeAndAllDescendants): >+ (WebCore::ScrollingStateTree::recursiveNodeWillBeRemoved): >+ * page/scrolling/ScrollingStateTree.h: >+ * page/scrolling/ScrollingTree.cpp: >+ (WebCore::ScrollingTree::commitNewTreeState): Go back to removing the deleted >+ nodes from m_nodeMap first. >+ (WebCore::ScrollingTree::removeDestroyedNodes): There is no need for this to >+ actually make use of ScrollingTreeNode* any more; the ASSERT(!node->parent()) >+ is bogus because it can fire when whole subtrees are removed, and to clear the >+ latched node we just need the ID. >+ >+2014-06-19 Simon Fraser <simon.fraser@apple.com> >+ > Handle scrolling tree modifications which remove intermediate nodes > https://bugs.webkit.org/show_bug.cgi?id=134082 > >diff --git a/Source/WebKit2/ChangeLog b/Source/WebKit2/ChangeLog >index 8726744e2e0927a73a7fe51b2a63747b3350f54b..f56f8cfe2ab71000de31d29d194b5fce0959fdfb 100644 >--- a/Source/WebKit2/ChangeLog >+++ b/Source/WebKit2/ChangeLog >@@ -1,5 +1,20 @@ > 2014-06-19 Simon Fraser <simon.fraser@apple.com> > >+ [iOS WebKit2] Make -webkit-overflow-scrolling:touch work in iframes (breaks MSWord previews) >+ https://bugs.webkit.org/show_bug.cgi?id=134085 >+ <rdar://problem/16440586> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Add some debug-only assertions that check that the number of nodes we encoded is >+ the expected number. >+ >+ * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp: >+ (WebKit::encodeNodeAndDescendants): >+ (WebKit::RemoteScrollingCoordinatorTransaction::encode): >+ >+2014-06-19 Simon Fraser <simon.fraser@apple.com> >+ > Handle scrolling tree modifications which remove intermediate nodes > https://bugs.webkit.org/show_bug.cgi?id=134082 > >diff --git a/Source/WebCore/page/scrolling/ScrollingStateNode.cpp b/Source/WebCore/page/scrolling/ScrollingStateNode.cpp >index c36a886d2e0933562b61397b01415a4d25854644..2000a010cb0b2bf48212cee3af37a12b1d48ee09 100644 >--- a/Source/WebCore/page/scrolling/ScrollingStateNode.cpp >+++ b/Source/WebCore/page/scrolling/ScrollingStateNode.cpp >@@ -41,7 +41,7 @@ ScrollingStateNode::ScrollingStateNode(ScrollingNodeType nodeType, ScrollingStat > , m_nodeID(nodeID) > , m_changedProperties(0) > , m_scrollingStateTree(scrollingStateTree) >- , m_parent(0) >+ , m_parent(nullptr) > { > } > >@@ -52,7 +52,7 @@ ScrollingStateNode::ScrollingStateNode(const ScrollingStateNode& stateNode, Scro > , m_nodeID(stateNode.scrollingNodeID()) > , m_changedProperties(stateNode.changedProperties()) > , m_scrollingStateTree(adoptiveTree) >- , m_parent(0) >+ , m_parent(nullptr) > { > if (hasChangedProperty(ScrollLayer)) > setLayer(stateNode.layer().toRepresentation(adoptiveTree.preferredLayerRepresentation())); >diff --git a/Source/WebCore/page/scrolling/ScrollingStateTree.cpp b/Source/WebCore/page/scrolling/ScrollingStateTree.cpp >index 5f7e07c7cf53968bac7bd23e229f77eb6022646e..e14300f8dab219456be1ddf11eaad0a7e363846c 100644 >--- a/Source/WebCore/page/scrolling/ScrollingStateTree.cpp >+++ b/Source/WebCore/page/scrolling/ScrollingStateTree.cpp >@@ -82,7 +82,7 @@ ScrollingNodeID ScrollingStateTree::attachNode(ScrollingNodeType nodeType, Scrol > return newNodeID; > > // The node is being re-parented. To do that, we'll remove it, and then re-create a new node. >- removeNodeAndAllDescendants(node); >+ removeNodeAndAllDescendants(node, OrphanSubframeNodes); > } > > ScrollingStateNode* newNode = nullptr; >@@ -98,31 +98,40 @@ ScrollingNodeID ScrollingStateTree::attachNode(ScrollingNodeType nodeType, Scrol > if (!parent) > return 0; > >- switch (nodeType) { >- case FixedNode: { >- RefPtr<ScrollingStateFixedNode> fixedNode = ScrollingStateFixedNode::create(*this, newNodeID); >- newNode = fixedNode.get(); >- parent->appendChild(fixedNode.release()); >- break; >- } >- case StickyNode: { >- RefPtr<ScrollingStateStickyNode> stickyNode = ScrollingStateStickyNode::create(*this, newNodeID); >- newNode = stickyNode.get(); >- parent->appendChild(stickyNode.release()); >- break; >- } >- case FrameScrollingNode: { >- RefPtr<ScrollingStateFrameScrollingNode> scrollingNode = ScrollingStateFrameScrollingNode::create(*this, newNodeID); >- newNode = scrollingNode.get(); >- parent->appendChild(scrollingNode.release()); >- break; >- } >- case OverflowScrollingNode: { >- RefPtr<ScrollingStateOverflowScrollingNode> scrollingNode = ScrollingStateOverflowScrollingNode::create(*this, newNodeID); >- newNode = scrollingNode.get(); >- parent->appendChild(scrollingNode.release()); >- break; >+ if (nodeType == FrameScrollingNode && parentID) { >+ if (RefPtr<ScrollingStateNode> orphanedNode = m_orphanedSubframeNodes.take(newNodeID)) { >+ newNode = orphanedNode.get(); >+ parent->appendChild(orphanedNode.release()); >+ } > } >+ >+ if (!newNode) { >+ switch (nodeType) { >+ case FixedNode: { >+ RefPtr<ScrollingStateFixedNode> fixedNode = ScrollingStateFixedNode::create(*this, newNodeID); >+ newNode = fixedNode.get(); >+ parent->appendChild(fixedNode.release()); >+ break; >+ } >+ case StickyNode: { >+ RefPtr<ScrollingStateStickyNode> stickyNode = ScrollingStateStickyNode::create(*this, newNodeID); >+ newNode = stickyNode.get(); >+ parent->appendChild(stickyNode.release()); >+ break; >+ } >+ case FrameScrollingNode: { >+ RefPtr<ScrollingStateFrameScrollingNode> scrollingNode = ScrollingStateFrameScrollingNode::create(*this, newNodeID); >+ newNode = scrollingNode.get(); >+ parent->appendChild(scrollingNode.release()); >+ break; >+ } >+ case OverflowScrollingNode: { >+ RefPtr<ScrollingStateOverflowScrollingNode> scrollingNode = ScrollingStateOverflowScrollingNode::create(*this, newNodeID); >+ newNode = scrollingNode.get(); >+ parent->appendChild(scrollingNode.release()); >+ break; >+ } >+ } > } > } > >@@ -141,18 +150,23 @@ void ScrollingStateTree::detachNode(ScrollingNodeID nodeID) > if (!node) > return; > >- removeNodeAndAllDescendants(node); >+ removeNodeAndAllDescendants(node, OrphanSubframeNodes); > } > > void ScrollingStateTree::clear() > { >- removeNodeAndAllDescendants(rootStateNode()); >+ if (rootStateNode()) >+ removeNodeAndAllDescendants(rootStateNode()); >+ > ASSERT(m_stateNodeMap.isEmpty()); > m_stateNodeMap.clear(); >+ m_orphanedSubframeNodes.clear(); > } > > PassOwnPtr<ScrollingStateTree> ScrollingStateTree::commit(LayerRepresentation::Type preferredLayerRepresentation) > { >+ m_orphanedSubframeNodes.clear(); >+ > // This function clones and resets the current state tree, but leaves the tree structure intact. > OwnPtr<ScrollingStateTree> treeStateClone = ScrollingStateTree::create(); > treeStateClone->setPreferredLayerRepresentation(preferredLayerRepresentation); >@@ -178,16 +192,15 @@ void ScrollingStateTree::addNode(ScrollingStateNode* node) > m_stateNodeMap.add(node->scrollingNodeID(), node); > } > >-void ScrollingStateTree::removeNodeAndAllDescendants(ScrollingStateNode* node) >+void ScrollingStateTree::removeNodeAndAllDescendants(ScrollingStateNode* node, SubframeNodeRemoval subframeNodeRemoval) > { >- if (!node) >- return; >+ ScrollingStateNode* parent = node->parent(); > >- recursiveNodeWillBeRemoved(node); >+ recursiveNodeWillBeRemoved(node, subframeNodeRemoval); > > if (node == m_rootStateNode) > m_rootStateNode = nullptr; >- else if (ScrollingStateNode* parent = node->parent()) { >+ else if (parent) { > ASSERT(parent->children() && parent->children()->find(node) != notFound); > if (auto children = parent->children()) { > size_t index = children->find(node); >@@ -197,13 +210,19 @@ void ScrollingStateTree::removeNodeAndAllDescendants(ScrollingStateNode* node) > } > } > >-void ScrollingStateTree::recursiveNodeWillBeRemoved(ScrollingStateNode* currNode) >+void ScrollingStateTree::recursiveNodeWillBeRemoved(ScrollingStateNode* currNode, SubframeNodeRemoval subframeNodeRemoval) > { >+ currNode->setParent(nullptr); >+ if (subframeNodeRemoval == OrphanSubframeNodes && currNode != m_rootStateNode && currNode->isFrameScrollingNode()) { >+ m_orphanedSubframeNodes.add(currNode->scrollingNodeID(), currNode); >+ return; >+ } >+ > willRemoveNode(currNode); > > if (auto children = currNode->children()) { > for (auto& child : *children) >- recursiveNodeWillBeRemoved(child.get()); >+ recursiveNodeWillBeRemoved(child.get(), subframeNodeRemoval); > } > } > >diff --git a/Source/WebCore/page/scrolling/ScrollingStateTree.h b/Source/WebCore/page/scrolling/ScrollingStateTree.h >index ae905f671854e73fd8392beab8a94b0c681b3b5e..b0e1924cb7796fc26650b13da543432cc1ec9b9c 100644 >--- a/Source/WebCore/page/scrolling/ScrollingStateTree.h >+++ b/Source/WebCore/page/scrolling/ScrollingStateTree.h >@@ -81,15 +81,21 @@ private: > > void setRootStateNode(PassRefPtr<ScrollingStateFrameScrollingNode> rootStateNode) { m_rootStateNode = rootStateNode; } > void addNode(ScrollingStateNode*); >- void removeNodeAndAllDescendants(ScrollingStateNode*); > >- void recursiveNodeWillBeRemoved(ScrollingStateNode* currNode); >+ enum SubframeNodeRemoval { >+ DeleteSubframeNodes, >+ OrphanSubframeNodes >+ }; >+ void removeNodeAndAllDescendants(ScrollingStateNode*, SubframeNodeRemoval = DeleteSubframeNodes); >+ >+ void recursiveNodeWillBeRemoved(ScrollingStateNode* currNode, SubframeNodeRemoval); > void willRemoveNode(ScrollingStateNode*); > > AsyncScrollingCoordinator* m_scrollingCoordinator; > StateNodeMap m_stateNodeMap; > RefPtr<ScrollingStateFrameScrollingNode> m_rootStateNode; > HashSet<ScrollingNodeID> m_nodesRemovedSinceLastCommit; >+ HashMap<ScrollingNodeID, RefPtr<ScrollingStateNode>> m_orphanedSubframeNodes; > bool m_hasChangedProperties; > bool m_hasNewRootStateNode; > LayerRepresentation::Type m_preferredLayerRepresentation; >diff --git a/Source/WebCore/page/scrolling/ScrollingTree.cpp b/Source/WebCore/page/scrolling/ScrollingTree.cpp >index 8524d17a9aee96411a637df11183460a7dcffad1..7ecc6e22e37363abf49966b5ac3b03f820a08dd5 100644 >--- a/Source/WebCore/page/scrolling/ScrollingTree.cpp >+++ b/Source/WebCore/page/scrolling/ScrollingTree.cpp >@@ -149,12 +149,10 @@ void ScrollingTree::commitNewTreeState(PassOwnPtr<ScrollingStateTree> scrollingS > bool scrollRequestIsProgammatic = rootNode ? rootNode->requestedScrollPositionRepresentsProgrammaticScroll() : false; > TemporaryChange<bool> changeHandlingProgrammaticScroll(m_isHandlingProgrammaticScroll, scrollRequestIsProgammatic); > >- { >- OrphanScrollingNodeMap orphanNodes; >- updateTreeFromStateNode(rootNode, orphanNodes); >- } >- > removeDestroyedNodes(*scrollingStateTree); >+ >+ OrphanScrollingNodeMap orphanNodes; >+ updateTreeFromStateNode(rootNode, orphanNodes); > } > > void ScrollingTree::updateTreeFromStateNode(const ScrollingStateNode* stateNode, OrphanScrollingNodeMap& orphanNodes) >@@ -216,16 +214,10 @@ void ScrollingTree::updateTreeFromStateNode(const ScrollingStateNode* stateNode, > > void ScrollingTree::removeDestroyedNodes(const ScrollingStateTree& stateTree) > { >- for (const auto& removedNode : stateTree.removedNodes()) { >- ScrollingTreeNode* node = m_nodeMap.take(removedNode); >- if (!node) >- continue; >- >- if (node->scrollingNodeID() == m_latchedNode) >+ for (const auto& removedNodeID : stateTree.removedNodes()) { >+ m_nodeMap.remove(removedNodeID); >+ if (removedNodeID == m_latchedNode) > clearLatchedNode(); >- >- // We should have unparented this node already via updateTreeFromStateNode(). >- ASSERT(!node->parent()); > } > } > >diff --git a/Source/WebKit2/Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp b/Source/WebKit2/Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp >index 84dcc5400234f6a507c3bf7c4f94a093cc9cd8f6..75e7b8cda655fdf8ca109f1d25e8ed1f975053b8 100644 >--- a/Source/WebKit2/Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp >+++ b/Source/WebKit2/Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp >@@ -317,8 +317,10 @@ bool ArgumentCoder<ScrollingStateStickyNode>::decode(ArgumentDecoder& decoder, S > > namespace WebKit { > >-static void encodeNodeAndDescendants(IPC::ArgumentEncoder& encoder, const ScrollingStateNode& stateNode) >+static void encodeNodeAndDescendants(IPC::ArgumentEncoder& encoder, const ScrollingStateNode& stateNode, int& encodedNodeCount) > { >+ ++encodedNodeCount; >+ > switch (stateNode.nodeType()) { > case FrameScrollingNode: > encoder << toScrollingStateFrameScrollingNode(stateNode); >@@ -338,7 +340,7 @@ static void encodeNodeAndDescendants(IPC::ArgumentEncoder& encoder, const Scroll > return; > > for (const auto& child : *stateNode.children()) >- encodeNodeAndDescendants(encoder, *child.get()); >+ encodeNodeAndDescendants(encoder, *child.get(), encodedNodeCount); > } > > void RemoteScrollingCoordinatorTransaction::encode(IPC::ArgumentEncoder& encoder) const >@@ -352,9 +354,11 @@ void RemoteScrollingCoordinatorTransaction::encode(IPC::ArgumentEncoder& encoder > if (m_scrollingStateTree) { > encoder << m_scrollingStateTree->hasChangedProperties(); > >+ int numNodesEncoded = 0; > if (const ScrollingStateNode* rootNode = m_scrollingStateTree->rootStateNode()) >- encodeNodeAndDescendants(encoder, *rootNode); >+ encodeNodeAndDescendants(encoder, *rootNode, numNodesEncoded); > >+ ASSERT_UNUSED(numNodesEncoded, numNodesEncoded == numNodes); > encoder << m_scrollingStateTree->removedNodes(); > } else > encoder << Vector<ScrollingNodeID>(); >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 773c1e978e4db88324fbf5f9bd03ebf3374f4e00..bc65bb0c8a363f1505696d729308e527215b0c67 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,22 @@ >+2014-06-19 Simon Fraser <simon.fraser@apple.com> >+ >+ [iOS WebKit2] Make -webkit-overflow-scrolling:touch work in iframes (breaks MSWord previews) >+ https://bugs.webkit.org/show_bug.cgi?id=134085 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Tests that add and remove a fixed container of a scroll-coordinated iframe. >+ >+ * platform/mac-wk2/tiled-drawing/scrolling/frames/coordinated-frame-expected.txt: >+ * platform/mac-wk2/tiled-drawing/scrolling/frames/coordinated-frame-gain-scrolling-ancestor-expected.txt: Added. >+ * platform/mac-wk2/tiled-drawing/scrolling/frames/coordinated-frame-gain-scrolling-ancestor.html: Added. >+ * platform/mac-wk2/tiled-drawing/scrolling/frames/coordinated-frame-in-fixed-expected.txt: >+ * platform/mac-wk2/tiled-drawing/scrolling/frames/coordinated-frame-lose-scrolling-ancestor-expected.txt: Added. >+ * platform/mac-wk2/tiled-drawing/scrolling/frames/coordinated-frame-lose-scrolling-ancestor.html: Added. >+ * platform/mac-wk2/tiled-drawing/scrolling/frames/remove-coordinated-frame-expected.txt: Added. >+ * platform/mac-wk2/tiled-drawing/scrolling/frames/remove-coordinated-frame.html: Added. >+ * platform/mac-wk2/tiled-drawing/scrolling/frames/resources/doc-with-sticky.html: >+ > 2014-06-18 Benjamin Poulain <benjamin@webkit.org> > > Subtrees with :first-child and :last-child are not invalidated when siblings are added/removed >diff --git a/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/frames/coordinated-frame-expected.txt b/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/frames/coordinated-frame-expected.txt >index aba07f1b6725aa1dfc7812be478c79bb9a462767..0b5b97afc6cb342ffb513efda4299cd0a123f9f1 100644 >--- a/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/frames/coordinated-frame-expected.txt >+++ b/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/frames/coordinated-frame-expected.txt >@@ -4,16 +4,17 @@ > (children 1 > (Frame scrolling node > (scrollable area size 485 300) >- (contents size 485 1868) >+ (contents size 485 420) > (children 1 > (Sticky node >- (anchor edges: AnchorEdgeTop ) >+ (anchor edges: AnchorEdgeTop AnchorEdgeBottom) > (top offset 10.00) >- (containing block rect 8.00, 10.00 469.00 x 1850.00) >- (sticky box rect 8.00 830.00 100.00 100.00) >+ (bottom offset 10.00) >+ (containing block rect 8.00, 8.00 469.00 x 404.00) >+ (sticky box rect 8.00 312.00 100.00 100.00) > (constraining rect 0.00 0.00 485.00 300.00) >- (sticky offset at last layout 0.00 0.00) >- (layer position at last layout 8.00 830.00) >+ (sticky offset at last layout 0.00 -122.00) >+ (layer position at last layout 8.00 190.00) > ) > ) > ) >diff --git a/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/frames/coordinated-frame-gain-scrolling-ancestor-expected.txt b/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/frames/coordinated-frame-gain-scrolling-ancestor-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..1ebc045dea444c14b99534063c5f24e2fff04bbc >--- /dev/null >+++ b/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/frames/coordinated-frame-gain-scrolling-ancestor-expected.txt >@@ -0,0 +1,30 @@ >+(Frame scrolling node >+ (scrollable area size 785 600) >+ (contents size 785 1016) >+ (children 1 >+ (Fixed node >+ (anchor edges: AnchorEdgeLeft AnchorEdgeTop) >+ (viewport rect at last layout: 0.00 0.00 785.00 600.00) >+ (layer position at last layout 8.00 10.00) >+ (children 1 >+ (Frame scrolling node >+ (scrollable area size 500 300) >+ (contents size 500 420) >+ (children 1 >+ (Sticky node >+ (anchor edges: AnchorEdgeTop AnchorEdgeBottom) >+ (top offset 10.00) >+ (bottom offset 10.00) >+ (containing block rect 8.00, 8.00 484.00 x 404.00) >+ (sticky box rect 8.00 312.00 100.00 100.00) >+ (constraining rect 0.00 0.00 500.00 300.00) >+ (sticky offset at last layout 0.00 -122.00) >+ (layer position at last layout 8.00 190.00) >+ ) >+ ) >+ ) >+ ) >+ ) >+ ) >+) >+ >diff --git a/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/frames/coordinated-frame-gain-scrolling-ancestor.html b/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/frames/coordinated-frame-gain-scrolling-ancestor.html >new file mode 100644 >index 0000000000000000000000000000000000000000..b9703b719e91a6df80daca503e70fae874335cf8 >--- /dev/null >+++ b/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/frames/coordinated-frame-gain-scrolling-ancestor.html >@@ -0,0 +1,64 @@ >+<!DOCTYPE html> >+<html> >+<head> >+ <style> >+ body { >+ height: 1000px; >+ } >+ >+ iframe { >+ display: block; >+ margin: 10px; >+ border: 5px solid black; >+ } >+ >+ #container { >+ position: absolute; >+ top: 10px; >+ border: 4px solid green; >+ padding: 10px; >+ } >+ >+ #container.fixed { >+ position: fixed; >+ top: 10px; >+ border: 4px solid orange; >+ } >+ >+ #tree { >+ position: absolute; >+ top: 375px; >+ } >+ </style> >+ <script> >+ if (window.testRunner) { >+ testRunner.waitUntilDone(); >+ testRunner.dumpAsText(); >+ window.internals.settings.setScrollingTreeIncludesFrames(true); >+ } >+ >+ function startTest() >+ { >+ window.setTimeout(function() { >+ document.getElementById('container').classList.toggle('fixed'); >+ >+ if (window.internals) >+ document.getElementById('tree').innerText = internals.scrollingStateTreeAsText(); >+ >+ if (window.testRunner) >+ testRunner.notifyDone(); >+ >+ }, 0); >+ } >+ >+ window.addEventListener('load', startTest, false); >+ </script> >+</head> >+<body> >+ >+ <div id="container"> >+ <iframe src="resources/doc-with-sticky.html" scrolling="no" width="500" height="300"></iframe> >+ </div> >+<pre id="tree">Scrolling tree goes here</pre> >+</body> >+</html> >diff --git a/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/frames/coordinated-frame-in-fixed-expected.txt b/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/frames/coordinated-frame-in-fixed-expected.txt >index afea881816b6a8c046a5ae19ae1479de2ac19025..bbb4c18871d2dfae769c936416510f6f93dba4d9 100644 >--- a/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/frames/coordinated-frame-in-fixed-expected.txt >+++ b/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/frames/coordinated-frame-in-fixed-expected.txt >@@ -9,16 +9,17 @@ > (children 1 > (Frame scrolling node > (scrollable area size 485 300) >- (contents size 485 1868) >+ (contents size 485 420) > (children 1 > (Sticky node >- (anchor edges: AnchorEdgeTop ) >+ (anchor edges: AnchorEdgeTop AnchorEdgeBottom) > (top offset 10.00) >- (containing block rect 8.00, 10.00 469.00 x 1850.00) >- (sticky box rect 8.00 830.00 100.00 100.00) >+ (bottom offset 10.00) >+ (containing block rect 8.00, 8.00 469.00 x 404.00) >+ (sticky box rect 8.00 312.00 100.00 100.00) > (constraining rect 0.00 0.00 485.00 300.00) >- (sticky offset at last layout 0.00 0.00) >- (layer position at last layout 8.00 830.00) >+ (sticky offset at last layout 0.00 -122.00) >+ (layer position at last layout 8.00 190.00) > ) > ) > ) >diff --git a/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/frames/coordinated-frame-lose-scrolling-ancestor-expected.txt b/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/frames/coordinated-frame-lose-scrolling-ancestor-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..d0b3fbc6db1aa6aa380d2e7090107f32ec067313 >--- /dev/null >+++ b/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/frames/coordinated-frame-lose-scrolling-ancestor-expected.txt >@@ -0,0 +1,23 @@ >+(Frame scrolling node >+ (scrollable area size 785 600) >+ (contents size 785 1016) >+ (children 1 >+ (Frame scrolling node >+ (scrollable area size 500 300) >+ (contents size 500 420) >+ (children 1 >+ (Sticky node >+ (anchor edges: AnchorEdgeTop AnchorEdgeBottom) >+ (top offset 10.00) >+ (bottom offset 10.00) >+ (containing block rect 8.00, 8.00 484.00 x 404.00) >+ (sticky box rect 8.00 312.00 100.00 100.00) >+ (constraining rect 0.00 0.00 500.00 300.00) >+ (sticky offset at last layout 0.00 -122.00) >+ (layer position at last layout 8.00 190.00) >+ ) >+ ) >+ ) >+ ) >+) >+ >diff --git a/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/frames/coordinated-frame-lose-scrolling-ancestor.html b/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/frames/coordinated-frame-lose-scrolling-ancestor.html >new file mode 100644 >index 0000000000000000000000000000000000000000..f226d06872bf07e5cc5ca6c172d6f3ce700495c9 >--- /dev/null >+++ b/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/frames/coordinated-frame-lose-scrolling-ancestor.html >@@ -0,0 +1,64 @@ >+<!DOCTYPE html> >+<html> >+<head> >+ <style> >+ body { >+ height: 1000px; >+ } >+ >+ iframe { >+ display: block; >+ margin: 10px; >+ border: 5px solid black; >+ } >+ >+ #container { >+ position: absolute; >+ top: 10px; >+ border: 4px solid green; >+ padding: 10px; >+ } >+ >+ #container.fixed { >+ position: fixed; >+ top: 10px; >+ border: 4px solid orange; >+ } >+ >+ #tree { >+ position: absolute; >+ top: 375px; >+ } >+ </style> >+ <script> >+ if (window.testRunner) { >+ testRunner.waitUntilDone(); >+ testRunner.dumpAsText(); >+ window.internals.settings.setScrollingTreeIncludesFrames(true); >+ } >+ >+ function startTest() >+ { >+ window.setTimeout(function() { >+ document.getElementById('container').classList.toggle('fixed'); >+ >+ if (window.internals) >+ document.getElementById('tree').innerText = internals.scrollingStateTreeAsText(); >+ >+ if (window.testRunner) >+ testRunner.notifyDone(); >+ >+ }, 0); >+ } >+ >+ window.addEventListener('load', startTest, false); >+ </script> >+</head> >+<body> >+ >+ <div id="container" class="fixed"> >+ <iframe src="resources/doc-with-sticky.html" scrolling="no" width="500" height="300"></iframe> >+ </div> >+<pre id="tree">Scrolling tree goes here</pre> >+</body> >+</html> >diff --git a/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/frames/remove-coordinated-frame-expected.txt b/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/frames/remove-coordinated-frame-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..87c8ba6eca0c5d68c5b63ca831256afd3df78891 >--- /dev/null >+++ b/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/frames/remove-coordinated-frame-expected.txt >@@ -0,0 +1,14 @@ >+(Frame scrolling node >+ (scrollable area size 785 600) >+ (contents size 785 1016) >+ (children 1 >+ (Fixed node >+ (anchor edges: AnchorEdgeLeft AnchorEdgeTop) >+ (viewport rect at last layout: 0.00 0.00 785.00 600.00) >+ (layer position at last layout 8.00 10.00) >+ (children 0 >+ ) >+ ) >+ ) >+) >+ >diff --git a/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/frames/remove-coordinated-frame.html b/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/frames/remove-coordinated-frame.html >new file mode 100644 >index 0000000000000000000000000000000000000000..2c8744368c712d5e9ad2b0e9b7e3d2b6a7411866 >--- /dev/null >+++ b/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/frames/remove-coordinated-frame.html >@@ -0,0 +1,65 @@ >+<!DOCTYPE html> >+<html> >+<head> >+ <style> >+ body { >+ height: 1000px; >+ } >+ >+ iframe { >+ display: block; >+ margin: 10px; >+ border: 5px solid black; >+ } >+ >+ #container { >+ position: absolute; >+ top: 10px; >+ border: 4px solid green; >+ padding: 10px; >+ } >+ >+ #container.fixed { >+ position: fixed; >+ top: 10px; >+ border: 4px solid orange; >+ } >+ >+ #tree { >+ position: absolute; >+ top: 375px; >+ } >+ </style> >+ <script> >+ if (window.testRunner) { >+ testRunner.waitUntilDone(); >+ testRunner.dumpAsText(); >+ window.internals.settings.setScrollingTreeIncludesFrames(true); >+ } >+ >+ function startTest() >+ { >+ window.setTimeout(function() { >+ var iframe = document.getElementById('iframe'); >+ iframe.remove(); >+ >+ if (window.internals) >+ document.getElementById('tree').innerText = internals.scrollingStateTreeAsText(); >+ >+ if (window.testRunner) >+ testRunner.notifyDone(); >+ >+ }, 0); >+ } >+ >+ window.addEventListener('load', startTest, false); >+ </script> >+</head> >+<body> >+ >+ <div id="container" class="fixed"> >+ <iframe id="iframe" src="resources/doc-with-sticky.html" scrolling="no" width="500" height="300"></iframe> >+ </div> >+<pre id="tree">Scrolling tree goes here</pre> >+</body> >+</html> >diff --git a/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/frames/resources/doc-with-sticky.html b/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/frames/resources/doc-with-sticky.html >index e8bef59b9188cfc664cb5f5adc4bd5d432c63757..7bbd2bb4335fc124375f9b2b56e467151181e63d 100644 >--- a/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/frames/resources/doc-with-sticky.html >+++ b/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/frames/resources/doc-with-sticky.html >@@ -9,6 +9,14 @@ > background-color: blue; > } > >+ .scrolling { >+ height: 300px; >+ width: 400px; >+ overflow: scroll; >+ -webkit-overflow-scrolling: touch; >+ border: 2px solid black; >+ } >+ > .spacer { > height: 400px; > margin: 10px; >@@ -17,6 +25,7 @@ > .sticky { > position: -webkit-sticky; > top: 10px; >+ bottom: 10px; > } > > .composited { >@@ -25,11 +34,14 @@ > </style> > </head> > <body> >- <div class="spacer"></div> >- <div class="spacer"></div> >+ <div class="composited scrolling"> >+ <div class="spacer"></div> >+ <div class="spacer"></div> >+ <div class="sticky box"></div> >+ <div class="spacer"></div> >+ <div class="spacer"></div> >+ </div> > <div class="sticky box"></div> >- <div class="spacer"></div> >- <div class="spacer"></div> >- <div class="composited box"></div> >+ > </body> > </html>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
thorton
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 134085
:
233401
| 233435