[webkit-changes] [WebKit/WebKit] 5f91ee: [Cocoa] Attributed string generation may add unexp...

Aditya Keerthi noreply at github.com
Mon Jun 3 10:35:41 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 5f91eea75bc29b4f5d48f83fc4596afe5e0b149e
      https://github.com/WebKit/WebKit/commit/5f91eea75bc29b4f5d48f83fc4596afe5e0b149e
  Author: Aditya Keerthi <akeerthi at apple.com>
  Date:   2024-06-03 (Mon, 03 Jun 2024)

  Changed paths:
    M Source/WebCore/editing/cocoa/HTMLConverter.mm

  Log Message:
  -----------
  [Cocoa] Attributed string generation may add unexpected underlines
https://bugs.webkit.org/show_bug.cgi?id=275041
rdar://128204838

Reviewed by Richard Robinson and Wenson Hsieh.

`editingAttributedString` generates attributed strings from document ranges using
`TextIterator`. When a renderer with `TextDecorationLine::Underline` is
encountered, `NSUnderlineStyleAttributeName` is added to the attribute dictionary.
However, the attribute dictionary is created outside of the iterative loop and is
reused. Consequently, encountering a single underline currently applies an underline
style to all subsequent text.

Fix by removing `NSUnderlineStyleAttributeName` from the attribute dictionary when
it is not needed. This matches the approach used for other attributes, such as
`NSForegroundColorAttributeName`.

* Source/WebCore/editing/cocoa/HTMLConverter.mm:
(WebCore::editingAttributedString):

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



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


More information about the webkit-changes mailing list