Title: [289810] trunk
Revision
289810
Author
[email protected]
Date
2022-02-15 06:53:00 -0800 (Tue, 15 Feb 2022)

Log Message

Scrolling while focusing an element should take into account scroll margin
https://bugs.webkit.org/show_bug.cgi?id=235432

Reviewed by Simon Fraser.

Source/WebCore:

No new tests. This is covered by existing WPT tests.

* page/FrameView.cpp:
(WebCore::FrameView::scrollToFocusedElementInternal): Respect the scroll margin
when focusing an element.

LayoutTests:

* TestExpectations: Mark two tests as passing.

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (289809 => 289810)


--- trunk/LayoutTests/ChangeLog	2022-02-15 14:44:59 UTC (rev 289809)
+++ trunk/LayoutTests/ChangeLog	2022-02-15 14:53:00 UTC (rev 289810)
@@ -1,3 +1,12 @@
+2022-02-15  Martin Robinson  <[email protected]>
+
+        Scrolling while focusing an element should take into account scroll margin
+        https://bugs.webkit.org/show_bug.cgi?id=235432
+
+        Reviewed by Simon Fraser.
+
+        * TestExpectations: Mark two tests as passing.
+
 2022-02-15  Gabriel Nava Marino  <[email protected]>
 
         null ptr deref in WebCore::HTMLModelElement::enterFullscreen()

Modified: trunk/LayoutTests/TestExpectations (289809 => 289810)


--- trunk/LayoutTests/TestExpectations	2022-02-15 14:44:59 UTC (rev 289809)
+++ trunk/LayoutTests/TestExpectations	2022-02-15 14:53:00 UTC (rev 289810)
@@ -4605,11 +4605,9 @@
 imported/w3c/web-platform-tests/css/css-scroll-snap/scroll-snap-root-003.html [ ImageOnlyFailure ]
 imported/w3c/web-platform-tests/css/css-scroll-snap/scroll-target-align-001.html [ ImageOnlyFailure ]
 imported/w3c/web-platform-tests/css/css-scroll-snap/scroll-target-align-002.html [ ImageOnlyFailure ]
-imported/w3c/web-platform-tests/css/css-scroll-snap/scroll-target-align-003.html [ ImageOnlyFailure ]
 imported/w3c/web-platform-tests/css/css-scroll-snap/scroll-target-snap-001.html [ ImageOnlyFailure ]
 imported/w3c/web-platform-tests/css/css-scroll-snap/scroll-target-snap-002.html [ ImageOnlyFailure ]
 webkit.org/b/218325 imported/w3c/web-platform-tests/css/css-scroll-snap/scroll-target-margin-001.html [ Pass ImageOnlyFailure ]
-webkit.org/b/218325 imported/w3c/web-platform-tests/css/css-scroll-snap/scroll-target-margin-003.html [ Pass ImageOnlyFailure ]
 
 # Cocoa-only
 http/tests/media/hls/hls-hdr-switch.html [ Skip ]

Modified: trunk/Source/WebCore/ChangeLog (289809 => 289810)


--- trunk/Source/WebCore/ChangeLog	2022-02-15 14:44:59 UTC (rev 289809)
+++ trunk/Source/WebCore/ChangeLog	2022-02-15 14:53:00 UTC (rev 289810)
@@ -1,3 +1,16 @@
+2022-02-15  Martin Robinson  <[email protected]>
+
+        Scrolling while focusing an element should take into account scroll margin
+        https://bugs.webkit.org/show_bug.cgi?id=235432
+
+        Reviewed by Simon Fraser.
+
+        No new tests. This is covered by existing WPT tests.
+
+        * page/FrameView.cpp:
+        (WebCore::FrameView::scrollToFocusedElementInternal): Respect the scroll margin
+        when focusing an element.
+
 2022-02-15  Antoine Quint  <[email protected]>
 
         REGRESSION(r289216): Crash in DocumentTimeline::animationCanBeRemoved

Modified: trunk/Source/WebCore/page/FrameView.cpp (289809 => 289810)


--- trunk/Source/WebCore/page/FrameView.cpp	2022-02-15 14:44:59 UTC (rev 289809)
+++ trunk/Source/WebCore/page/FrameView.cpp	2022-02-15 14:53:00 UTC (rev 289810)
@@ -2440,7 +2440,7 @@
         return;
 
     bool insideFixed;
-    LayoutRect absoluteBounds = renderer->absoluteAnchorRect(&insideFixed);
+    LayoutRect absoluteBounds = renderer->absoluteAnchorRectWithScrollMargin(&insideFixed);
     renderer->scrollRectToVisible(absoluteBounds, insideFixed, { m_selectionRevealModeForFocusedElement, ScrollAlignment::alignCenterIfNeeded, ScrollAlignment::alignCenterIfNeeded, ShouldAllowCrossOriginScrolling::No });
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to