Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 1189a768e05bf12f04b0b0129fa4db48cc30d7c8
      
https://github.com/WebKit/WebKit/commit/1189a768e05bf12f04b0b0129fa4db48cc30d7c8
  Author: Anurag Choudhary <[email protected]>
  Date:   2024-12-06 (Fri, 06 Dec 2024)

  Changed paths:
    M 
LayoutTests/fast/scrolling/ios/scroll-to-beginning-and-end-of-document-expected.txt
    M 
LayoutTests/fast/scrolling/ios/scroll-to-beginning-and-end-of-document.html
    A 
LayoutTests/fast/scrolling/mac/scroll-to-beginning-and-end-of-document-expected.txt
    A 
LayoutTests/fast/scrolling/mac/scroll-to-beginning-and-end-of-document.html
    M Source/WebCore/platform/KeyboardScrollingAnimator.cpp

  Log Message:
  -----------
  Cmd+Shift+Up/Down and Cmd+Opt+Up/Down shouldn't scroll a web page
https://bugs.webkit.org/show_bug.cgi?id=282852
rdar://139537723

Reviewed by Abrar Rahman Protyasha and Wenson Hsieh.

The designated shortcut for "Scroll to Top/Bottom" is Cmd+Up/Down Arrow.
Cmd+Shift/Opt/Ctrl+Up/Down are not valid key combinations for web page
scrolling, and might be designated shortcuts for other actions instead.

We already handled the case where Shift is pressed in 287161@main. This patch
ensures that while handling an Up/Down keyboard event with the Command key
pressed, we return a `Document` scroll granularity from 
`scrollGranularityForKeyboardEvent()`
only if no other modifier is pressed at the same time. If another modifier is
found to be pressed, we don't return a valid granularity so that no scroll
occurs.

Since `shouldBeTrue()`/`shouldBeEqual()` calls in the layout tests lead to debug
output that affects the scroll position, these need to be called with the
`quiet` parameter set to true.

* 
LayoutTests/fast/scrolling/ios/scroll-to-beginning-and-end-of-document-expected.txt:
* LayoutTests/fast/scrolling/ios/scroll-to-beginning-and-end-of-document.html:
* 
LayoutTests/fast/scrolling/mac/scroll-to-beginning-and-end-of-document-expected.txt:
 Copied from 
LayoutTests/fast/scrolling/ios/scroll-to-beginning-and-end-of-document-expected.txt.
* LayoutTests/fast/scrolling/mac/scroll-to-beginning-and-end-of-document.html: 
Added.
* Source/WebCore/platform/KeyboardScrollingAnimator.cpp:
(WebCore::scrollGranularityForKeyboardEvent):

Canonical link: https://commits.webkit.org/287437@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to