CSS scroll snap: defining snap points on axis that does not scroll does not work...
authorbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 17 Jun 2015 18:32:24 +0000 (18:32 +0000)
committerbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 17 Jun 2015 18:32:24 +0000 (18:32 +0000)
commit3c0c64f1b6b5ce9162c5c63410cae46548b1ec8f
tree36dccc8de12f49829a977dbb97dc597dd6dfc6f7
parent5ac7450d369b506249a56342945a827dd8d01ad8
CSS scroll snap: defining snap points on axis that does not scroll does not work properly
https://bugs.webkit.org/show_bug.cgi?id=146043
<rdar://problem/20125511>

Reviewed by Simon Fraser.

Source/WebCore:

Tested by css3/scroll-snap/scroll-snap-mismatch.html

We always seed the set of scroll snap points with the start and end of the scroll container. This is not
the right behavior if there are no scroll points defined, because we end up creating a snap for the start
and end of the container, and any scroll gesture just takes us across the entire element.

Instead, when we do not find any scroll snap points, we should clear the snap point state for the container.

* page/scrolling/AxisScrollSnapOffsets.cpp:
(WebCore::updateFromStyle): If we did not find any snap points (i.e., the snapOffsets container
only holds '0', return an empty Vector.
(WebCore::updateSnapOffsetsForScrollableArea): If the set of snap points produced by 'updateFromStyle' is empty,
clear the horizontal (or vertical) snap offsets for the scroll area.

LayoutTests:

* css3/scroll-snap/scroll-snap-mismatch-expected.txt: Added.
* css3/scroll-snap/scroll-snap-mismatch.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@185658 268f45cc-cd09-0410-ab3c-d52691b4dbfc
18 files changed:
LayoutTests/ChangeLog
LayoutTests/css3/scroll-snap/scroll-snap-mismatch-expected.txt [new file with mode: 0644]
LayoutTests/css3/scroll-snap/scroll-snap-mismatch.html [new file with mode: 0644]
Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
Source/ThirdParty/ANGLE/ANGLE.xcodeproj/project.pbxproj
Source/ThirdParty/gtest/xcode/gtest.xcodeproj/project.pbxproj
Source/WTF/WTF.xcodeproj/project.pbxproj
Source/WebCore/ChangeLog
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/page/scrolling/AxisScrollSnapOffsets.cpp
Source/WebInspectorUI/WebInspectorUI.xcodeproj/project.pbxproj
Source/WebKit/WebKit.xcodeproj/project.pbxproj
Source/WebKit2/WebKit2.xcodeproj/project.pbxproj
Source/bmalloc/bmalloc.xcodeproj/project.pbxproj
Tools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj
Tools/MiniBrowser/MiniBrowser.xcodeproj/project.pbxproj
Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
Tools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj