Replace OptionSet |= and -= operators with add() and remove() functions
authorantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 31 Aug 2018 17:59:01 +0000 (17:59 +0000)
committerantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 31 Aug 2018 17:59:01 +0000 (17:59 +0000)
commit3b05e22094bf9489a0513a5e4b741ea298c2f8e1
tree3300dd6d30ac5dbb018db86f91472e5bd64250d3
parent1405d42d32245a371f80b72c4032c485c8ff61e9
Replace OptionSet |= and -= operators with add() and remove() functions
https://bugs.webkit.org/show_bug.cgi?id=189169

Reviewed by Anders Carlsson.

Source/WebCore:

* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::rangeOfStringClosestToRangeInDirection const):
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertTextDecoration):
(WebCore::StyleBuilderConverter::convertTextEmphasisPosition):
(WebCore::StyleBuilderConverter::convertTextUnderlinePosition):
(WebCore::StyleBuilderConverter::convertTextDecorationSkip):
(WebCore::StyleBuilderConverter::convertSpeakAs):
(WebCore::StyleBuilderConverter::convertHangingPunctuation):
* css/parser/CSSParser.cpp:
(WebCore::CSSParser::parseSystemColor):
* dom/Document.cpp:
(WebCore::Document::styleColorOptions const):
* dom/DocumentMarkerController.cpp:
(WebCore::DocumentMarkerController::addMarker):
(WebCore::DocumentMarkerController::removeMarkers):
* dom/ScriptedAnimationController.cpp:
(WebCore::ScriptedAnimationController::addThrottlingReason):
(WebCore::ScriptedAnimationController::removeThrottlingReason):
* dom/SecurityContext.h:
(WebCore::SecurityContext::setFoundMixedContent):
* dom/UIEventWithKeyState.cpp:
(WebCore::UIEventWithKeyState::modifiersFromInitializer):
(WebCore::UIEventWithKeyState::setModifierKeys):
* dom/UserActionElementSet.cpp:
(WebCore::UserActionElementSet::setFlags):
* editing/CompositeEditCommand.cpp:
(WebCore::CompositeEditCommand::moveParagraphs):
* editing/Editor.cpp:
(WebCore::Editor::replaceSelectionWithFragment):
(WebCore::Editor::appliedEditing):
(WebCore::Editor::markMisspellingsAfterTypingToWord):
(WebCore::Editor::markMisspellingsAndBadGrammar):
(WebCore::Editor::resolveTextCheckingTypeMask):
* editing/FrameSelection.cpp:
(WebCore::FrameSelection::moveWithoutValidationTo):
(WebCore::FrameSelection::setSelectedRange):
* editing/FrameSelection.h:
(WebCore::FrameSelection::defaultSetSelectionOptions):
* editing/MoveSelectionCommand.cpp:
(WebCore::MoveSelectionCommand::doApply):
* editing/SpellChecker.cpp:
(WebCore::SpellChecker::didCheckSucceed):
* editing/TextCheckingHelper.cpp:
(WebCore::TextCheckingHelper::findFirstMisspellingOrBadGrammar):
(WebCore::TextCheckingHelper::guessesForMisspelledOrUngrammaticalRange const):
* editing/TextIterator.cpp:
(WebCore::SearchBuffer::SearchBuffer):
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::parseAttribute):
* inspector/agents/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::reload):
* page/ContextMenuController.cpp:
(WebCore::ContextMenuController::contextMenuItemSelected):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::find const):
* page/DragController.cpp:
(WebCore::DragController::concludeEditDrag):
* page/FrameSnapshotting.cpp:
(WebCore::snapshotFrameRectWithClip):
* page/FrameView.cpp:
(WebCore::updateLayerPositionFlags):
(WebCore::FrameView::willPaintContents):
* page/Page.cpp:
(WebCore::Page::setIsVisible):
* page/PerformanceObserver.cpp:
(WebCore::PerformanceObserver::observe):
* page/TextIndicator.cpp:
(WebCore::TextIndicator::createWithRange):
* page/WindowFeatures.cpp:
(WebCore::parseDisabledAdaptations):
* page/csp/ContentSecurityPolicy.h:
(WebCore::ContentSecurityPolicy::addHashAlgorithmsForInlineScripts):
(WebCore::ContentSecurityPolicy::addHashAlgorithmsForInlineStylesheets):
* page/csp/ContentSecurityPolicySourceList.cpp:
(WebCore::ContentSecurityPolicySourceList::parseHashSource):
* platform/PlatformEvent.h:
(WebCore::PlatformEvent::PlatformEvent):
* platform/ios/PlatformEventFactoryIOS.mm:
(WebCore::modifiersForEvent):
* platform/mac/PlatformEventFactoryMac.mm:
(WebCore::modifiersForEvent):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::updateLayerPositions):
(WebCore::RenderLayer::updateLayerPositionsAfterScroll):
(WebCore::RenderLayer::paintLayer):
(WebCore::RenderLayer::paintLayerContentsAndReflection):
(WebCore::RenderLayer::paintLayerContents):
(WebCore::RenderLayer::paintForegroundForFragments):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::paintIntoLayer):
(WebCore::RenderLayerBacking::paintContents):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::reasonsForCompositing const):
(WebCore::RenderLayerCompositor::updateScrollCoordinatedStatus):
* rendering/TextDecorationPainter.cpp:
(WebCore::collectStylesForRenderer):
* rendering/TextPaintStyle.cpp:
(WebCore::computeTextPaintStyle):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::changeRequiresLayout const):
(WebCore::RenderStyle::changeRequiresLayerRepaint const):
(WebCore::RenderStyle::changeRequiresRepaint const):
* testing/Internals.cpp:
(WebCore::parseFindOptions):
(WebCore::Internals::forceReload):
(WebCore::Internals::setPageVisibility):
(WebCore::Internals::setPageIsFocusedAndActive):

