Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: e71ef10bf8471abc8155efd6bf06bdde05ff0a03
      
https://github.com/WebKit/WebKit/commit/e71ef10bf8471abc8155efd6bf06bdde05ff0a03
  Author: Simon Pena <[email protected]>
  Date:   2026-09-28 (Mon, 28 Sep 2026)

  Changed paths:
    A ManualTests/glib/input-method-purpose-and-hints.html
    A Tools/MiniBrowser/glib/BrowserLoggingInputMethodContext.c
    A Tools/MiniBrowser/glib/BrowserLoggingInputMethodContext.h
    M Tools/MiniBrowser/gtk/CMakeLists.txt
    M Tools/MiniBrowser/gtk/main.c
    M Tools/MiniBrowser/wpe/CMakeLists.txt
    M Tools/MiniBrowser/wpe/main.cpp
    M Tools/Scripts/webkitpy/style/checker.py
    M Tools/Scripts/webkitpy/style/checkers/cpp.py

  Log Message:
  -----------
  [GTK][WPE] MiniBrowser cannot show what WebKit reports to the input method
https://bugs.webkit.org/show_bug.cgi?id=324967

Reviewed by Adrian Perez de Castro.

WebKit tells the embedder the input purpose and hints of the focused element, 
where the caret is,
the surrounding text, and when focus moves in and out, but the only way
to see it is to write a program that installs its own WebKitInputMethodContext.

Add a --log-input-method option to MiniBrowser that installs such a context and 
prints what it is
told. The implementation is shared by the GTK and WPE builds. Sharing is 
possible because every
virtual function in WebKitInputMethodContext is optional, so the context can 
skip
filter_key_event, the one whose signature differs between the two ports. Key 
events are passed
straight through and ordinary typing keeps working, but there is no composition 
while the option
is in use.

The purpose and hints are printed once on focus in, and again only if they 
change while the element
is focused, as one line even when both change. The surrounding text itself is 
not printed, only its
size, because it can be long and it can be a password.

MiniBrowser does not use config.h, so exempt it from the style checker rule 
that requires it,
and apply the MiniBrowser style rules to the new shared glib directory.

Add a manual test page with a field for each interesting case, which shows what 
each one should
report so that the page and the log can be read side by side.

* ManualTests/glib/input-method-purpose-and-hints.html: Added.
* Tools/MiniBrowser/glib/BrowserLoggingInputMethodContext.c: Added.
(purposeName):
(hintsDescription):
(logContentType):
(browserLoggingInputMethodContextDispatchPropertiesChanged):
(browserLoggingInputMethodContextSetEnablePreedit):
(browserLoggingInputMethodContextNotifyFocusIn):
(browserLoggingInputMethodContextNotifyFocusOut):
(browserLoggingInputMethodContextNotifyCursorArea):
(browserLoggingInputMethodContextNotifySurrounding):
(browserLoggingInputMethodContextReset):
(browser_logging_input_method_context_class_init):
(browser_logging_input_method_context_init):
(browser_logging_input_method_context_new):
* Tools/MiniBrowser/glib/BrowserLoggingInputMethodContext.h: Added.
* Tools/MiniBrowser/gtk/CMakeLists.txt:
* Tools/MiniBrowser/gtk/main.c:
(createBrowserTab):
* Tools/MiniBrowser/wpe/CMakeLists.txt:
* Tools/MiniBrowser/wpe/main.cpp:
(activate):
* Tools/Scripts/webkitpy/style/checker.py:
* Tools/Scripts/webkitpy/style/checkers/cpp.py:

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to