From a9dfd3e72586bc5e55da31a4e61fd1416cb1920e Mon Sep 17 00:00:00 2001 From: "bfulgham@apple.com" Date: Mon, 16 Mar 2015 05:34:27 +0000 Subject: [PATCH] Scroll snap points are not supported on iframe content https://bugs.webkit.org/show_bug.cgi?id=142582 Source/WebCore: Tested by css3/scroll-snap/scroll-snap-iframe.html Reviewed by Simon Fraser. The scroll snap points were not being applied to the iframe contents because the code that sets up the scroll snap point content is not called for iframes. To correct this, we need to make sure the snap offsets are set during post-frame layout for iframes. We also need to make sure (on Mac) that the scroll animator and timers are updated. * page/FrameView.cpp: (WebCore::FrameView::performPostLayoutTasks): Call 'updateSnapOffsets' if the frame is not a MainFrame. Also notify scroll animators they need to update their snap point settings. LayoutTests: Reviewed by Simon Fraser. * css3/scroll-snap/resources: Added. * css3/scroll-snap/resources/iframe-content.html: Added. * css3/scroll-snap/scroll-snap-iframe-expected.txt: Added. * css3/scroll-snap/scroll-snap-iframe.html: Added. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@181522 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- LayoutTests/ChangeLog | 13 ++++ .../css3/scroll-snap/resources/iframe-content.html | 84 ++++++++++++++++++++++ .../scroll-snap/scroll-snap-iframe-expected.txt | 11 +++ .../css3/scroll-snap/scroll-snap-iframe.html | 27 +++++++ Source/WebCore/ChangeLog | 20 ++++++ Source/WebCore/page/FrameView.cpp | 8 +++ 6 files changed, 163 insertions(+) create mode 100644 LayoutTests/css3/scroll-snap/resources/iframe-content.html create mode 100644 LayoutTests/css3/scroll-snap/scroll-snap-iframe-expected.txt create mode 100644 LayoutTests/css3/scroll-snap/scroll-snap-iframe.html diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog index 0efe55f..c8b4fad 100644 --- a/LayoutTests/ChangeLog +++ b/LayoutTests/ChangeLog @@ -1,3 +1,16 @@ +2015-03-15 Brent Fulgham + + Scroll snap points are not supported on iframe content + https://bugs.webkit.org/show_bug.cgi?id=142582 + + + Reviewed by Simon Fraser. + + * css3/scroll-snap/resources: Added. + * css3/scroll-snap/resources/iframe-content.html: Added. + * css3/scroll-snap/scroll-snap-iframe-expected.txt: Added. + * css3/scroll-snap/scroll-snap-iframe.html: Added. + 2015-03-15 Joseph Pecoraro Web Inspector: Better handle displaying -0 diff --git a/LayoutTests/css3/scroll-snap/resources/iframe-content.html b/LayoutTests/css3/scroll-snap/resources/iframe-content.html new file mode 100644 index 0000000..2af392c --- /dev/null +++ b/LayoutTests/css3/scroll-snap/resources/iframe-content.html @@ -0,0 +1,84 @@ + + + + + + + +
+
+
+
+
+
+
+
+
+
+
+
+
+ + + + diff --git a/LayoutTests/css3/scroll-snap/scroll-snap-iframe-expected.txt b/LayoutTests/css3/scroll-snap/scroll-snap-iframe-expected.txt new file mode 100644 index 0000000..73da020 --- /dev/null +++ b/LayoutTests/css3/scroll-snap/scroll-snap-iframe-expected.txt @@ -0,0 +1,11 @@ +iframe processed all tests successfully. +PASS succeeded is true +PASS successfullyParsed is true + +TEST COMPLETE +Verify that the iframe propery parses snap-point settings. + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + + diff --git a/LayoutTests/css3/scroll-snap/scroll-snap-iframe.html b/LayoutTests/css3/scroll-snap/scroll-snap-iframe.html new file mode 100644 index 0000000..4f1b5ce --- /dev/null +++ b/LayoutTests/css3/scroll-snap/scroll-snap-iframe.html @@ -0,0 +1,27 @@ + + + + + + + +

+ + + + diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog index 26b9489..e00528b 100644 --- a/Source/WebCore/ChangeLog +++ b/Source/WebCore/ChangeLog @@ -1,3 +1,23 @@ +2015-03-15 Brent Fulgham + + Scroll snap points are not supported on iframe content + https://bugs.webkit.org/show_bug.cgi?id=142582 + + + Tested by css3/scroll-snap/scroll-snap-iframe.html + + Reviewed by Simon Fraser. + + The scroll snap points were not being applied to the iframe contents because the code + that sets up the scroll snap point content is not called for iframes. + + To correct this, we need to make sure the snap offsets are set during post-frame layout + for iframes. We also need to make sure (on Mac) that the scroll animator and timers are updated. + + * page/FrameView.cpp: + (WebCore::FrameView::performPostLayoutTasks): Call 'updateSnapOffsets' if the frame is not a + MainFrame. Also notify scroll animators they need to update their snap point settings. + 2015-03-15 Simon Fraser Add the same is test to KeyframeAnimation::computeExtentOfTransformAnimation() diff --git a/Source/WebCore/page/FrameView.cpp b/Source/WebCore/page/FrameView.cpp index 229c8a9..6e0a9a9 100644 --- a/Source/WebCore/page/FrameView.cpp +++ b/Source/WebCore/page/FrameView.cpp @@ -2976,6 +2976,14 @@ void FrameView::performPostLayoutTasks() sendResizeEventIfNeeded(); viewportContentsChanged(); + +#if ENABLE(CSS_SCROLL_SNAP) + if (!frame().isMainFrame()) { + updateSnapOffsets(); + if (ScrollAnimator* scrollAnimator = existingScrollAnimator()) + return scrollAnimator->updateScrollAnimatorsAndTimers(); + } +#endif } IntSize FrameView::sizeForResizeEvent() const -- 1.8.3.1