Modernize RenderStyleConstants.h - Part 3
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 28 May 2018 00:49:21 +0000 (00:49 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 28 May 2018 00:49:21 +0000 (00:49 +0000)
commit30fb8e23b44a3a9f71f4ed85277f833d3e5cf962
tree676ff5eda354bffa03e25fe468898bb6f64e5326
parent27fde315eacd7f9c33be2d5f39c8d68260cc775c
Modernize RenderStyleConstants.h - Part 3
https://bugs.webkit.org/show_bug.cgi?id=186015

Patch by Sam Weinig <sam@webkit.org> on 2018-05-27
Reviewed by Yusuke Suzuki.

Source/WebCore:

Modernized the third and final set of enums in RenderStyleConstants.h by:
    - Converting them to enum classes
    - Renaming them to remove unnecessary prefix 'E's
    - Renaming values to take advantage of enum class scoping (e.g. StyleDifferenceEqual -> StyleDifference::Equal)

Modernizes the following enums:
    TextDecoration
    TextDecorationSkip (renamed from TextDecorationSkipItems)
    TextUnderlinePosition
    HangingPunctuation
    SpeakAs (renamed from ESpeakAs)
    TextEmphasisPosition (renamed from TextEmphasisPositions)

This final set of enums are mostly (TextUnderlinePosition isn't really) used as bitmasks,
so this change also converts their uses to use OptionSet.

* accessibility/AccessibilityObject.h:
(WebCore::AccessibilityObject::speakAsProperty const):
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::speakAsProperty const):
(WebCore::AccessibilityRenderObject::hasPlainText const):
(WebCore::AccessibilityRenderObject::hasUnderline const):
* accessibility/AccessibilityRenderObject.h:
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(AXAttributeStringSetStyle):
* accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
(-[WebAccessibilityObjectWrapperBase baseAccessibilitySpeechHint]):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(AXAttributeStringSetStyle):
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::renderTextDecorationFlagsToCSSValue):
(WebCore::renderTextDecorationSkipFlagsToCSSValue):
(WebCore::renderEmphasisPositionFlagsToCSSValue):
(WebCore::speakAsToCSSValue):
(WebCore::hangingPunctuationToCSSValue):
* css/CSSLineBoxContainValue.h:
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::operator HangingPunctuation const):
(WebCore::CSSPrimitiveValue::operator TextDecoration const):
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator TextUnderlinePosition const):
(WebCore::CSSPrimitiveValue::operator SpeakAs const):
(WebCore::CSSPrimitiveValue::operator ESpeakAs const): Deleted.
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertTextDecoration):
(WebCore::StyleBuilderConverter::valueToEmphasisPosition):
(WebCore::StyleBuilderConverter::convertTextEmphasisPosition):
(WebCore::StyleBuilderConverter::convertTextUnderlinePosition):
(WebCore::StyleBuilderConverter::valueToDecorationSkip):
(WebCore::StyleBuilderConverter::convertTextDecorationSkip):
(WebCore::StyleBuilderConverter::convertSpeakAs):
(WebCore::StyleBuilderConverter::convertHangingPunctuation):
* editing/cocoa/EditorCocoa.mm:
(WebCore::Editor::getTextDecorationAttributesRespectingTypingStyle const):
* editing/cocoa/HTMLConverter.mm:
(WebCore::editingAttributedStringFromRange):
* rendering/InlineFlowBox.cpp:
(WebCore::InlineFlowBox::maxLogicalBottomForTextDecorationLine const):
(WebCore::InlineFlowBox::minLogicalTopForTextDecorationLine const):
* rendering/InlineFlowBox.h:
* rendering/InlineTextBox.cpp:
(WebCore::emphasisPositionHasNeitherLeftNorRight):
(WebCore::InlineTextBox::emphasisMarkExistsAndIsAbove const):
(WebCore::InlineTextBox::paint):
(WebCore::InlineTextBox::paintMarkedTextDecoration):
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::computeInlinePreferredLogicalWidths const):
* rendering/RenderBlockLineLayout.cpp:
(WebCore::setLogicalWidthForTextRun):
(WebCore::RenderBlockFlow::computeInlineDirectionPositionsForSegment):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::enclosingRendererWithTextDecoration const):
* rendering/RenderElement.h:
* rendering/RenderTableSection.cpp:
(WebCore::RenderTableSection::addCell):
* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::canUseForStyle):
(WebCore::SimpleLineLayout::canUseForWithReason):
* rendering/SimpleLineLayoutFunctions.cpp:
(WebCore::SimpleLineLayout::paintFlow):
* rendering/TextDecorationPainter.cpp:
(WebCore::TextDecorationPainter::TextDecorationPainter):
(WebCore::TextDecorationPainter::paintTextDecoration):
(WebCore::collectStylesForRenderer):
(WebCore::TextDecorationPainter::stylesForRenderer):
* rendering/TextDecorationPainter.h:
* rendering/TextPaintStyle.cpp:
(WebCore::computeTextPaintStyle):
* rendering/line/BreakingContext.h:
(WebCore::BreakingContext::handleText):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::RenderStyle):
(WebCore::RenderStyle::changeAffectsVisualOverflow const):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::textDecorationsInEffect const):
(WebCore::RenderStyle::textDecoration const):
(WebCore::RenderStyle::textDecorationSkip const):
(WebCore::RenderStyle::hangingPunctuation const):
(WebCore::RenderStyle::textEmphasisPosition const):
(WebCore::RenderStyle::speakAs const):
(WebCore::RenderStyle::addToTextDecorationsInEffect):
(WebCore::RenderStyle::setTextDecorationsInEffect):
(WebCore::RenderStyle::setTextDecoration):
(WebCore::RenderStyle::setTextDecorationSkip):
(WebCore::RenderStyle::setSpeakAs):
(WebCore::RenderStyle::setTextEmphasisPosition):
(WebCore::RenderStyle::setHangingPunctuation):
(WebCore::RenderStyle::initialHangingPunctuation):
(WebCore::RenderStyle::initialTextDecoration):
(WebCore::RenderStyle::initialTextDecorationSkip):
(WebCore::RenderStyle::initialTextUnderlinePosition):
(WebCore::RenderStyle::initialSpeakAs):
(WebCore::RenderStyle::initialTextEmphasisPosition):
* rendering/style/RenderStyleConstants.h:
(WebCore::operator|): Deleted.
(WebCore::operator|=): Deleted.
* rendering/style/StyleRareInheritedData.cpp:
(WebCore::StyleRareInheritedData::StyleRareInheritedData):
* rendering/style/StyleVisualData.cpp:
(WebCore::StyleVisualData::StyleVisualData):
* rendering/svg/SVGInlineTextBox.cpp:
(WebCore::SVGInlineTextBox::paint):
(WebCore::positionOffsetForDecoration):
(WebCore::thicknessForDecoration):
(WebCore::findRendererDefininingTextDecoration):
(WebCore::SVGInlineTextBox::paintDecoration):
(WebCore::SVGInlineTextBox::paintDecorationWithStyle):
* rendering/svg/SVGInlineTextBox.h:
* style/InlineTextBoxStyle.cpp:
(WebCore::computeUnderlineOffset):
(WebCore::visualOverflowForDecorations):

