Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 046a7ef619ff8a1b036690996638a2ca747d22d3
      
https://github.com/WebKit/WebKit/commit/046a7ef619ff8a1b036690996638a2ca747d22d3
  Author: Ahmad Saleem <[email protected]>
  Date:   2026-09-14 (Mon, 14 Sep 2026)

  Changed paths:
    M 
LayoutTests/imported/w3c/web-platform-tests/input-events/input-events-exec-command-expected.txt
    M Source/WebCore/editing/EditCommand.cpp
    M Source/WebCore/editing/Editor.cpp
    M Source/WebCore/editing/EditorCommand.cpp

  Log Message:
  -----------
  execCommand() reports empty inputType for backColor, hiliteColor, fontName, 
and justify commands
https://bugs.webkit.org/show_bug.cgi?id=324062
rdar://187294708

Reviewed by Wenson Hsieh and Ryosuke Niwa.

The InputEvent fired for several execCommand() editing commands reported an
empty `inputType` (and, for background color, no `data`), because either the
EditAction was not mapped to an inputType name or the EditAction was dropped
before the event was dispatched:

- `EditAction::SetBackgroundColor` (backColor, hiliteColor) and
  `EditAction::SetFont` (fontName) exist in the enum but were missing from
  inputTypeNameForEditingAction(), so they fell through to the default and
  produced "" instead of "formatBackColor" / "formatFontName".

- inputEventDataForEditingStyleAndAction() had no case for
  `EditAction::SetBackgroundColor`, so the input event's `data` was empty for
  background color even though it was populated for foreground color.

- executeApplyParagraphStyle()'s EditorCommandSource::DOM path (used by
  document.execCommand) called Editor::applyParagraphStyle() without the
  EditAction argument, so justifyCenter/justifyFull/justifyLeft/justifyRight
  defaulted to EditAction::Unspecified and reported "" instead of
  "formatJustifyCenter" and friends. The MenuOrKeyBinding path already passed
  the action; this aligns the DOM path with it.

* 
LayoutTests/imported/w3c/web-platform-tests/input-events/input-events-exec-command-expected.txt:
 Progressions
* Source/WebCore/editing/EditCommand.cpp:
(WebCore::inputTypeNameForEditingAction):
* Source/WebCore/editing/Editor.cpp:
(WebCore::inputEventDataForEditingStyleAndAction):
* Source/WebCore/editing/EditorCommand.cpp:
(WebCore::executeApplyParagraphStyle):

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



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

Reply via email to