Skip to content

Google Docs: Typing in "Hindi - InScript" can result in an unexpected beep - #65534

Merged
webkit-commit-queue merged 1 commit into
WebKit:mainfrom
rniwa:fix315421-hindi-beep
May 24, 2026
Merged

webkit-commit-queue merged 1 commit into
WebKit:mainfrom
rniwa:fix315421-hindi-beep

Conversation

@rniwa

@rniwa rniwa commented May 23, 2026 •

Copy link
Copy Markdown
Member

abcaf42

Google Docs: Typing in "Hindi - InScript" can result in an unexpected beep
https://bugs.webkit.org/show_bug.cgi?id=315421
rdar://177643899

Reviewed by Wenson Hsieh.

The bug was caused by the missing check for defaultPrevented and defaultHandled for keypress event
when we take an early exit.

Test: TestWebKitAPI.WKWebViewMacEditingTests.HindiInScriptViramaConjunctReportsKeystrokeHandled

* Source/WebCore/page/EventHandler.cpp:
(WebCore::EventHandler::internalKeyEvent):
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/mac/WKWebViewMacEditingTests.mm:
(-[KeyableBorderlessWindow canBecomeKeyWindow]):
(-[KeyableBorderlessWindow unhandledKeyDownCount]):
(-[KeyableBorderlessWindow noResponderFor:]):
(TestWebKitAPI::TEST(WKWebViewMacEditingTests, HindiInScriptViramaConjunctReportsKeystrokeHandled)):

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

ca36bcd

Misc iOS, visionOS, tvOS & watchOS macOS Linux Windows Apple Internal
✅ 🧪 style ✅ 🛠 ios ✅ 🛠 mac ✅ 🛠 wpe ✅ 🛠 win ✅ 🛠 ios-apple
✅ 🧪 bindings ✅ 🛠 ios-sim ✅ 🛠 mac-AS-debug ✅ 🧪 wpe-wk2 ❌ 🧪 win-tests ✅ 🛠 mac-apple
✅ 🧪 webkitperl ✅ 🧪 ios-wk2 ✅ 🧪 api-mac ✅ 🧪 api-wpe ✅ 🛠 vision-apple
✅ 🧪 ios-wk2-wpt ✅ 🧪 api-mac-debug ✅ 🛠 gtk3-libwebrtc
loading-orange 🧪 api-ios ✅ 🧪 mac-wk1 ✅ 🛠 gtk
✅ 🛠 ios-safer-cpp ✅ 🧪 mac-wk2 ✅ 🧪 gtk-wk2
✅ 🛠 vision ✅ 🧪 mac-AS-debug-wk2 ✅ 🧪 api-gtk
loading 🛠 vision-sim ✅ 🧪 mac-wk2-stress ✅ 🛠 playstation
✅ 🛠 🧪 unsafe-merge ✅ 🧪 vision-wk2 ✅ 🧪 mac-intel-wk2
✅ 🛠 tv ✅ 🛠 mac-safer-cpp
✅ 🛠 tv-sim ✅ 🧪 mac-site-isolation
✅ 🛠 watch
✅ 🛠 watch-sim

@rniwa
rniwa requested review from cdumez and rr-codes as code owners May 23, 2026 12:13
@rniwa rniwa self-assigned this May 23, 2026
@rniwa rniwa added the New Bugs Unclassified bugs are placed in this component until the correct component can be determined. label May 23, 2026
}

RetainPtr webView = adoptNS([[TestWebViewWithMockTextInputContext alloc] initWithFrame:NSMakeRect(0, 0, 400, 400) configuration:configuration.get()]);
// WebViewImpl::doneWithKeyEvent issues when eventWasHandled=false — meaning

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit - I wonder if we should avoid referencing specific implementation method names from API tests; it seems like it might be easy for these to fall out of sync, in the case where doneWithKeyEvent is renamed.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, Claude likes to add these lengthy comments. I've got rid of this comment, and shortened the comment below to just this:

The Hindi InScript "/" keystroke goes through the partial-prefix path: the input method commits the marked virama via insertText:"\u094D" and the layout pass appends insertText:"\u092F". We need to prevent NSEvent from bubbling up to [NSApp sendEvent:] which beeps.

@rniwa
rniwa force-pushed the fix315421-hindi-beep branch from 49fb203 to ca36bcd Compare May 23, 2026 21:01
@rniwa rniwa added the unsafe-merge-queue Applied to send a pull request to merge-queue, but skip building and testing label May 24, 2026
… beep

https://bugs.webkit.org/show_bug.cgi?id=315421
rdar://177643899

Reviewed by Wenson Hsieh.

The bug was caused by the missing check for defaultPrevented and defaultHandled for keypress event
when we take an early exit.

Test: TestWebKitAPI.WKWebViewMacEditingTests.HindiInScriptViramaConjunctReportsKeystrokeHandled

* Source/WebCore/page/EventHandler.cpp:
(WebCore::EventHandler::internalKeyEvent):
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/mac/WKWebViewMacEditingTests.mm:
(-[KeyableBorderlessWindow canBecomeKeyWindow]):
(-[KeyableBorderlessWindow unhandledKeyDownCount]):
(-[KeyableBorderlessWindow noResponderFor:]):
(TestWebKitAPI::TEST(WKWebViewMacEditingTests, HindiInScriptViramaConjunctReportsKeystrokeHandled)):

Canonical link: https://commits.webkit.org/313813@main
@webkit-commit-queue

Copy link
Copy Markdown
Collaborator

Committed 313813@main (abcaf42): https://commits.webkit.org/313813@main

Reviewed commits have been landed. Closing PR #65534 and removing active labels.

@webkit-commit-queue
webkit-commit-queue merged commit abcaf42 into WebKit:main May 24, 2026
@webkit-commit-queue webkit-commit-queue removed the unsafe-merge-queue Applied to send a pull request to merge-queue, but skip building and testing label May 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

New Bugs Unclassified bugs are placed in this component until the correct component can be determined.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants