Use a 1-byte enum class for TextDirection
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 13 Aug 2018 18:19:03 +0000 (18:19 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 13 Aug 2018 18:19:03 +0000 (18:19 +0000)
commit7fdc774254d5da95470b1a85b5fc58571ea125d7
treea103a770c2f4339730ea79ca1cf800bc4505dade
parent6ea5dcb290436ca85e7ebeb93e20bf5a3575b555
Use a 1-byte enum class for TextDirection
https://bugs.webkit.org/show_bug.cgi?id=188350

Patch by Alex Christensen <achristensen@webkit.org> on 2018-08-13
Reviewed by Simon Fraser.

Source/WebCore:

* Modules/notifications/Notification.h:
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator TextDirection const):
* css/ElementRuleCollector.cpp:
(WebCore::ElementRuleCollector::matchAllRules):
* dom/Document.cpp:
(WebCore::Document::updateTitleFromTitleElement):
(WebCore::Document::setTitle):
* dom/Position.cpp:
(WebCore::Position::primaryDirection const):
* dom/Range.cpp:
(WebCore::Range::collectSelectionRectsWithoutUnionInteriorLines const):
* editing/Editing.cpp:
(WebCore::directionOfEnclosingBlock):
* editing/Editor.cpp:
(WebCore::Editor::baseWritingDirectionForSelectionStart const):
* editing/FrameSelection.cpp:
(WebCore::FrameSelection::willBeModified):
(WebCore::FrameSelection::modifyExtendingRight):
(WebCore::FrameSelection::modifyExtendingForward):
(WebCore::FrameSelection::modifyMovingRight):
(WebCore::FrameSelection::modifyExtendingLeft):
(WebCore::FrameSelection::modifyExtendingBackward):
(WebCore::FrameSelection::modifyMovingLeft):
(WebCore::FrameSelection::textSelectionIntent):
(WebCore::FrameSelection::modify):
* editing/VisiblePosition.cpp:
(WebCore::VisiblePosition::leftVisuallyDistinctCandidate const):
(WebCore::VisiblePosition::rightVisuallyDistinctCandidate const):
* editing/VisibleUnits.cpp:
(WebCore::visualWordPosition):
(WebCore::leftWordPosition):
(WebCore::rightWordPosition):
(WebCore::leftBoundaryOfLine):
(WebCore::rightBoundaryOfLine):
* html/HTMLElement.cpp:
(WebCore::HTMLElement::directionalityIfhasDirAutoAttribute const):
(WebCore::HTMLElement::directionality const):
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::setupDateTimeChooserParameters):
* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::directionForFormData const):
(WebCore::HTMLTextFormControlElement::adjustInnerTextStyle const):
* html/HTMLTitleElement.cpp:
(WebCore::HTMLTitleElement::computedTextWithDirection):
* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::toTextDirection const):
(WebCore::CanvasRenderingContext2D::direction const):
(WebCore::CanvasRenderingContext2D::textOffset):
* html/shadow/SliderThumbElement.cpp:
(WebCore::RenderSliderContainer::layout):
* html/shadow/TextControlInnerElements.cpp:
(WebCore::TextControlInnerElement::resolveCustomStyle):
* page/Chrome.cpp:
(WebCore::Chrome::setToolTip):
* page/FrameView.cpp:
(WebCore::paginationModeForRenderStyle):
* page/Settings.yaml:
* platform/RectEdges.h:
(WebCore::RectEdges::start):
(WebCore::RectEdges::end):
(WebCore::RectEdges::start const):
(WebCore::RectEdges::end const):
(WebCore::RectEdges::setStart):
(WebCore::RectEdges::setEnd):
* platform/UserInterfaceLayoutDirection.h:
* platform/graphics/ComplexTextController.cpp:
(WebCore::ComplexTextController::computeExpansionOpportunity):
* platform/graphics/FontCascade.cpp:
(WebCore::FontCascade::expansionOpportunityCountInternal):
(WebCore::FontCascade::leadingExpansionOpportunity):
(WebCore::FontCascade::trailingExpansionOpportunity):
* platform/graphics/GraphicsContext.cpp:
(WebCore::GraphicsContext::drawBidiText):
* platform/graphics/TextRun.h:
(WebCore::TextRun::TextRun):
(WebCore::TextRun::rtl const):
(WebCore::TextRun::ltr const):
(WebCore::TextRun::setDirection):
* platform/graphics/WidthIterator.cpp:
(WebCore::WidthIterator::WidthIterator):
* platform/ios/SelectionRect.cpp:
(WebCore::SelectionRect::SelectionRect):
* platform/text/BidiResolver.h:
(WebCore::BidiStatus::BidiStatus):
* platform/text/StringWithDirection.h:
* platform/text/WritingMode.h:
(WebCore::isLeftToRightDirection):
(WebCore::isVerticalWritingMode):
(WebCore::isFlippedWritingMode):
(WebCore::mapLogicalSideToPhysicalSide):
* rendering/HitTestResult.cpp:
(WebCore::HitTestResult::spellingToolTip const):
(WebCore::HitTestResult::title const):
(WebCore::HitTestResult::innerTextIfTruncated const):
* rendering/InlineBox.h:
(WebCore::InlineBox::direction const):
(WebCore::InlineBox::isLeftToRightDirection const):
* rendering/InlineFlowBox.cpp:
(WebCore::InlineFlowBox::paintFillLayer):
* rendering/InlineIterator.h:
(WebCore::embedCharFromDirection):
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::paint):
(WebCore::mirrorRTLSegment):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::constructTextRun):
* rendering/RenderBlockLineLayout.cpp:
(WebCore::determineDirectionality):
(WebCore::RenderBlockFlow::textAlignmentForLine const):
(WebCore::RenderBlockFlow::updateLogicalWidthForAlignment):
(WebCore::RenderBlockFlow::handleTrailingSpaces):
(WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):
* rendering/RenderBox.cpp:
(WebCore::computeInlineStaticDistance):
(WebCore::RenderBox::computePositionedLogicalWidthUsing const):
(WebCore::RenderBox::computePositionedLogicalWidthReplaced const):
* rendering/RenderDeprecatedFlexibleBox.cpp:
(WebCore::RenderDeprecatedFlexibleBox::applyLineClamp):
* rendering/RenderFragmentedFlow.cpp:
(WebCore::RenderFragmentedFlow::updateLogicalWidth):
(WebCore::RenderFragmentedFlow::updateFragmentsFragmentedFlowPortionRect):
* rendering/RenderLayerModelObject.cpp:
(WebCore::RenderLayerModelObject::shouldPlaceBlockDirectionScrollbarOnLeft const):
* rendering/RenderMarquee.cpp:
(WebCore::RenderMarquee::direction const):
* rendering/RenderMenuList.cpp:
(WebCore::RenderMenuList::adjustInnerStyle):
(RenderMenuList::clientPaddingLeft const):
(RenderMenuList::clientPaddingRight const):
* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::popupInternalPaddingBox const):
(WebCore::RenderThemeIOS::paintMenuListButtonDecorations):
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::paintMenuListButtonDecorations):
(WebCore::RenderThemeMac::popupInternalPaddingBox const):
(WebCore::RenderThemeMac::setPopupButtonCellState):
(WebCore::RenderThemeMac::paintSearchFieldCancelButton):
(WebCore::RenderThemeMac::paintSearchFieldResultsButton):
* rendering/mathml/RenderMathMLBlock.cpp:
(WebCore::RenderMathMLBlock::mirrorIfNeeded const):
* rendering/mathml/RenderMathMLOperator.cpp:
(WebCore::RenderMathMLOperator::layoutBlock):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::RenderStyle):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::isLeftToRightDirection const):
(WebCore::RenderStyle::initialDirection):
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::systemLayoutDirection):
(WebCore::InternalSettings::setSystemLayoutDirection):
* testing/Internals.h:

Source/WebKit:

* Shared/WebPopupItem.cpp:
(WebKit::WebPopupItem::WebPopupItem):
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView webSelectionRectsForSelectionRects:]):
* UIProcess/mac/WebPopupMenuProxyMac.mm:
(WebKit::WebPopupMenuProxyMac::populate):
(WebKit::WebPopupMenuProxyMac::showPopupMenu):
* WebProcess/WebCoreSupport/WebPopupMenu.cpp:
(WebKit::WebPopupMenu::show):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::getAssistedNodeInformation):

Source/WebKitLegacy/ios:

* WebCoreSupport/WebFrameIOS.mm:
(-[WebFrame selectionRectsForCoreRange:]):
* WebCoreSupport/WebVisiblePosition.mm:
(-[WebVisiblePosition textDirection]):
(-[WebVisiblePosition directionIsDownstream:]):
* WebView/WebPDFViewIOS.mm:
(-[WebPDFView _checkPDFTitle]):

Source/WebKitLegacy/mac:

* WebCoreSupport/PopupMenuMac.mm:
(PopupMenuMac::populate):
(PopupMenuMac::show):
* WebCoreSupport/WebFrameLoaderClient.mm:
(WebFrameLoaderClient::transitionToCommittedForNewPage):
* WebView/WebFrame.mm:
(-[WebFrame _dispatchDidReceiveTitle:]):

Tools:

