Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: fcdd03e33701a8948bed416ed776519b15a1f7d2
https://github.com/WebKit/WebKit/commit/fcdd03e33701a8948bed416ed776519b15a1f7d2
Author: Fujii Hironori <[email protected]>
Date: 2026-10-14 (Wed, 14 Oct 2026)
Changed paths:
M Source/WebCore/html/HTMLTextFormControlElement.cpp
M Source/WebCore/page/ChromeClient.h
M Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp
M Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h
M Source/WebKit/WebProcess/WebPage/WebPage.h
M Source/WebKit/WebProcess/WebPage/glib/WebPageGLib.cpp
M Tools/TestWebKitAPI/Tests/WebKit/WKWebView/glib/TestInputMethodContext.cpp
Log Message:
-----------
[GTK][WPE] Update the input method state when readonly changes on the focused
element
https://bugs.webkit.org/show_bug.cgi?id=326933
Reviewed by Carlos Garcia Campos.
A read-only text field gets no input method state, so the input method is
disabled while it has the focus. The state was only computed when the focus
changed, so if a page changed the readonly attribute of the focused field, a
field that became editable stayed without the input method, and a field that
became read-only kept it.
Add ChromeClient::focusedElementDidChangeReadOnly(), called by
HTMLTextFormControlElement::readOnlyStateChanged() for the focused element in
the same way as focusedElementDidChangeInputMode(), and set the input method
state again from it on GTK and WPE. The embedder sees a focus out when the
field becomes read-only and a focus in when it becomes editable again. Only GTK
and WPE use it, so the new code is limited to these ports.
Other changes on the focused element that affect the input method state are
still not notified. The type change of an input, used for example to reveal a
password, is tracked in https://bugs.webkit.org/show_bug.cgi?id=327490.
Test: Tools/TestWebKitAPI/Tests/WebKit/WKWebView/glib/TestInputMethodContext.cpp
* Source/WebCore/html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::readOnlyStateChanged):
* Source/WebCore/page/ChromeClient.h:
(WebCore::ChromeClient::focusedElementDidChangeReadOnly):
* Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::focusedElementDidChangeReadOnly):
* Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h:
* Source/WebKit/WebProcess/WebPage/WebPage.h:
* Source/WebKit/WebProcess/WebPage/glib/WebPageGLib.cpp:
(WebKit::WebPage::focusedElementDidChangeReadOnly):
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/glib/TestInputMethodContext.cpp:
(testWebKitInputMethodContextReadOnlyChange):
(beforeAll):
Canonical link: https://commits.webkit.org/323715@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications