Skip to content
Permalink
Browse files
REGRESSION (r241734): ⌥⌘↑ and ⌥⌘↓ no longer navigate to previous/next…
… Reading List article

https://bugs.webkit.org/show_bug.cgi?id=196797
<rdar://problem/48484715>

Reviewed by Simon Fraser.

* UIProcess/ios/WKKeyboardScrollingAnimator.mm:
(-[WKKeyboardScrollingAnimator keyboardScrollForEvent:]):
Validate the set of modifier keys pressed when handling a key event for scrolling:
Ignore key events with multiple modifier keys pressed.
Ignore key events with an invalid modifier key pressed for a given primary key.


Canonical link: https://commits.webkit.org/211094@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244183 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
hortont424 committed Apr 11, 2019
1 parent 47aa1d8 commit 5c9fb29c611a1593c1566f7db4e67515a7de33b0
Showing 2 changed files with 41 additions and 0 deletions.
@@ -1,3 +1,17 @@
2019-04-10 Tim Horton <timothy_horton@apple.com>

REGRESSION (r241734): ⌥⌘↑ and ⌥⌘↓ no longer navigate to previous/next Reading List article
https://bugs.webkit.org/show_bug.cgi?id=196797
<rdar://problem/48484715>

Reviewed by Simon Fraser.

* UIProcess/ios/WKKeyboardScrollingAnimator.mm:
(-[WKKeyboardScrollingAnimator keyboardScrollForEvent:]):
Validate the set of modifier keys pressed when handling a key event for scrolling:
Ignore key events with multiple modifier keys pressed.
Ignore key events with an invalid modifier key pressed for a given primary key.

2019-04-10 Said Abou-Hallawa <sabouhallawa@apple.com>

requestAnimationFrame should execute before the next frame
@@ -219,6 +219,33 @@ - (void)invalidate
BOOL altPressed = event.modifierFlags & WebEventFlagMaskOptionKey;
BOOL cmdPressed = event.modifierFlags & WebEventFlagMaskCommandKey;

// No shortcuts include more than one modifier; we should not eat key events
// that contain more than one modifier because they might be used for other shortcuts.
if (shiftPressed + altPressed + cmdPressed > 1)
return WTF::nullopt;

auto allowedModifiers = ^ WebEventFlags {
switch (key) {
case Key::LeftArrow:
case Key::RightArrow:
return WebEventFlagMaskOptionKey;
case Key::UpArrow:
case Key::DownArrow:
return WebEventFlagMaskOptionKey | WebEventFlagMaskCommandKey;
case Key::PageUp:
case Key::PageDown:
return 0;
case Key::Space:
return WebEventFlagMaskShiftKey;
case Key::Other:
ASSERT_NOT_REACHED();
return 0;
};
}();

if (event.modifierFlags & ~allowedModifiers)
return WTF::nullopt;

auto increment = ^{
switch (key) {
case Key::LeftArrow:

0 comments on commit 5c9fb29

Please sign in to comment.