Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 51dde913fc8d73958d25795795d6507e002b67bc
      
https://github.com/WebKit/WebKit/commit/51dde913fc8d73958d25795795d6507e002b67bc
  Author: j0pan <[email protected]>
  Date:   2026-02-27 (Fri, 27 Feb 2026)

  Changed paths:
    A 
LayoutTests/editing/execCommand/format-block-preserves-inline-style-expected.txt
    A LayoutTests/editing/execCommand/format-block-preserves-inline-style.html
    M 
LayoutTests/imported/w3c/web-platform-tests/editing/run/formatblock_4001-5000-expected.txt
    M Source/WebCore/editing/FormatBlockCommand.cpp

  Log Message:
  -----------
  execCommand('FormatBlock') does not preserve inline styles of the replaced 
block elements
https://bugs.webkit.org/show_bug.cgi?id=47054
rdar://157657531

Reviewed by Ryosuke Niwa.

When execCommand("formatBlock") converts one block element to another
(e.g. <p> to <div>), copy the style attribute from the original element
to the new one so inline styles like color and font-size are preserved.

Test: editing/execCommand/format-block-preserves-inline-style.html

* 
LayoutTests/editing/execCommand/format-block-preserves-inline-style-expected.txt:
 Added.
* LayoutTests/editing/execCommand/format-block-preserves-inline-style.html: 
Added.
* 
LayoutTests/imported/w3c/web-platform-tests/editing/run/formatblock_4001-5000-expected.txt:
* Source/WebCore/editing/FormatBlockCommand.cpp:
(WebCore::FormatBlockCommand::formatRange):

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



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

Reply via email to