Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: c537ee925021abf80ed011c2111331e875ec13e6
      
https://github.com/WebKit/WebKit/commit/c537ee925021abf80ed011c2111331e875ec13e6
  Author: Abrar Rahman Protyasha <[email protected]>
  Date:   2023-09-20 (Wed, 20 Sep 2023)

  Changed paths:
    M Source/WebCore/editing/ApplyStyleCommand.cpp
    M Source/WebCore/editing/ApplyStyleCommand.h
    M Source/WebCore/editing/Editor.cpp

  Log Message:
  -----------
  Enums in ApplyStyleCommand should be enum classes
https://bugs.webkit.org/show_bug.cgi?id=261774
rdar://problem/115751437

Reviewed by Wenson Hsieh.

ApplyStyleCommand defines three enumerations, namely EPropertyLevel,
InlineStyleRemovalMode, and EAddStyledElement. This patch makes each of
these enums an enum class, narrows down the underlying type, and renames
the enum cases to address redundancy.

We also choose to default initialize the m_propertyLevel attribute of the
AppleStyleCommand class to PropertyLevel::Default through class member
initialization (rather than through explicit mem-init in _some_
constructor overloads). This is not a behavior change, but does make
construction cleaner.

* Source/WebCore/editing/ApplyStyleCommand.cpp:
(WebCore::ApplyStyleCommand::ApplyStyleCommand):
(WebCore::ApplyStyleCommand::doApply):
(WebCore::ApplyStyleCommand::applyInlineStyleToNodeRange):
(WebCore::ApplyStyleCommand::removeConflictingInlineStyleFromRun):
(WebCore::ApplyStyleCommand::removeInlineStyleFromElement):
(WebCore::ApplyStyleCommand::removeImplicitlyStyledElement):
(WebCore::ApplyStyleCommand::removeCSSStyle):
(WebCore::ApplyStyleCommand::applyInlineStyleToPushDown):
(WebCore::ApplyStyleCommand::pushDownInlineStyleAroundNode):
(WebCore::ApplyStyleCommand::removeInlineStyle):
(WebCore::ApplyStyleCommand::addInlineStyleIfNeeded):
(WebCore::ApplyStyleCommand::applyInlineStyleChange):
* Source/WebCore/editing/ApplyStyleCommand.h:
(WebCore::ApplyStyleCommand::create):
(WebCore::ApplyStyleCommand::shouldRemoveInlineStyleFromElement):
* Source/WebCore/editing/Editor.cpp:
(WebCore::Editor::applyParagraphStyle):

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


_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to