* TestWebKitAPI/Tests/WebCore/ComplexTextController.cpp:
(TestWebKitAPI::TEST_F):
* TestWebKitAPI/Tests/WebCore/StringWithDirection.cpp:
(WebCore::operator<<):
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKitCocoa/CommandBackForward.mm:
(TEST_F):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234808 268f45cc-cd09-0410-ab3c-d52691b4dbfc
78 files changed:
Source/WebCore/ChangeLog
Source/WebCore/Modules/notifications/Notification.h
Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceText.cpp
Source/WebCore/css/CSSPrimitiveValueMappings.h
Source/WebCore/css/ElementRuleCollector.cpp
Source/WebCore/dom/Document.cpp
Source/WebCore/dom/Position.cpp
Source/WebCore/dom/Range.cpp
Source/WebCore/editing/Editing.cpp
Source/WebCore/editing/Editor.cpp
Source/WebCore/editing/FrameSelection.cpp
Source/WebCore/editing/VisiblePosition.cpp
Source/WebCore/editing/VisibleUnits.cpp
Source/WebCore/editing/atk/FrameSelectionAtk.cpp
Source/WebCore/html/HTMLElement.cpp
Source/WebCore/html/HTMLInputElement.cpp
Source/WebCore/html/HTMLTextFormControlElement.cpp
Source/WebCore/html/HTMLTitleElement.cpp
Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp
Source/WebCore/html/shadow/SliderThumbElement.cpp
Source/WebCore/html/shadow/TextControlInnerElements.cpp
Source/WebCore/page/Chrome.cpp
Source/WebCore/page/FrameView.cpp
Source/WebCore/page/Settings.yaml
Source/WebCore/platform/RectEdges.h
Source/WebCore/platform/UserInterfaceLayoutDirection.h
Source/WebCore/platform/graphics/ComplexTextController.cpp
Source/WebCore/platform/graphics/FontCascade.cpp
Source/WebCore/platform/graphics/GraphicsContext.cpp
Source/WebCore/platform/graphics/TextRun.h
Source/WebCore/platform/graphics/WidthIterator.cpp
Source/WebCore/platform/ios/SelectionRect.cpp
Source/WebCore/platform/text/BidiResolver.h
Source/WebCore/platform/text/StringWithDirection.h
Source/WebCore/platform/text/WritingMode.h
Source/WebCore/platform/win/PopupMenuWin.cpp
Source/WebCore/rendering/HitTestResult.cpp
Source/WebCore/rendering/InlineBox.h
Source/WebCore/rendering/InlineFlowBox.cpp
Source/WebCore/rendering/InlineIterator.h
Source/WebCore/rendering/InlineTextBox.cpp
Source/WebCore/rendering/RenderBlock.cpp
Source/WebCore/rendering/RenderBlockLineLayout.cpp
Source/WebCore/rendering/RenderBox.cpp
Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp
Source/WebCore/rendering/RenderFragmentedFlow.cpp
Source/WebCore/rendering/RenderLayerModelObject.cpp
Source/WebCore/rendering/RenderMarquee.cpp
Source/WebCore/rendering/RenderMenuList.cpp
Source/WebCore/rendering/RenderThemeGtk.cpp
Source/WebCore/rendering/RenderThemeIOS.mm
Source/WebCore/rendering/RenderThemeMac.mm
Source/WebCore/rendering/RenderThemeWin.cpp
Source/WebCore/rendering/mathml/RenderMathMLBlock.cpp
Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp
Source/WebCore/rendering/style/RenderStyle.cpp
Source/WebCore/rendering/style/RenderStyle.h
Source/WebCore/testing/InternalSettings.cpp
Source/WebCore/testing/Internals.h
Source/WebKit/ChangeLog
Source/WebKit/Shared/WebPopupItem.cpp
Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm
Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm
Source/WebKit/UIProcess/mac/WebPopupMenuProxyMac.mm
Source/WebKit/WebProcess/WebCoreSupport/WebPopupMenu.cpp
Source/WebKit/WebProcess/WebCoreSupport/win/WebPopupMenuWin.cpp
Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm
Source/WebKitLegacy/ios/ChangeLog
Source/WebKitLegacy/ios/WebCoreSupport/WebFrameIOS.mm
Source/WebKitLegacy/ios/WebCoreSupport/WebVisiblePosition.mm
Source/WebKitLegacy/ios/WebView/WebPDFViewIOS.mm
Source/WebKitLegacy/mac/ChangeLog
Source/WebKitLegacy/mac/WebCoreSupport/PopupMenuMac.mm
Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.mm
Source/WebKitLegacy/mac/WebView/WebFrame.mm
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WebCore/ComplexTextController.cpp
Tools/TestWebKitAPI/Tests/WebCore/StringWithDirection.cpp