Changeset 278868 in webkit
- Timestamp:
- Jun 15, 2021 4:09:34 AM (13 months ago)
- Location:
- trunk
- Files:
-
- 2 added
- 4 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/TestExpectations (modified) (1 diff)
-
LayoutTests/css3/scroll-snap/scroll-snap-right-to-left-initial-snapping-expected.txt (added)
-
LayoutTests/css3/scroll-snap/scroll-snap-right-to-left-initial-snapping.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/platform/ScrollableArea.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r278866 r278868 1 2021-06-15 Martin Robinson <mrobinson@igalia.com> 2 3 [css-scroll-snap] Scroll snap offsets are interpreted as scroll positions in ScrollableArea 4 https://bugs.webkit.org/show_bug.cgi?id=226572 5 6 Reviewed by Simon Fraser. 7 8 * TestExpectations: Mark test as newly passing. 9 * css3/scroll-snap/scroll-snap-right-to-left-initial-snapping-expected.txt: Added. 10 * css3/scroll-snap/scroll-snap-right-to-left-initial-snapping.html: Added. 11 1 12 2021-06-15 Enrique Ocaña González <eocanha@igalia.com> 2 13 -
trunk/LayoutTests/TestExpectations
r278862 r278868 4554 4554 imported/w3c/web-platform-tests/css/css-scroll-snap/scroll-target-snap-001.html [ ImageOnlyFailure ] 4555 4555 imported/w3c/web-platform-tests/css/css-scroll-snap/scroll-target-snap-002.html [ ImageOnlyFailure ] 4556 imported/w3c/web-platform-tests/css/css-scroll-snap/snap-after-initial-layout/direction-rtl.html [ ImageOnlyFailure ]4557 4556 imported/w3c/web-platform-tests/css/css-scroll-snap/snap-after-initial-layout/scroll-snap-writing-mode-000.html [ ImageOnlyFailure ] 4558 4557 webkit.org/b/218325 imported/w3c/web-platform-tests/css/css-scroll-snap/scroll-target-margin-001.html [ Pass ImageOnlyFailure ] -
trunk/Source/WebCore/ChangeLog
r278865 r278868 1 2021-06-15 Martin Robinson <mrobinson@igalia.com> 2 3 [css-scroll-snap] Scroll snap offsets are interpreted as scroll positions in ScrollableArea 4 https://bugs.webkit.org/show_bug.cgi?id=226572 5 6 Reviewed by Simon Fraser. 7 8 Test: css3/scroll-snap/scroll-snap-right-to-left-initial-snapping.html 9 10 This is also covered by existing WPT tests, but these tests are composite reference 11 tests where there are still some failing elements. 12 13 * platform/ScrollableArea.cpp: 14 (WebCore::ScrollableArea::nearestActiveSnapPoint): Use scroll offsets instead of positions. 15 (WebCore::ScrollableArea::updateScrollSnapState): Ditto. 16 1 17 2021-05-31 Sergio Villar Senin <svillar@igalia.com> 2 18 -
trunk/Source/WebCore/platform/ScrollableArea.cpp
r278862 r278868 529 529 return; 530 530 531 IntPoint currentPosition = scrollPosition();532 IntPoint correctedPosition = currentPosition;531 auto currentOffset = scrollOffset(); 532 auto correctedOffset = currentOffset; 533 533 const auto& horizontal = info->horizontalSnapOffsets; 534 534 auto activeHorizontalIndex = currentHorizontalSnapPointIndex(); 535 535 if (activeHorizontalIndex < horizontal.size()) 536 corrected Position.setX(horizontal[activeHorizontalIndex].offset.toInt());536 correctedOffset.setX(horizontal[activeHorizontalIndex].offset.toInt()); 537 537 538 538 const auto& vertical = info->verticalSnapOffsets; 539 539 auto activeVerticalIndex = currentVerticalSnapPointIndex(); 540 540 if (activeVerticalIndex < vertical.size()) 541 corrected Position.setY(vertical[activeVerticalIndex].offset.toInt());542 543 if (corrected Position != currentPosition) {544 LOG_WITH_STREAM(ScrollSnap, stream << " adjusting position from " << currentPosition << " to " << correctedPosition);545 scrollTo PositionWithoutAnimation(correctedPosition);541 correctedOffset.setY(vertical[activeVerticalIndex].offset.toInt()); 542 543 if (correctedOffset != currentOffset) { 544 LOG_WITH_STREAM(ScrollSnap, stream << " adjusting offset from " << currentOffset << " to " << correctedOffset); 545 scrollToOffsetWithoutAnimation(correctedOffset); 546 546 } 547 547 }
Note: See TracChangeset
for help on using the changeset viewer.