Source/WebKitLegacy/mac:

* WebView/WebView.mm:
(-[WebView updateTextTouchBar]):
Update for new enum name.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@232229 268f45cc-cd09-0410-ab3c-d52691b4dbfc
39 files changed:
Source/WebCore/ChangeLog
Source/WebCore/accessibility/AccessibilityObject.h
Source/WebCore/accessibility/AccessibilityRenderObject.cpp
Source/WebCore/accessibility/AccessibilityRenderObject.h
Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceText.cpp
Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm
Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperBase.mm
Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm
Source/WebCore/css/CSSComputedStyleDeclaration.cpp
Source/WebCore/css/CSSLineBoxContainValue.h
Source/WebCore/css/CSSPrimitiveValueMappings.h
Source/WebCore/css/StyleBuilderConverter.h
Source/WebCore/editing/cocoa/EditorCocoa.mm
Source/WebCore/editing/cocoa/HTMLConverter.mm
Source/WebCore/rendering/InlineFlowBox.cpp
Source/WebCore/rendering/InlineFlowBox.h
Source/WebCore/rendering/InlineTextBox.cpp
Source/WebCore/rendering/RenderBlockFlow.cpp
Source/WebCore/rendering/RenderBlockLineLayout.cpp
Source/WebCore/rendering/RenderElement.cpp
Source/WebCore/rendering/RenderElement.h
Source/WebCore/rendering/RenderTableSection.cpp
Source/WebCore/rendering/SimpleLineLayout.cpp
Source/WebCore/rendering/SimpleLineLayoutFunctions.cpp
Source/WebCore/rendering/TextDecorationPainter.cpp
Source/WebCore/rendering/TextDecorationPainter.h
Source/WebCore/rendering/TextPaintStyle.cpp
Source/WebCore/rendering/line/BreakingContext.h
Source/WebCore/rendering/style/RenderStyle.cpp
Source/WebCore/rendering/style/RenderStyle.h
Source/WebCore/rendering/style/RenderStyleConstants.h
Source/WebCore/rendering/style/StyleRareInheritedData.cpp
Source/WebCore/rendering/style/StyleVisualData.cpp
Source/WebCore/rendering/svg/SVGInlineTextBox.cpp
Source/WebCore/rendering/svg/SVGInlineTextBox.h
Source/WebCore/style/InlineTextBoxStyle.cpp
Source/WebCore/style/InlineTextBoxStyle.h
Source/WebKitLegacy/mac/ChangeLog
Source/WebKitLegacy/mac/WebView/WebView.mm