WebKit Bugzilla
Attachment 369038 Details for
Bug 197590
: [macOS] Fix programmatic scrolling with async overflow scroll
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-197590-20190503202949.patch (text/plain), 9.40 KB, created by
Simon Fraser (smfr)
on 2019-05-03 20:29:50 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Simon Fraser (smfr)
Created:
2019-05-03 20:29:50 PDT
Size:
9.40 KB
patch
obsolete
>Subversion Revision: 244862 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 1f7b771dc02236fcb438311c22a10757840efccf..2b4bfe2118888d1127de1e454dfdfd17c3f5da97 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,18 @@ >+2019-05-03 Simon Fraser <simon.fraser@apple.com> >+ >+ [macOS] Fix programmatic scrolling with async overflow scroll >+ https://bugs.webkit.org/show_bug.cgi?id=197590 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ ScrollingTreeOverflowScrollingNodeMac needs to handle RequestedScrollPosition. >+ >+ Tests: scrollingcoordinator/mac/programmatic-frame-scroll.html >+ scrollingcoordinator/mac/programmatic-overflow-scroll.html >+ >+ * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm: >+ (WebCore::ScrollingTreeOverflowScrollingNodeMac::commitStateAfterChildren): >+ > 2019-05-01 Youenn Fablet <youenn@apple.com> > > Add back hasNullReferences() assert in Document::updateIsPlayingMedia >diff --git a/Source/WebCore/page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm b/Source/WebCore/page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm >index 5b43a1804bb760b90917f74bb164db252874a545..208a45bd628bb8590c1e1f0792eb0564e7d008e8 100644 >--- a/Source/WebCore/page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm >+++ b/Source/WebCore/page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm >@@ -57,8 +57,13 @@ void ScrollingTreeOverflowScrollingNodeMac::commitStateBeforeChildren(const Scro > void ScrollingTreeOverflowScrollingNodeMac::commitStateAfterChildren(const ScrollingStateNode& stateNode) > { > ScrollingTreeOverflowScrollingNode::commitStateAfterChildren(stateNode); >- >- // FIXME: RequestedScrollPosition etc. >+ >+ const auto& overflowStateNode = downcast<ScrollingStateOverflowScrollingNode>(stateNode); >+ >+ if (overflowStateNode.hasChangedProperty(ScrollingStateScrollingNode::RequestedScrollPosition)) { >+ auto scrollType = overflowStateNode.requestedScrollPositionRepresentsProgrammaticScroll() ? ScrollType::Programmatic : ScrollType::User; >+ scrollTo(overflowStateNode.requestedScrollPosition(), scrollType); >+ } > } > > ScrollingEventResult ScrollingTreeOverflowScrollingNodeMac::handleWheelEvent(const PlatformWheelEvent& wheelEvent) >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index b7cec96e8b441a03826b364bec25aa37f31102e0..ddd7b9595d4958282b2aa75a52a7d189076269ee 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,17 @@ >+2019-05-03 Simon Fraser <simon.fraser@apple.com> >+ >+ [macOS] Fix programmatic scrolling with async overflow scroll >+ https://bugs.webkit.org/show_bug.cgi?id=197590 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Tests for programmatic scrolling of overflow and iframes. >+ >+ * scrollingcoordinator/mac/programmatic-frame-scroll-expected.html: Added. >+ * scrollingcoordinator/mac/programmatic-frame-scroll.html: Added. >+ * scrollingcoordinator/mac/programmatic-overflow-scroll-expected.html: Added. >+ * scrollingcoordinator/mac/programmatic-overflow-scroll.html: Added. >+ > 2019-05-01 Devin Rousso <drousso@apple.com> > > Unreviewed, fix test failures after r242809. >diff --git a/LayoutTests/scrollingcoordinator/mac/programmatic-frame-scroll-expected.html b/LayoutTests/scrollingcoordinator/mac/programmatic-frame-scroll-expected.html >new file mode 100644 >index 0000000000000000000000000000000000000000..d849972946002c831071319226abed7b5aa45b58 >--- /dev/null >+++ b/LayoutTests/scrollingcoordinator/mac/programmatic-frame-scroll-expected.html >@@ -0,0 +1,45 @@ >+<!DOCTYPE html> <!-- webkit-test-runner [ internal:AsyncFrameScrollingEnabled=true ] --> >+<html> >+<head> >+ <meta name="viewport" content="width=device-width"> >+ <style> >+ body { >+ margin: 0; >+ } >+ iframe { >+ position: relative; >+ margin: 10px; >+ border: none; >+ width: 300px; >+ height: 300px; >+ } >+ .scrollbar-hider { >+ position: absolute; >+ width: 16px; >+ height: 300px; >+ top: 10px; >+ left: calc(310px - 16px); >+ background-color: gray; >+ } >+ </style> >+</head> >+<body> >+ <iframe id="test-frame" srcdoc=" >+ <style> >+ body { >+ height: 2000px; >+ margin: 0; >+ } >+ .box { >+ width: 300px; >+ height: 300px; >+ background-color: green; >+ } >+ </style> >+ <body> >+ <div class='box'></div> >+ </body> >+ "></iframe> >+ <div class="scrollbar-hider"></div> >+</body> >+</html> >diff --git a/LayoutTests/scrollingcoordinator/mac/programmatic-frame-scroll.html b/LayoutTests/scrollingcoordinator/mac/programmatic-frame-scroll.html >new file mode 100644 >index 0000000000000000000000000000000000000000..a22b6c90da956d36415eb73bd2293381b4dab9b8 >--- /dev/null >+++ b/LayoutTests/scrollingcoordinator/mac/programmatic-frame-scroll.html >@@ -0,0 +1,54 @@ >+<!DOCTYPE html> <!-- webkit-test-runner [ internal:AsyncFrameScrollingEnabled=true ] --> >+<html> >+<head> >+ <style> >+ body { >+ margin: 0; >+ } >+ iframe { >+ position: relative; >+ margin: 10px; >+ border: none; >+ width: 300px; >+ height: 300px; >+ } >+ .scrollbar-hider { >+ position: absolute; >+ width: 16px; >+ height: 300px; >+ top: 10px; >+ left: calc(310px - 16px); >+ background-color: gray; >+ } >+ </style> >+ <script> >+ function doTest() >+ { >+ let iframe = document.getElementById('test-frame'); >+ iframe.contentDocument.scrollingElement.scrollTop = 300; >+ } >+ >+ window.addEventListener('load', doTest, false); >+ </script> >+</head> >+<body> >+ <iframe id="test-frame" srcdoc=" >+ <style> >+ body { >+ height: 2000px; >+ margin: 0; >+ } >+ .box { >+ margin-top: 300px; >+ width: 300px; >+ height: 300px; >+ background-color: green; >+ } >+ </style> >+ <body> >+ <div class='box'></div> >+ </body> >+ "></iframe> >+ <div class="scrollbar-hider"></div> >+</body> >+</html> >diff --git a/LayoutTests/scrollingcoordinator/mac/programmatic-overflow-scroll-expected.html b/LayoutTests/scrollingcoordinator/mac/programmatic-overflow-scroll-expected.html >new file mode 100644 >index 0000000000000000000000000000000000000000..c25a28abbef33b378d5732f8a60f6ad97c2c58e2 >--- /dev/null >+++ b/LayoutTests/scrollingcoordinator/mac/programmatic-overflow-scroll-expected.html >@@ -0,0 +1,48 @@ >+<!DOCTYPE html> <!-- webkit-test-runner [ internal:AsyncOverflowScrollingEnabled=true ] --> >+<html> >+<head> >+ <meta name="viewport" content="width=device-width"> >+ <style> >+ body { >+ margin: 0; >+ } >+ >+ #scroller { >+ margin: 10px; >+ height: 300px; >+ width: 300px; >+ overflow: scroll; >+ -webkit-overflow-scrolling: touch; >+ } >+ >+ .box { >+ width: 100%; >+ height: 100%; >+ } >+ >+ .top { >+ background-color: green; >+ } >+ >+ .bottom { >+ background-color: green; >+ } >+ >+ .scrollbar-hider { >+ position: absolute; >+ width: 16px; >+ height: 300px; >+ top: 10px; >+ left: calc(310px - 16px); >+ background-color: gray; >+ } >+ </style> >+</head> >+<body> >+ <div id="scroller"> >+ <div class="top box"></div> >+ <div class="bottom box"></div> >+ </div> >+ <div class="scrollbar-hider"></div> >+</body> >+</html> >diff --git a/LayoutTests/scrollingcoordinator/mac/programmatic-overflow-scroll.html b/LayoutTests/scrollingcoordinator/mac/programmatic-overflow-scroll.html >new file mode 100644 >index 0000000000000000000000000000000000000000..c0d7f6549892426896c4cf241df40d8cc816040d >--- /dev/null >+++ b/LayoutTests/scrollingcoordinator/mac/programmatic-overflow-scroll.html >@@ -0,0 +1,55 @@ >+<!DOCTYPE html> <!-- webkit-test-runner [ internal:AsyncOverflowScrollingEnabled=true ] --> >+<html> >+<head> >+ <meta name="viewport" content="width=device-width"> >+ <style> >+ body { >+ margin: 0; >+ } >+ >+ #scroller { >+ margin: 10px; >+ height: 300px; >+ width: 300px; >+ overflow: scroll; >+ } >+ >+ .box { >+ width: 100%; >+ height: 100%; >+ } >+ >+ .top { >+ background-color: red; >+ } >+ >+ .bottom { >+ background-color: green; >+ } >+ >+ .scrollbar-hider { >+ position: absolute; >+ width: 16px; >+ height: 300px; >+ top: 10px; >+ left: calc(310px - 16px); >+ background-color: gray; >+ } >+ </style> >+ <script> >+ function doTest() >+ { >+ scroller.scrollTop = 500; >+ } >+ >+ window.addEventListener('load', doTest, false); >+ </script> >+</head> >+<body> >+ <div id="scroller"> >+ <div class="top box"></div> >+ <div class="bottom box"></div> >+ </div> >+ <div class="scrollbar-hider"></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
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 197590
: 369038 |
369044