Source/WebKit:

* NetworkProcess/cocoa/NetworkProcessCocoa.mm:
(WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
* Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h:
(WebKit::RemoteLayerTreeTransaction::LayerProperties::notePropertiesChanged):
* Shared/WebEventConversion.cpp:
(WebKit::WebKit2PlatformMouseEvent::WebKit2PlatformMouseEvent):
(WebKit::WebKit2PlatformWheelEvent::WebKit2PlatformWheelEvent):
(WebKit::WebKit2PlatformKeyboardEvent::WebKit2PlatformKeyboardEvent):
(WebKit::WebKit2PlatformTouchEvent::WebKit2PlatformTouchEvent):
(WebKit::WebKit2PlatformGestureEvent::WebKit2PlatformGestureEvent):
* Shared/WebsitePoliciesData.cpp:
(WebKit::WebsitePoliciesData::applyToDocumentLoader):
* UIProcess/API/C/WKPage.cpp:
(WKPageReload):
* UIProcess/API/C/WKResourceCacheManager.cpp:
(toWebsiteDataTypes):
* UIProcess/API/C/WKWebsitePolicies.cpp:
(WKWebsitePoliciesSetAllowedAutoplayQuirks):
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView reload]):
* UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h:
(WebKit::toWebsiteDataTypes):
* UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
(-[WKWebsiteDataStore _fetchDataRecordsOfTypes:withOptions:completionHandler:]):
* UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
(-[_WKWebsitePolicies setAllowedAutoplayQuirks:]):
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::viewDidMoveToWindow):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::updateActivityState):
(WebKit::WebPageProxy::activityStateDidChange):
(WebKit::WebPageProxy::dispatchActivityStateChange):
* UIProcess/WebsiteData/WebsiteDataRecord.cpp:
(WebKit::WebsiteDataRecord::add):
(WebKit::WebsiteDataRecord::addCookieHostName):
(WebKit::WebsiteDataRecord::addPluginDataHostName):
(WebKit::WebsiteDataRecord::addHSTSCacheHostname):
(WebKit::WebsiteDataRecord::addOriginWithCredential):
* UIProcess/mac/WKInspectorViewController.mm:
(-[WKInspectorViewController inspectorWKWebViewReload:]):
* WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
(WebKit::imageForRect):
* WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
(WebKit::InjectedBundleRangeHandle::renderedImage):
* WebProcess/WebPage/FindController.cpp:
(WebKit::core):
(WebKit::FindController::findString):

Source/WebKitLegacy/mac:

* WebView/WebFrame.mm:
(-[WebFrame _drawRect:contentsOnly:]):
* WebView/WebView.mm:
(coreOptions):

Source/WTF:

Improve code readability.

* wtf/OptionSet.h:
(WTF::OptionSet::add):
(WTF::OptionSet::remove):
(WTF::OptionSet::operator==):
(WTF::OptionSet::operator!=):
(WTF::OptionSet::operator|=): Deleted.
(WTF::OptionSet::operator-=): Deleted.
* wtf/ProcessPrivilege.cpp:
(WTF::addProcessPrivilege):
(WTF::removeProcessPrivilege):

Tools:

* TestWebKitAPI/Tests/WTF/OptionSet.cpp:
(TestWebKitAPI::TEST):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@235560 268f45cc-cd09-0410-ab3c-d52691b4dbfc
80 files changed:
Source/WTF/ChangeLog
Source/WTF/wtf/OptionSet.h
Source/WTF/wtf/ProcessPrivilege.cpp
Source/WebCore/ChangeLog
Source/WebCore/accessibility/AccessibilityObject.cpp
Source/WebCore/css/StyleBuilderConverter.h
Source/WebCore/css/parser/CSSParser.cpp
Source/WebCore/dom/Document.cpp
Source/WebCore/dom/DocumentMarkerController.cpp
Source/WebCore/dom/ScriptedAnimationController.cpp
Source/WebCore/dom/SecurityContext.h
Source/WebCore/dom/UIEventWithKeyState.cpp
Source/WebCore/dom/UserActionElementSet.cpp
Source/WebCore/editing/CompositeEditCommand.cpp
Source/WebCore/editing/Editor.cpp
Source/WebCore/editing/FrameSelection.cpp
Source/WebCore/editing/FrameSelection.h
Source/WebCore/editing/MoveSelectionCommand.cpp
Source/WebCore/editing/SpellChecker.cpp
Source/WebCore/editing/TextCheckingHelper.cpp
Source/WebCore/editing/TextIterator.cpp
Source/WebCore/html/HTMLAnchorElement.cpp
Source/WebCore/inspector/agents/InspectorPageAgent.cpp
Source/WebCore/page/ContextMenuController.cpp
Source/WebCore/page/DOMWindow.cpp
Source/WebCore/page/DragController.cpp
Source/WebCore/page/FrameSnapshotting.cpp
Source/WebCore/page/FrameView.cpp
Source/WebCore/page/Page.cpp
Source/WebCore/page/PerformanceObserver.cpp
Source/WebCore/page/TextIndicator.cpp
Source/WebCore/page/WindowFeatures.cpp
Source/WebCore/page/csp/ContentSecurityPolicy.h
Source/WebCore/page/csp/ContentSecurityPolicySourceList.cpp
Source/WebCore/platform/PlatformEvent.h
Source/WebCore/platform/gtk/PlatformKeyboardEventGtk.cpp
Source/WebCore/platform/gtk/PlatformMouseEventGtk.cpp
Source/WebCore/platform/gtk/PlatformWheelEventGtk.cpp
Source/WebCore/platform/gtk/RenderThemeGadget.cpp
Source/WebCore/platform/ios/PlatformEventFactoryIOS.mm
Source/WebCore/platform/mac/PlatformEventFactoryMac.mm
Source/WebCore/rendering/RenderLayer.cpp
Source/WebCore/rendering/RenderLayerBacking.cpp
Source/WebCore/rendering/RenderLayerCompositor.cpp
Source/WebCore/rendering/TextDecorationPainter.cpp
Source/WebCore/rendering/TextPaintStyle.cpp
Source/WebCore/rendering/style/RenderStyle.cpp
Source/WebCore/testing/Internals.cpp
Source/WebDriver/Session.cpp
Source/WebKit/ChangeLog
Source/WebKit/NetworkProcess/cocoa/NetworkProcessCocoa.mm
Source/WebKit/NetworkProcess/soup/NetworkProcessSoup.cpp
Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h
Source/WebKit/Shared/WebEventConversion.cpp
Source/WebKit/Shared/WebsitePoliciesData.cpp
Source/WebKit/UIProcess/API/C/WKPage.cpp
Source/WebKit/UIProcess/API/C/WKResourceCacheManager.cpp
Source/WebKit/UIProcess/API/C/WKWebsitePolicies.cpp
Source/WebKit/UIProcess/API/C/wpe/WKAPICastWPE.h
Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm
Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h
Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.mm
Source/WebKit/UIProcess/API/Cocoa/_WKWebsitePolicies.mm
Source/WebKit/UIProcess/API/glib/WebKitWebContext.cpp
Source/WebKit/UIProcess/API/glib/WebKitWebsiteDataManager.cpp
Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp
Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm
Source/WebKit/UIProcess/WebPageProxy.cpp
Source/WebKit/UIProcess/WebsiteData/WebsiteDataRecord.cpp
Source/WebKit/UIProcess/mac/WKInspectorViewController.mm
Source/WebKit/WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp
Source/WebKit/WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp
Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp
Source/WebKit/WebProcess/WebPage/FindController.cpp
Source/WebKitLegacy/mac/ChangeLog
Source/WebKitLegacy/mac/WebView/WebFrame.mm
Source/WebKitLegacy/mac/WebView/WebView.mm
Source/WebKitLegacy/win/WebView.cpp
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WTF/OptionSet.cpp