Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 25f27158a9b49429c8b10ece629fcab48e385851
      
https://github.com/WebKit/WebKit/commit/25f27158a9b49429c8b10ece629fcab48e385851
  Author: Matt Woodrow <[email protected]>
  Date:   2025-04-08 (Tue, 08 Apr 2025)

  Changed paths:
    M Source/WebCore/editing/ApplyStyleCommand.cpp
    M Source/WebCore/editing/DeleteSelectionCommand.cpp
    M Source/WebCore/editing/EditingStyle.cpp
    M Source/WebCore/editing/EditingStyle.h
    M Source/WebCore/editing/InsertParagraphSeparatorCommand.cpp
    M Source/WebKit/WebProcess/WebPage/Cocoa/WebPageCocoa.mm

  Log Message:
  -----------
  WebPage::getPlatformEditorStateCommon can be slow, flushing layout for 
computed styles and parsing string.
https://bugs.webkit.org/show_bug.cgi?id=290955
<rdar://148468929>

Reviewed by Wenson Hsieh.

Converts EditingPropertiesToInclude and PropertiesToInclude to enum classes to
ensure there's never any type confusion on these very similar enums.

Adds a new enum value so that getPlatformEditorStateCommon's call to
styleAtSelectionStart can only copy the subset of properties that it will read.
This prevents copying lots of unrelated properties, some of which can trigger
layout flushes.

Adds new getters for checking some specific styles (like bold, italic etc) to
EditorStyle. This avoids allocating a new EditorStyle, parsing strings into
computed values, and then diffing the two computed styles and instead allows a
fast, direct lookup.

* Source/WebCore/editing/ApplyStyleCommand.cpp:
(WebCore::ApplyStyleCommand::splitAncestorsWithUnicodeBidi):
* Source/WebCore/editing/DeleteSelectionCommand.cpp:
(WebCore::DeleteSelectionCommand::saveTypingStyleState):
* Source/WebCore/editing/EditingStyle.cpp:
(WebCore::copyEditingProperties):
(WebCore::copyPropertiesFromComputedStyle):
(WebCore::EditingStyle::init):
(WebCore::EditingStyle::removeStyleAddedByNode):
(WebCore::EditingStyle::removeStyleConflictingWithStyleOfNode):
(WebCore::EditingStyle::prepareToApplyAt):
(WebCore::EditingStyle::mergeInlineStyleOfElement):
(WebCore::extractEditingProperties):
(WebCore::EditingStyle::wrappingStyleForSerialization):
(WebCore::EditingStyle::removeStyleFromRulesAndContext):
(WebCore::fontWeightIsBold):
(WebCore::EditingStyle::fontWeightIsBold):
(WebCore::EditingStyle::fontStyleIsItalic):
(WebCore::EditingStyle::webkitTextDecorationsInEffectIsUnderline):
(WebCore::EditingStyle::styleAtSelectionStart):
* Source/WebCore/editing/EditingStyle.h:
(WebCore::EditingStyle::create):
* Source/WebCore/editing/InsertParagraphSeparatorCommand.cpp:
(WebCore::InsertParagraphSeparatorCommand::calculateStyleBeforeInsertion):
* Source/WebKit/WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
(WebKit::WebPage::getPlatformEditorStateCommon const):

Canonical link: https://commits.webkit.org/293414@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

Reply via email to