https://bugs.webkit.org/show_bug.cgi?id=147215
Reviewed by Brent Fulgham.
Source/WebCore:
Fixes the way we append the snap offsets of child elements with coordinates. We
now consider the scroll offset of the parent scroll snapping container, so snap
offset recomputations don't fail on scroll snapping containers.
Test: css3/scroll-snap/scroll-snap-coordinate-overflow-resize.html
* page/scrolling/AxisScrollSnapOffsets.cpp:
(WebCore::appendChildSnapOffsets): Fixed to consider the scroll offset of the
parent container.
LayoutTests:
Tests that snap offsets update properly on scrolled containers.
* css3/scroll-snap/scroll-snap-coordinate-overflow-resize-expected.txt: Added.
* css3/scroll-snap/scroll-snap-coordinate-overflow-resize.html: Added.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@187210
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2015-07-22 Wenson Hsieh <wenson_hsieh@apple.com>
+
+ Coordinates-based snap offsets don't update correctly when container is scrolled
+ https://bugs.webkit.org/show_bug.cgi?id=147215
+
+ Reviewed by Brent Fulgham.
+
+ Tests that snap offsets update properly on scrolled containers.
+
+ * css3/scroll-snap/scroll-snap-coordinate-overflow-resize-expected.txt: Added.
+ * css3/scroll-snap/scroll-snap-coordinate-overflow-resize.html: Added.
+
2015-07-22 Myles C. Maxfield <mmaxfield@apple.com>
[El Capitan] Test Gardening
--- /dev/null
+PASS successfullyParsed is true
+
+TEST COMPLETE
+Scroll-snap offsets: vertical = { 0, 400, 800, 1200, 1600, 2000 }
+Scroll-snap offsets: vertical = { 0, 400, 800, 1200, 1600, 2000 }
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
--- /dev/null
+<html>
+
+<head>
+ <style>
+ #container {
+ width: 420px;
+ height: 400px;
+ overflow-y: scroll;
+ -webkit-scroll-snap-type: mandatory;
+ }
+
+ .cell {
+ width: 400px;
+ height: 400px;
+ -webkit-scroll-snap-coordinate: 0% 0%;
+ }
+ </style>
+ <script src="../../resources/js-test-pre.js"></script>
+ <script>
+ function setup()
+ {
+ var container = document.getElementById("container");
+
+ function dumpSnapOffsetsAndFinishTest()
+ {
+ debug("Scroll-snap offsets: " + window.internals.scrollSnapOffsets(container));
+ finishJSTest();
+ }
+
+ function dumpSnapOffsetsAndResizeElement()
+ {
+ debug("Scroll-snap offsets: " + window.internals.scrollSnapOffsets(container));
+ container.style.width = "425px";
+ setTimeout(dumpSnapOffsetsAndFinishTest, 0);
+ }
+
+ container.scrollTop = 800;
+ if (window.testRunner) {
+ window.jsTestIsAsync = true;
+ testRunner.dumpAsText();
+ testRunner.waitUntilDone();
+ setTimeout(dumpSnapOffsetsAndResizeElement, 0);
+ }
+ }
+ </script>
+</head>
+
+<body onload="setup()">
+ <div id="container">
+ <div class="cell"><div id="console"></div></div>
+ <div class="cell"></div>
+ <div class="cell"></div>
+ <div class="cell"></div>
+ <div class="cell"></div>
+ <div class="cell"></div>
+ </div>
+ <script src="../../resources/js-test-post.js"></script>
+</body>
+
+</html>
+2015-07-22 Wenson Hsieh <wenson_hsieh@apple.com>
+
+ Coordinates-based snap offsets don't update correctly when container is scrolled
+ https://bugs.webkit.org/show_bug.cgi?id=147215
+
+ Reviewed by Brent Fulgham.
+
+ Fixes the way we append the snap offsets of child elements with coordinates. We
+ now consider the scroll offset of the parent scroll snapping container, so snap
+ offset recomputations don't fail on scroll snapping containers.
+
+ Test: css3/scroll-snap/scroll-snap-coordinate-overflow-resize.html
+
+ * page/scrolling/AxisScrollSnapOffsets.cpp:
+ (WebCore::appendChildSnapOffsets): Fixed to consider the scroll offset of the
+ parent container.
+
2015-07-22 Matthew Daiter <mdaiter@apple.com>
Needed to add methods to get PreviewCaptureLayers from Video
continue;
LayoutRect viewSize = box->contentBoxRect();
- FloatPoint position = box->localToContainerPoint(FloatPoint(), parent.renderBox());
+ FloatPoint position = box->localToContainerPoint(FloatPoint(parent.renderBox()->scrollLeft(), parent.renderBox()->scrollTop()), parent.renderBox());
for (auto& coordinate : scrollSnapCoordinates) {
LayoutUnit lastPotentialSnapPositionX = position.x() + valueForLength(coordinate.width(), viewSize.width());
if (shouldAddHorizontalChildOffsets && lastPotentialSnapPositionX > 0)