Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 585d66186f6e55555c359ac442f5caaf1703da59
      
https://github.com/WebKit/WebKit/commit/585d66186f6e55555c359ac442f5caaf1703da59
  Author: Aditya Keerthi <akeer...@apple.com>
  Date:   2024-05-06 (Mon, 06 May 2024)

  Changed paths:
    A LayoutTests/editing/style/apply-font-size-to-picture-expected.txt
    A LayoutTests/editing/style/apply-font-size-to-picture.html
    M Source/WebCore/editing/ApplyStyleCommand.cpp

  Log Message:
  -----------
  Changing font size while the selection is inside a <picture> element breaks 
source selection
https://bugs.webkit.org/show_bug.cgi?id=273782
rdar://123786373

Reviewed by Wenson Hsieh and Ryosuke Niwa.

When changing font properties using editor commands, a <font> element may wrap
the selected nodes. However, when selecting a <picture> element, the selection
is actually around the contained <img>. Consequently, changing the font 
currently
inserts the <font> element as a child of the <picture>. This behavior breaks
source selection, as <picture> elements should only contain <source> and <img>
elements.

Fix by ensuring the <font> element wraps the <picture>.

* LayoutTests/editing/style/apply-font-size-to-picture-expected.txt: Added.
* LayoutTests/editing/style/apply-font-size-to-picture.html: Added.
* Source/WebCore/editing/ApplyStyleCommand.cpp:
(WebCore::ApplyStyleCommand::applyInlineStyleChange):

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to