Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 958f4375433b5c5cfad045340432774ca115e9a0
https://github.com/WebKit/WebKit/commit/958f4375433b5c5cfad045340432774ca115e9a0
Author: Richard Robinson <[email protected]>
Date: 2024-09-18 (Wed, 18 Sep 2024)
Changed paths:
M Source/WebCore/editing/cocoa/HTMLConverter.mm
M Source/WebCore/page/writing-tools/WritingToolsController.mm
M Tools/TestWebKitAPI/Tests/WebKitCocoa/WritingTools.mm
Log Message:
-----------
[Writing Tools] Lists are sometimes erroneously preserved after performing a
Rewrite
https://bugs.webkit.org/show_bug.cgi?id=279907
rdar://136234063
Reviewed by Abrar Rahman Protyasha and Aditya Keerthi.
When rewriting some content that has lists within it, the tab characters
preceding and succeeding the tab bullet
points mistakenly get the `WTWritingToolsPreserved` attribute applied to them.
This is because currently, all elements
with `whitespace:pre` have the attribute added. However, tabs are unique
because when inserting a tab character, WebKit
automatically generates a span and applies the `whitespace:pre` property to it.
Fix by checking for this special case and avoiding the attribute.
This fix also has the benefit of slightly improving the rewrite animations,
since there are less partial replacements
involved now.
Also add a test.
* Source/WebCore/editing/cocoa/HTMLConverter.mm:
(elementQualifiesForWritingToolsPreservation):
(hasAncestorQualifyingForWritingToolsPreservation):
* Source/WebCore/page/writing-tools/WritingToolsController.mm:
(WebCore::WritingToolsController::compositionSessionDidReceiveTextWithReplacementRange):
* Tools/TestWebKitAPI/Tests/WebKitCocoa/WritingTools.mm:
(TEST(WritingTools, CompositionWithTabCharacters)):
Canonical link: https://commits.webkit.org/283883@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes