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)
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

index c9c1d3d..37942bc 100644 (file)
@@ -1,3 +1,23 @@
+2018-08-31  Antti Koivisto  <antti@apple.com>
+
+        Replace OptionSet |= and -= operators with add() and remove() functions
+        https://bugs.webkit.org/show_bug.cgi?id=189169
+
+        Reviewed by Anders Carlsson.
+
+        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):
+
 2018-08-31  David Kilzer  <ddkilzer@apple.com>
 
         REGRESSION (r226407): Remove unused BlockStack.h
 2018-08-31  David Kilzer  <ddkilzer@apple.com>
 
         REGRESSION (r226407): Remove unused BlockStack.h
index 6cc8301..f18ff2c 100644 (file)
@@ -111,26 +111,24 @@ public:
         return (*this & optionSet) == optionSet;
     }
 
         return (*this & optionSet) == optionSet;
     }
 
-    constexpr friend bool operator==(OptionSet lhs, OptionSet rhs)
+    constexpr void add(OptionSet optionSet)
     {
     {
-        return lhs.m_storage == rhs.m_storage;
+        m_storage |= optionSet.m_storage;
     }
 
     }
 
-    constexpr friend bool operator!=(OptionSet lhs, OptionSet rhs)
+    constexpr void remove(OptionSet optionSet)
     {
     {
-        return lhs.m_storage != rhs.m_storage;
+        m_storage &= ~optionSet.m_storage;
     }
 
     }
 
-    friend OptionSet& operator|=(OptionSet& lhs, OptionSet rhs)
+    constexpr friend bool operator==(OptionSet lhs, OptionSet rhs)
     {
     {
-        lhs.m_storage |= rhs.m_storage;
-        return lhs;
+        return lhs.m_storage == rhs.m_storage;
     }
 
     }
 
-    friend OptionSet& operator-=(OptionSet& lhs, OptionSet rhs)
+    constexpr friend bool operator!=(OptionSet lhs, OptionSet rhs)
     {
     {
-        lhs.m_storage &= ~rhs.m_storage;
-        return lhs;
+        return lhs.m_storage != rhs.m_storage;
     }
 
     constexpr friend OptionSet operator|(OptionSet lhs, OptionSet rhs)
     }
 
     constexpr friend OptionSet operator|(OptionSet lhs, OptionSet rhs)
index 5a6a0e5..dd098f8 100644 (file)
@@ -57,12 +57,12 @@ bool hasProcessPrivilege(ProcessPrivilege privilege)
 
 void addProcessPrivilege(ProcessPrivilege privilege)
 {
 
 void addProcessPrivilege(ProcessPrivilege privilege)
 {
-    processPrivileges() |= privilege;
+    processPrivileges().add(privilege);
 }
 
 void removeProcessPrivilege(ProcessPrivilege privilege)
 {
 }
 
 void removeProcessPrivilege(ProcessPrivilege privilege)
 {
-    processPrivileges() = processPrivileges() - privilege;
+    processPrivileges().remove(privilege);
 }
 
 } // namespace WTF
 }
 
 } // namespace WTF
index 28ba105..6853599 100644 (file)
@@ -1,3 +1,119 @@
+2018-08-31  Antti Koivisto  <antti@apple.com>
+
+        Replace OptionSet |= and -= operators with add() and remove() functions
+        https://bugs.webkit.org/show_bug.cgi?id=189169
+
+        Reviewed by Anders Carlsson.
+
+        * 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):
+
 2018-08-31  Aditya Keerthi  <akeerthi@apple.com>
 
         [Datalist][iOS] Add suggestions UI for TextFieldInputTypes
 2018-08-31  Aditya Keerthi  <akeerthi@apple.com>
 
         [Datalist][iOS] Add suggestions UI for TextFieldInputTypes
index f10a151..62fb920 100644 (file)
@@ -751,9 +751,9 @@ RefPtr<Range> AccessibilityObject::rangeOfStringClosestToRangeInDirection(Range*
         return nullptr;
     
     bool isBackwardSearch = searchDirection == AccessibilitySearchDirection::Previous;
         return nullptr;
     
     bool isBackwardSearch = searchDirection == AccessibilitySearchDirection::Previous;
-    FindOptions findOptions { { AtWordStarts, AtWordEnds, CaseInsensitive, StartInSelection } };
+    FindOptions findOptions { AtWordStarts, AtWordEnds, CaseInsensitive, StartInSelection };
     if (isBackwardSearch)
     if (isBackwardSearch)
-        findOptions |= Backwards;
+        findOptions.add(Backwards);
     
     RefPtr<Range> closestStringRange = nullptr;
     for (const auto& searchString : searchStrings) {
     
     RefPtr<Range> closestStringRange = nullptr;
     for (const auto& searchString : searchStrings) {
index 60a24bc..f478304 100644 (file)
@@ -394,7 +394,7 @@ inline OptionSet<TextDecoration> StyleBuilderConverter::convertTextDecoration(St
     auto result = RenderStyle::initialTextDecoration();
     if (is<CSSValueList>(value)) {
         for (auto& currentValue : downcast<CSSValueList>(value))
     auto result = RenderStyle::initialTextDecoration();
     if (is<CSSValueList>(value)) {
         for (auto& currentValue : downcast<CSSValueList>(value))
-            result |= downcast<CSSPrimitiveValue>(currentValue.get());
+            result.add(downcast<CSSPrimitiveValue>(currentValue.get()));
     }
     return result;
 }
     }
     return result;
 }
@@ -498,7 +498,7 @@ inline OptionSet<TextEmphasisPosition> StyleBuilderConverter::convertTextEmphasi
 
     OptionSet<TextEmphasisPosition> position;
     for (auto& currentValue : downcast<CSSValueList>(value))
 
     OptionSet<TextEmphasisPosition> position;
     for (auto& currentValue : downcast<CSSValueList>(value))
-        position |= valueToEmphasisPosition(downcast<CSSPrimitiveValue>(currentValue.get()));
+        position.add(valueToEmphasisPosition(downcast<CSSPrimitiveValue>(currentValue.get())));
     return position;
 }
 
     return position;
 }
 
@@ -645,7 +645,7 @@ inline OptionSet<TextUnderlinePosition> StyleBuilderConverter::convertTextUnderl
 
     OptionSet<TextUnderlinePosition> combinedPosition;
     for (auto& currentValue : downcast<CSSValueList>(value))
 
     OptionSet<TextUnderlinePosition> combinedPosition;
     for (auto& currentValue : downcast<CSSValueList>(value))
-        combinedPosition |= downcast<CSSPrimitiveValue>(currentValue.get());
+        combinedPosition.add(downcast<CSSPrimitiveValue>(currentValue.get()));
     return combinedPosition;
 }
 
     return combinedPosition;
 }
 
@@ -753,7 +753,7 @@ inline OptionSet<TextDecorationSkip> StyleBuilderConverter::convertTextDecoratio
 
     OptionSet<TextDecorationSkip> skip;
     for (auto& currentValue : downcast<CSSValueList>(value))
 
     OptionSet<TextDecorationSkip> skip;
     for (auto& currentValue : downcast<CSSValueList>(value))
-        skip |= valueToDecorationSkip(downcast<CSSPrimitiveValue>(currentValue.get()));
+        skip.add(valueToDecorationSkip(downcast<CSSPrimitiveValue>(currentValue.get())));
     return skip;
 }
 
     return skip;
 }
 
@@ -1504,7 +1504,7 @@ inline OptionSet<SpeakAs> StyleBuilderConverter::convertSpeakAs(StyleResolver&,
     auto result = RenderStyle::initialSpeakAs();
     if (is<CSSValueList>(value)) {
         for (auto& currentValue : downcast<CSSValueList>(value))
     auto result = RenderStyle::initialSpeakAs();
     if (is<CSSValueList>(value)) {
         for (auto& currentValue : downcast<CSSValueList>(value))
-            result |= downcast<CSSPrimitiveValue>(currentValue.get());
+            result.add(downcast<CSSPrimitiveValue>(currentValue.get()));
     }
     return result;
 }
     }
     return result;
 }
@@ -1514,7 +1514,7 @@ inline OptionSet<HangingPunctuation> StyleBuilderConverter::convertHangingPunctu
     auto result = RenderStyle::initialHangingPunctuation();
     if (is<CSSValueList>(value)) {
         for (auto& currentValue : downcast<CSSValueList>(value))
     auto result = RenderStyle::initialHangingPunctuation();
     if (is<CSSValueList>(value)) {
         for (auto& currentValue : downcast<CSSValueList>(value))
-            result |= downcast<CSSPrimitiveValue>(currentValue.get());
+            result.add(downcast<CSSPrimitiveValue>(currentValue.get()));
     }
     return result;
 }
     }
     return result;
 }
index 591d3bd..729faed 100644 (file)
@@ -119,7 +119,7 @@ Color CSSParser::parseSystemColor(const String& string, const CSSParserContext*
 
     OptionSet<StyleColor::Options> options;
     if (context && context->useSystemAppearance)
 
     OptionSet<StyleColor::Options> options;
     if (context && context->useSystemAppearance)
-        options |= StyleColor::Options::UseSystemAppearance;
+        options.add(StyleColor::Options::UseSystemAppearance);
     return RenderTheme::singleton().systemColor(id, options);
 }
 
     return RenderTheme::singleton().systemColor(id, options);
 }
 
index 928fe7d..680ef54 100644 (file)
@@ -7178,9 +7178,9 @@ OptionSet<StyleColor::Options> Document::styleColorOptions() const
 {
     OptionSet<StyleColor::Options> options;
     if (useSystemAppearance())
 {
     OptionSet<StyleColor::Options> options;
     if (useSystemAppearance())
-        options |= StyleColor::Options::UseSystemAppearance;
+        options.add(StyleColor::Options::UseSystemAppearance);
     if (useDarkAppearance())
     if (useDarkAppearance())
-        options |= StyleColor::Options::UseDarkAppearance;
+        options.add(StyleColor::Options::UseDarkAppearance);
     return options;
 }
 
     return options;
 }
 
index 0d05b37..6198ad5 100644 (file)
@@ -331,7 +331,7 @@ void DocumentMarkerController::addMarker(Node* node, const DocumentMarker& newMa
             downcast<RenderBlockFlow>(*renderer).ensureLineBoxes();
     }
 
             downcast<RenderBlockFlow>(*renderer).ensureLineBoxes();
     }
 
-    m_possiblyExistingMarkerTypes |= newMarker.type();
+    m_possiblyExistingMarkerTypes.add(newMarker.type());
 
     std::unique_ptr<MarkerList>& list = m_markers.add(node, nullptr).iterator->value;
 
 
     std::unique_ptr<MarkerList>& list = m_markers.add(node, nullptr).iterator->value;
 
@@ -587,7 +587,7 @@ void DocumentMarkerController::removeMarkers(OptionSet<DocumentMarker::MarkerTyp
             removeMarkersFromList(iterator, markerTypes);
     }
 
             removeMarkersFromList(iterator, markerTypes);
     }
 
-    m_possiblyExistingMarkerTypes -= markerTypes;
+    m_possiblyExistingMarkerTypes.remove(markerTypes);
 }
 
 void DocumentMarkerController::removeMarkersFromList(MarkerMap::iterator iterator, OptionSet<DocumentMarker::MarkerType> markerTypes)
 }
 
 void DocumentMarkerController::removeMarkersFromList(MarkerMap::iterator iterator, OptionSet<DocumentMarker::MarkerType> markerTypes)
index bfcf460..e88bb90 100644 (file)
@@ -121,7 +121,7 @@ void ScriptedAnimationController::addThrottlingReason(ThrottlingReason reason)
     if (m_throttlingReasons.contains(reason))
         return;
 
     if (m_throttlingReasons.contains(reason))
         return;
 
-    m_throttlingReasons |= reason;
+    m_throttlingReasons.add(reason);
 
     RELEASE_LOG_IF_ALLOWED("addThrottlingReason(%s) -> %s", throttlingReasonToString(reason), throttlingReasonsToString(m_throttlingReasons).utf8().data());
 
 
     RELEASE_LOG_IF_ALLOWED("addThrottlingReason(%s) -> %s", throttlingReasonToString(reason), throttlingReasonsToString(m_throttlingReasons).utf8().data());
 
@@ -140,7 +140,7 @@ void ScriptedAnimationController::removeThrottlingReason(ThrottlingReason reason
     if (!m_throttlingReasons.contains(reason))
         return;
 
     if (!m_throttlingReasons.contains(reason))
         return;
 
-    m_throttlingReasons -= reason;
+    m_throttlingReasons.remove(reason);
 
     RELEASE_LOG_IF_ALLOWED("removeThrottlingReason(%s) -> %s", throttlingReasonToString(reason), throttlingReasonsToString(m_throttlingReasons).utf8().data());
 
 
     RELEASE_LOG_IF_ALLOWED("removeThrottlingReason(%s) -> %s", throttlingReasonToString(reason), throttlingReasonsToString(m_throttlingReasons).utf8().data());
 
index 9947000..9f215fb 100644 (file)
@@ -89,7 +89,7 @@ public:
     };
 
     const OptionSet<MixedContentType>& foundMixedContent() const { return m_mixedContentTypes; }
     };
 
     const OptionSet<MixedContentType>& foundMixedContent() const { return m_mixedContentTypes; }
-    void setFoundMixedContent(MixedContentType type) { m_mixedContentTypes |= type; }
+    void setFoundMixedContent(MixedContentType type) { m_mixedContentTypes.add(type); }
     bool geolocationAccessed() const { return m_geolocationAccessed; }
     void setGeolocationAccessed() { m_geolocationAccessed = true; }
     bool secureCookiesAccessed() const { return m_secureCookiesAccessed; }
     bool geolocationAccessed() const { return m_geolocationAccessed; }
     void setGeolocationAccessed() { m_geolocationAccessed = true; }
     bool secureCookiesAccessed() const { return m_secureCookiesAccessed; }
index e3e5b17..c7c2404 100644 (file)
@@ -27,17 +27,17 @@ auto UIEventWithKeyState::modifiersFromInitializer(const EventModifierInit& init
 {
     OptionSet<Modifier> result;
     if (initializer.ctrlKey)
 {
     OptionSet<Modifier> result;
     if (initializer.ctrlKey)
-        result |= Modifier::CtrlKey;
+        result.add(Modifier::CtrlKey);
     if (initializer.altKey)
     if (initializer.altKey)
-        result |= Modifier::AltKey;
+        result.add(Modifier::AltKey);
     if (initializer.shiftKey)
     if (initializer.shiftKey)
-        result |= Modifier::ShiftKey;
+        result.add(Modifier::ShiftKey);
     if (initializer.metaKey)
     if (initializer.metaKey)
-        result |= Modifier::MetaKey;
+        result.add(Modifier::MetaKey);
     if (initializer.modifierAltGraph)
     if (initializer.modifierAltGraph)
-        result |= Modifier::AltGraphKey;
+        result.add(Modifier::AltGraphKey);
     if (initializer.modifierCapsLock)
     if (initializer.modifierCapsLock)
-        result |= Modifier::CapsLockKey;
+        result.add(Modifier::CapsLockKey);
     return result;
 }
 
     return result;
 }
 
@@ -63,15 +63,15 @@ void UIEventWithKeyState::setModifierKeys(bool ctrlKey, bool altKey, bool shiftK
 {
     OptionSet<Modifier> result;
     if (ctrlKey)
 {
     OptionSet<Modifier> result;
     if (ctrlKey)
-        result |= Modifier::CtrlKey;
+        result.add(Modifier::CtrlKey);
     if (altKey)
     if (altKey)
-        result |= Modifier::AltKey;
+        result.add(Modifier::AltKey);
     if (shiftKey)
     if (shiftKey)
-        result |= Modifier::ShiftKey;
+        result.add(Modifier::ShiftKey);
     if (metaKey)
     if (metaKey)
-        result |= Modifier::MetaKey;
+        result.add(Modifier::MetaKey);
     if (altGraphKey)
     if (altGraphKey)
-        result |= Modifier::AltGraphKey;
+        result.add(Modifier::AltGraphKey);
     m_modifiers = result;
 }
 
     m_modifiers = result;
 }
 
index 1d565e1..d2660dd 100644 (file)
@@ -66,7 +66,10 @@ void UserActionElementSet::setFlags(Element& element, OptionSet<Flag> flags)
 {
     ASSERT(!flags.isEmpty());
 
 {
     ASSERT(!flags.isEmpty());
 
-    m_elements.add(&element, OptionSet<Flag> { }).iterator->value |= flags;
+    m_elements.ensure(&element, [] {
+        return OptionSet<Flag>();
+    }).iterator->value.add(flags);
+
     element.setUserActionElement(true);
 }
 
     element.setUserActionElement(true);
 }
 
index d7088a9..b45227b 100644 (file)
@@ -1494,7 +1494,7 @@ void CompositeEditCommand::moveParagraphs(const VisiblePosition& startOfParagrap
     ASSERT(endingSelection().isCaretOrRange());
     OptionSet<ReplaceSelectionCommand::CommandOption> options { ReplaceSelectionCommand::SelectReplacement, ReplaceSelectionCommand::MovingParagraph };
     if (!preserveStyle)
     ASSERT(endingSelection().isCaretOrRange());
     OptionSet<ReplaceSelectionCommand::CommandOption> options { ReplaceSelectionCommand::SelectReplacement, ReplaceSelectionCommand::MovingParagraph };
     if (!preserveStyle)
-        options |= ReplaceSelectionCommand::MatchStyle;
+        options.add(ReplaceSelectionCommand::MatchStyle);
     applyCommandToComposite(ReplaceSelectionCommand::create(document(), WTFMove(fragment), options));
 
     frame().editor().markMisspellingsAndBadGrammar(endingSelection());
     applyCommandToComposite(ReplaceSelectionCommand::create(document(), WTFMove(fragment), options));
 
     frame().editor().markMisspellingsAndBadGrammar(endingSelection());
index 438737a..eb8f5d2 100644 (file)
@@ -634,13 +634,13 @@ void Editor::replaceSelectionWithFragment(DocumentFragment& fragment, bool selec
 
     OptionSet<ReplaceSelectionCommand::CommandOption> options { ReplaceSelectionCommand::PreventNesting, ReplaceSelectionCommand::SanitizeFragment };
     if (selectReplacement)
 
     OptionSet<ReplaceSelectionCommand::CommandOption> options { ReplaceSelectionCommand::PreventNesting, ReplaceSelectionCommand::SanitizeFragment };
     if (selectReplacement)
-        options |= ReplaceSelectionCommand::SelectReplacement;
+        options.add(ReplaceSelectionCommand::SelectReplacement);
     if (smartReplace)
     if (smartReplace)
-        options |= ReplaceSelectionCommand::SmartReplace;
+        options.add(ReplaceSelectionCommand::SmartReplace);
     if (matchStyle)
     if (matchStyle)
-        options |= ReplaceSelectionCommand::MatchStyle;
+        options.add(ReplaceSelectionCommand::MatchStyle);
     if (mailBlockquoteHandling == MailBlockquoteHandling::IgnoreBlockquote)
     if (mailBlockquoteHandling == MailBlockquoteHandling::IgnoreBlockquote)
-        options |= ReplaceSelectionCommand::IgnoreMailBlockquote;
+        options.add(ReplaceSelectionCommand::IgnoreMailBlockquote);
 
     auto command = ReplaceSelectionCommand::create(document(), &fragment, options, editingAction);
     command->apply();
 
     auto command = ReplaceSelectionCommand::create(document(), &fragment, options, editingAction);
     command->apply();
@@ -1073,7 +1073,7 @@ void Editor::appliedEditing(CompositeEditCommand& command)
         // Don't clear the typing style with this selection change. We do those things elsewhere if necessary.
         OptionSet<FrameSelection::SetSelectionOption> options;
         if (command.isDictationCommand())
         // Don't clear the typing style with this selection change. We do those things elsewhere if necessary.
         OptionSet<FrameSelection::SetSelectionOption> options;
         if (command.isDictationCommand())
-            options |= FrameSelection::DictationTriggered;
+            options.add(FrameSelection::DictationTriggered);
 
         changeSelectionAfterCommand(newSelection, options);
     }
 
         changeSelectionAfterCommand(newSelection, options);
     }
@@ -2339,7 +2339,7 @@ void Editor::markMisspellingsAfterTypingToWord(const VisiblePosition &wordStart,
     UNUSED_PARAM(doReplacement);
     OptionSet<TextCheckingType> textCheckingOptions;
     if (isContinuousSpellCheckingEnabled())
     UNUSED_PARAM(doReplacement);
     OptionSet<TextCheckingType> textCheckingOptions;
     if (isContinuousSpellCheckingEnabled())
-        textCheckingOptions |= TextCheckingType::Spelling;
+        textCheckingOptions.add(TextCheckingType::Spelling);
     if (!textCheckingOptions.contains(TextCheckingType::Spelling))
         return;
 
     if (!textCheckingOptions.contains(TextCheckingType::Spelling))
         return;
 
@@ -2357,7 +2357,7 @@ void Editor::markMisspellingsAfterTypingToWord(const VisiblePosition &wordStart,
         OptionSet<TextCheckingType> textCheckingOptions;
 
         if (isContinuousSpellCheckingEnabled())
         OptionSet<TextCheckingType> textCheckingOptions;
 
         if (isContinuousSpellCheckingEnabled())
-            textCheckingOptions |= TextCheckingType::Spelling;
+            textCheckingOptions.add(TextCheckingType::Spelling);
 
 #if USE(AUTOMATIC_TEXT_REPLACEMENT)
         if (doReplacement
 
 #if USE(AUTOMATIC_TEXT_REPLACEMENT)
         if (doReplacement
@@ -2366,13 +2366,13 @@ void Editor::markMisspellingsAfterTypingToWord(const VisiblePosition &wordStart,
                 || isAutomaticDashSubstitutionEnabled()
                 || isAutomaticTextReplacementEnabled()
                 || (textCheckingOptions.contains(TextCheckingType::Spelling) && isAutomaticSpellingCorrectionEnabled())))
                 || isAutomaticDashSubstitutionEnabled()
                 || isAutomaticTextReplacementEnabled()
                 || (textCheckingOptions.contains(TextCheckingType::Spelling) && isAutomaticSpellingCorrectionEnabled())))
-            textCheckingOptions |= TextCheckingType::Replacement;
+            textCheckingOptions.add(TextCheckingType::Replacement);
 #endif
         if (!textCheckingOptions.contains(TextCheckingType::Spelling) && !textCheckingOptions.contains(TextCheckingType::Replacement))
             return;
 
         if (isGrammarCheckingEnabled())
 #endif
         if (!textCheckingOptions.contains(TextCheckingType::Spelling) && !textCheckingOptions.contains(TextCheckingType::Replacement))
             return;
 
         if (isGrammarCheckingEnabled())
-            textCheckingOptions |= TextCheckingType::Grammar;
+            textCheckingOptions.add(TextCheckingType::Grammar);
 
         auto sentenceStart = startOfSentence(wordStart);
         auto sentenceEnd = endOfSentence(wordStart);
 
         auto sentenceStart = startOfSentence(wordStart);
         auto sentenceEnd = endOfSentence(wordStart);
@@ -2838,7 +2838,7 @@ void Editor::markMisspellingsAndBadGrammar(const VisibleSelection& spellingSelec
         // markMisspellingsAndBadGrammar() is triggered by selection change, in which case we check spelling and grammar, but don't autocorrect misspellings.
         OptionSet<TextCheckingType> textCheckingOptions { TextCheckingType::Spelling };
         if (markGrammar && isGrammarCheckingEnabled())
         // markMisspellingsAndBadGrammar() is triggered by selection change, in which case we check spelling and grammar, but don't autocorrect misspellings.
         OptionSet<TextCheckingType> textCheckingOptions { TextCheckingType::Spelling };
         if (markGrammar && isGrammarCheckingEnabled())
-            textCheckingOptions |= TextCheckingType::Grammar;
+            textCheckingOptions.add(TextCheckingType::Grammar);
         auto spellCheckingRange = spellingSelection.toNormalizedRange();
         markAllMisspellingsAndBadGrammarInRanges(textCheckingOptions, spellCheckingRange.copyRef(), spellCheckingRange.copyRef(), grammarSelection.toNormalizedRange());
         return;
         auto spellCheckingRange = spellingSelection.toNormalizedRange();
         markAllMisspellingsAndBadGrammarInRanges(textCheckingOptions, spellCheckingRange.copyRef(), spellCheckingRange.copyRef(), grammarSelection.toNormalizedRange());
         return;
@@ -3733,30 +3733,30 @@ OptionSet<TextCheckingType> Editor::resolveTextCheckingTypeMask(const Node& root
 
     OptionSet<TextCheckingType> checkingTypes;
     if (shouldMarkSpelling)
 
     OptionSet<TextCheckingType> checkingTypes;
     if (shouldMarkSpelling)
-        checkingTypes |= TextCheckingType::Spelling;
+        checkingTypes.add(TextCheckingType::Spelling);
     if (shouldMarkGrammar)
     if (shouldMarkGrammar)
-        checkingTypes |= TextCheckingType::Grammar;
+        checkingTypes.add(TextCheckingType::Grammar);
 #if !PLATFORM(IOS)
     if (shouldCheckForCorrection)
 #if !PLATFORM(IOS)
     if (shouldCheckForCorrection)
-        checkingTypes |= TextCheckingType::Correction;
+        checkingTypes.add(TextCheckingType::Correction);
     if (shouldShowCorrectionPanel)
     if (shouldShowCorrectionPanel)
-        checkingTypes |= TextCheckingType::ShowCorrectionPanel;
+        checkingTypes.add(TextCheckingType::ShowCorrectionPanel);
 
 #if USE(AUTOMATIC_TEXT_REPLACEMENT)
     bool shouldPerformReplacement = textCheckingOptions.contains(TextCheckingType::Replacement);
     if (shouldPerformReplacement) {
         if (!onlyAllowsTextReplacement) {
             if (isAutomaticLinkDetectionEnabled())
 
 #if USE(AUTOMATIC_TEXT_REPLACEMENT)
     bool shouldPerformReplacement = textCheckingOptions.contains(TextCheckingType::Replacement);
     if (shouldPerformReplacement) {
         if (!onlyAllowsTextReplacement) {
             if (isAutomaticLinkDetectionEnabled())
-                checkingTypes |= TextCheckingType::Link;
+                checkingTypes.add(TextCheckingType::Link);
             if (isAutomaticQuoteSubstitutionEnabled())
             if (isAutomaticQuoteSubstitutionEnabled())
-                checkingTypes |= TextCheckingType::Quote;
+                checkingTypes.add(TextCheckingType::Quote);
             if (isAutomaticDashSubstitutionEnabled())
             if (isAutomaticDashSubstitutionEnabled())
-                checkingTypes |= TextCheckingType::Dash;
+                checkingTypes.add(TextCheckingType::Dash);
             if (shouldMarkSpelling && isAutomaticSpellingCorrectionEnabled())
             if (shouldMarkSpelling && isAutomaticSpellingCorrectionEnabled())
-                checkingTypes |= TextCheckingType::Correction;
+                checkingTypes.add(TextCheckingType::Correction);
         }
         if (isAutomaticTextReplacementEnabled())
         }
         if (isAutomaticTextReplacementEnabled())
-            checkingTypes |= TextCheckingType::Replacement;
+            checkingTypes.add(TextCheckingType::Replacement);
     }
 #endif
 #endif // !PLATFORM(IOS)
     }
 #endif
 #endif // !PLATFORM(IOS)
index 0c838a3..768c44b 100644 (file)
@@ -187,15 +187,15 @@ void FrameSelection::moveWithoutValidationTo(const Position& base, const Positio
     AXTextStateChangeIntent newIntent = intent.type == AXTextStateChangeTypeUnknown ? AXTextStateChangeIntent(AXTextStateChangeTypeSelectionMove, AXTextSelection { AXTextSelectionDirectionDiscontiguous, AXTextSelectionGranularityUnknown, false }) : intent;
     auto options = defaultSetSelectionOptions();
     if (!shouldSetFocus)
     AXTextStateChangeIntent newIntent = intent.type == AXTextStateChangeTypeUnknown ? AXTextStateChangeIntent(AXTextStateChangeTypeSelectionMove, AXTextSelection { AXTextSelectionDirectionDiscontiguous, AXTextSelectionGranularityUnknown, false }) : intent;
     auto options = defaultSetSelectionOptions();
     if (!shouldSetFocus)
-        options |= DoNotSetFocus;
+        options.add(DoNotSetFocus);
     switch (revealMode) {
     case SelectionRevealMode::DoNotReveal:
         break;
     case SelectionRevealMode::Reveal:
     switch (revealMode) {
     case SelectionRevealMode::DoNotReveal:
         break;
     case SelectionRevealMode::Reveal:
-        options |= RevealSelection;
+        options.add(RevealSelection);
         break;
     case SelectionRevealMode::RevealUpToMainFrame:
         break;
     case SelectionRevealMode::RevealUpToMainFrame:
-        options |= RevealSelectionUpToMainFrame;
+        options.add(RevealSelectionUpToMainFrame);
         break;
     }
     setSelection(newSelection, options, newIntent);
         break;
     }
     setSelection(newSelection, options, newIntent);
@@ -1995,7 +1995,7 @@ bool FrameSelection::setSelectedRange(Range* range, EAffinity affinity, bool clo
 
     OptionSet<SetSelectionOption> selectionOptions {  ClearTypingStyle };
     if (closeTyping)
 
     OptionSet<SetSelectionOption> selectionOptions {  ClearTypingStyle };
     if (closeTyping)
-        selectionOptions |= CloseTyping;
+        selectionOptions.add(CloseTyping);
 
     if (userTriggered == UserTriggered) {
         FrameSelection trialFrameSelection;
 
     if (userTriggered == UserTriggered) {
         FrameSelection trialFrameSelection;
@@ -2005,7 +2005,7 @@ bool FrameSelection::setSelectedRange(Range* range, EAffinity affinity, bool clo
         if (!shouldChangeSelection(trialFrameSelection.selection()))
             return false;
 
         if (!shouldChangeSelection(trialFrameSelection.selection()))
             return false;
 
-        selectionOptions |= IsUserTriggered;
+        selectionOptions.add(IsUserTriggered);
     }
 
     setSelection(newSelection, selectionOptions);
     }
 
     setSelection(newSelection, selectionOptions);
index 2d1d918..dfd7430 100644 (file)
@@ -133,7 +133,7 @@ public:
     {
         OptionSet<SetSelectionOption> options { CloseTyping, ClearTypingStyle };
         if (userTriggered == UserTriggered)
     {
         OptionSet<SetSelectionOption> options { CloseTyping, ClearTypingStyle };
         if (userTriggered == UserTriggered)
-            options |= { RevealSelection, FireSelectEvent, IsUserTriggered };
+            options.add({ RevealSelection, FireSelectEvent, IsUserTriggered });
         return options;
     }
 
         return options;
     }
 
index 854a086..486d85a 100644 (file)
@@ -84,7 +84,7 @@ void MoveSelectionCommand::doApply()
     }
     OptionSet<ReplaceSelectionCommand::CommandOption> options { ReplaceSelectionCommand::SelectReplacement, ReplaceSelectionCommand::PreventNesting };
     if (m_smartInsert)
     }
     OptionSet<ReplaceSelectionCommand::CommandOption> options { ReplaceSelectionCommand::SelectReplacement, ReplaceSelectionCommand::PreventNesting };
     if (m_smartInsert)
-        options |= ReplaceSelectionCommand::SmartReplace;
+        options.add(ReplaceSelectionCommand::SmartReplace);
 
     {
         auto replaceSelection = ReplaceSelectionCommand::create(document(), WTFMove(m_fragment), options, EditActionInsertFromDrop);
 
     {
         auto replaceSelection = ReplaceSelectionCommand::create(document(), WTFMove(m_fragment), options, EditActionInsertFromDrop);
index ce1a9ef..604e740 100644 (file)
@@ -218,9 +218,9 @@ void SpellChecker::didCheckSucceed(int sequence, const Vector<TextCheckingResult
     if (requestData.sequence() == sequence) {
         OptionSet<DocumentMarker::MarkerType> markerTypes;
         if (requestData.checkingTypes().contains(TextCheckingType::Spelling))
     if (requestData.sequence() == sequence) {
         OptionSet<DocumentMarker::MarkerType> markerTypes;
         if (requestData.checkingTypes().contains(TextCheckingType::Spelling))
-            markerTypes |= DocumentMarker::Spelling;
+            markerTypes.add(DocumentMarker::Spelling);
         if (requestData.checkingTypes().contains(TextCheckingType::Grammar))
         if (requestData.checkingTypes().contains(TextCheckingType::Grammar))
-            markerTypes |= DocumentMarker::Grammar;
+            markerTypes.add(DocumentMarker::Grammar);
         if (!markerTypes.isEmpty())
             m_frame.document()->markers().removeMarkers(&m_processingRequest->checkingRange(), markerTypes);
     }
         if (!markerTypes.isEmpty())
             m_frame.document()->markers().removeMarkers(&m_processingRequest->checkingRange(), markerTypes);
     }
index 05a6cba..00a257f 100644 (file)
@@ -353,7 +353,7 @@ String TextCheckingHelper::findFirstMisspellingOrBadGrammar(bool checkGrammar, b
                 Vector<TextCheckingResult> results;
                 OptionSet<TextCheckingType> checkingTypes { TextCheckingType::Spelling };
                 if (checkGrammar)
                 Vector<TextCheckingResult> results;
                 OptionSet<TextCheckingType> checkingTypes { TextCheckingType::Spelling };
                 if (checkGrammar)
-                    checkingTypes |= TextCheckingType::Grammar;
+                    checkingTypes.add(TextCheckingType::Grammar);
                 VisibleSelection currentSelection;
                 if (Frame* frame = paragraphRange->ownerDocument().frame())
                     currentSelection = frame->selection().selection();
                 VisibleSelection currentSelection;
                 if (Frame* frame = paragraphRange->ownerDocument().frame())
                     currentSelection = frame->selection().selection();
@@ -587,7 +587,7 @@ Vector<String> TextCheckingHelper::guessesForMisspelledOrUngrammaticalRange(bool
     Vector<TextCheckingResult> results;
     OptionSet<TextCheckingType> checkingTypes { TextCheckingType::Spelling };
     if (checkGrammar)
     Vector<TextCheckingResult> results;
     OptionSet<TextCheckingType> checkingTypes { TextCheckingType::Spelling };
     if (checkGrammar)
-        checkingTypes |= TextCheckingType::Grammar;
+        checkingTypes.add(TextCheckingType::Grammar);
     VisibleSelection currentSelection;
     if (Frame* frame = m_range->ownerDocument().frame())
         currentSelection = frame->selection().selection();
     VisibleSelection currentSelection;
     if (Frame* frame = m_range->ownerDocument().frame())
         currentSelection = frame->selection().selection();
index 6650820..b28d846 100644 (file)
@@ -2097,7 +2097,7 @@ inline SearchBuffer::SearchBuffer(const String& target, FindOptions options)
         // Characters in the separator category never really occur at the beginning of a word,
         // so if the target begins with such a character, we just ignore the AtWordStart option.
         if (isSeparator(targetFirstCharacter)) {
         // Characters in the separator category never really occur at the beginning of a word,
         // so if the target begins with such a character, we just ignore the AtWordStart option.
         if (isSeparator(targetFirstCharacter)) {
-            m_options -= AtWordStarts;
+            m_options.remove(AtWordStarts);
             m_needsMoreContext = false;
         }
     }
             m_needsMoreContext = false;
         }
     }
index 0155fc7..c310cf2 100644 (file)
@@ -257,9 +257,9 @@ void HTMLAnchorElement::parseAttribute(const QualifiedName& name, const AtomicSt
         const bool shouldFoldCase = true;
         SpaceSplitString relValue(value, shouldFoldCase);
         if (relValue.contains(noReferrer))
         const bool shouldFoldCase = true;
         SpaceSplitString relValue(value, shouldFoldCase);
         if (relValue.contains(noReferrer))
-            m_linkRelations |= Relation::NoReferrer;
+            m_linkRelations.add(Relation::NoReferrer);
         if (relValue.contains(noOpener))
         if (relValue.contains(noOpener))
-            m_linkRelations |= Relation::NoOpener;
+            m_linkRelations.add(Relation::NoOpener);
         if (m_relList)
             m_relList->associatedAttributeValueChanged(value);
     }
         if (m_relList)
             m_relList->associatedAttributeValueChanged(value);
     }
index 507ffba..e00d509 100644 (file)
@@ -319,9 +319,9 @@ void InspectorPageAgent::reload(ErrorString&, const bool* optionalReloadFromOrig
 
     OptionSet<ReloadOption> reloadOptions;
     if (reloadFromOrigin)
 
     OptionSet<ReloadOption> reloadOptions;
     if (reloadFromOrigin)
-        reloadOptions |= ReloadOption::FromOrigin;
+        reloadOptions.add(ReloadOption::FromOrigin);
     if (!revalidateAllResources)
     if (!revalidateAllResources)
-        reloadOptions |= ReloadOption::ExpiredOnly;
+        reloadOptions.add(ReloadOption::ExpiredOnly);
 
     m_page.mainFrame().loader().reload(reloadOptions);
 }
 
     m_page.mainFrame().loader().reload(reloadOptions);
 }
index e3656f0..68126ba 100644 (file)
@@ -369,7 +369,7 @@ void ContextMenuController::contextMenuItemSelected(ContextMenuAction action, co
                 frame->selection().setSelection(wordSelection);
             } else {
                 ASSERT(frame->editor().selectedText().length());
                 frame->selection().setSelection(wordSelection);
             } else {
                 ASSERT(frame->editor().selectedText().length());
-                replaceOptions |= ReplaceSelectionCommand::SelectReplacement;
+                replaceOptions.add(ReplaceSelectionCommand::SelectReplacement);
             }
 
             Document* document = frame->document();
             }
 
             Document* document = frame->document();
index 57a3d8c..04fc305 100644 (file)
@@ -1221,14 +1221,14 @@ bool DOMWindow::find(const String& string, bool caseSensitive, bool backwards, b
         return false;
 
     // FIXME (13016): Support wholeWord, searchInFrames and showDialog.    
         return false;
 
     // FIXME (13016): Support wholeWord, searchInFrames and showDialog.    
-    FindOptions options;
+    FindOptions options { DoNotTraverseFlatTree };
     if (backwards)
     if (backwards)
-        options |= Backwards;
+        options.add(Backwards);
     if (!caseSensitive)
     if (!caseSensitive)
-        options |= CaseInsensitive;
+        options.add(CaseInsensitive);
     if (wrap)
     if (wrap)
-        options |= WrapAround;
-    return m_frame->editor().findString(string, options | DoNotTraverseFlatTree);
+        options.add(WrapAround);
+    return m_frame->editor().findString(string, options);
 }
 
 bool DOMWindow::offscreenBuffering() const
 }
 
 bool DOMWindow::offscreenBuffering() const
index 64f200a..5d92746 100644 (file)
@@ -619,9 +619,9 @@ bool DragController::concludeEditDrag(const DragData& dragData)
             if (setSelectionToDragCaret(innerFrame.get(), dragCaret, range, point)) {
                 OptionSet<ReplaceSelectionCommand::CommandOption> options { ReplaceSelectionCommand::SelectReplacement, ReplaceSelectionCommand::PreventNesting };
                 if (dragData.canSmartReplace())
             if (setSelectionToDragCaret(innerFrame.get(), dragCaret, range, point)) {
                 OptionSet<ReplaceSelectionCommand::CommandOption> options { ReplaceSelectionCommand::SelectReplacement, ReplaceSelectionCommand::PreventNesting };
                 if (dragData.canSmartReplace())
-                    options |= ReplaceSelectionCommand::SmartReplace;
+                    options.add(ReplaceSelectionCommand::SmartReplace);
                 if (chosePlainText)
                 if (chosePlainText)
-                    options |= ReplaceSelectionCommand::MatchStyle;
+                    options.add(ReplaceSelectionCommand::MatchStyle);
                 ReplaceSelectionCommand::create(*m_documentUnderMouse, fragment.releaseNonNull(), options, EditActionInsertFromDrop)->apply();
             }
         }
                 ReplaceSelectionCommand::create(*m_documentUnderMouse, fragment.releaseNonNull(), options, EditActionInsertFromDrop)->apply();
             }
         }
index 31d896d..787bd48 100644 (file)
@@ -92,13 +92,13 @@ std::unique_ptr<ImageBuffer> snapshotFrameRectWithClip(Frame& frame, const IntRe
 
     auto paintBehavior = state.paintBehavior;
     if (options & SnapshotOptionsForceBlackText)
 
     auto paintBehavior = state.paintBehavior;
     if (options & SnapshotOptionsForceBlackText)
-        paintBehavior |= PaintBehavior::ForceBlackText;
+        paintBehavior.add(PaintBehavior::ForceBlackText);
     if (options & SnapshotOptionsPaintSelectionOnly)
     if (options & SnapshotOptionsPaintSelectionOnly)
-        paintBehavior |= PaintBehavior::SelectionOnly;
+        paintBehavior.add(PaintBehavior::SelectionOnly);
     if (options & SnapshotOptionsPaintSelectionAndBackgroundsOnly)
     if (options & SnapshotOptionsPaintSelectionAndBackgroundsOnly)
-        paintBehavior |= PaintBehavior::SelectionAndBackgroundsOnly;
+        paintBehavior.add(PaintBehavior::SelectionAndBackgroundsOnly);
     if (options & SnapshotOptionsPaintEverythingExcludingSelection)
     if (options & SnapshotOptionsPaintEverythingExcludingSelection)
-        paintBehavior |= PaintBehavior::ExcludeSelection;
+        paintBehavior.add(PaintBehavior::ExcludeSelection);
 
     // Other paint behaviors are set by paintContentsForSnapshot.
     frame.view()->setPaintBehavior(paintBehavior);
 
     // Other paint behaviors are set by paintContentsForSnapshot.
     frame.view()->setPaintBehavior(paintBehavior);
index 51bd3c2..18c5477 100644 (file)
@@ -140,11 +140,11 @@ static OptionSet<RenderLayer::UpdateLayerPositionsFlag> updateLayerPositionFlags
 {
     auto flags = RenderLayer::updateLayerPositionsDefaultFlags();
     if (didFullRepaint) {
 {
     auto flags = RenderLayer::updateLayerPositionsDefaultFlags();
     if (didFullRepaint) {
-        flags -= RenderLayer::CheckForRepaint;
-        flags |= RenderLayer::NeedsFullRepaintInBacking;
+        flags.remove(RenderLayer::CheckForRepaint);
+        flags.add(RenderLayer::NeedsFullRepaintInBacking);
     }
     if (isRelayoutingSubtree && layer->enclosingPaginationLayer(RenderLayer::IncludeCompositedPaginatedLayers))
     }
     if (isRelayoutingSubtree && layer->enclosingPaginationLayer(RenderLayer::IncludeCompositedPaginatedLayers))
-        flags |= RenderLayer::UpdatePagination;
+        flags.add(RenderLayer::UpdatePagination);
     return flags;
 }
 
     return flags;
 }
 
@@ -4068,18 +4068,18 @@ void FrameView::willPaintContents(GraphicsContext& context, const IntRect&, Pain
     
     if (FrameView* parentView = parentFrameView()) {
         if (parentView->paintBehavior() & PaintBehavior::FlattenCompositingLayers)
     
     if (FrameView* parentView = parentFrameView()) {
         if (parentView->paintBehavior() & PaintBehavior::FlattenCompositingLayers)
-            m_paintBehavior |= PaintBehavior::FlattenCompositingLayers;
+            m_paintBehavior.add(PaintBehavior::FlattenCompositingLayers);
         
         if (parentView->paintBehavior() & PaintBehavior::Snapshotting)
         
         if (parentView->paintBehavior() & PaintBehavior::Snapshotting)
-            m_paintBehavior |= PaintBehavior::Snapshotting;
+            m_paintBehavior.add(PaintBehavior::Snapshotting);
         
         if (parentView->paintBehavior() & PaintBehavior::TileFirstPaint)
         
         if (parentView->paintBehavior() & PaintBehavior::TileFirstPaint)
-            m_paintBehavior |= PaintBehavior::TileFirstPaint;
+            m_paintBehavior.add(PaintBehavior::TileFirstPaint);
     }
 
     if (document->printing()) {
     }
 
     if (document->printing()) {
-        m_paintBehavior |= PaintBehavior::FlattenCompositingLayers;
-        m_paintBehavior |= PaintBehavior::Snapshotting;
+        m_paintBehavior.add(PaintBehavior::FlattenCompositingLayers);
+        m_paintBehavior.add(PaintBehavior::Snapshotting);
     }
 
     paintingState.isFlatteningPaintOfRootFrame = (m_paintBehavior & PaintBehavior::FlattenCompositingLayers) && !frame().ownerElement();
     }
 
     paintingState.isFlatteningPaintOfRootFrame = (m_paintBehavior & PaintBehavior::FlattenCompositingLayers) && !frame().ownerElement();
index e12b5ff..344607b 100644 (file)
@@ -1643,11 +1643,11 @@ void Page::setIsVisible(bool isVisible)
     auto state = m_activityState;
 
     if (isVisible) {
     auto state = m_activityState;
 
     if (isVisible) {
-        state -= ActivityState::IsVisuallyIdle;
-        state |= { ActivityState::IsVisible, ActivityState::IsVisibleOrOccluded };
+        state.remove(ActivityState::IsVisuallyIdle);
+        state.add({ ActivityState::IsVisible, ActivityState::IsVisibleOrOccluded });
     } else {
     } else {
-        state |= ActivityState::IsVisuallyIdle;
-        state -= { ActivityState::IsVisible, ActivityState::IsVisibleOrOccluded };
+        state.add(ActivityState::IsVisuallyIdle);
+        state.remove({ ActivityState::IsVisible, ActivityState::IsVisibleOrOccluded });
     }
     setActivityState(state);
 }
     }
     setActivityState(state);
 }
index bc2f45d..849641c 100644 (file)
@@ -65,7 +65,7 @@ ExceptionOr<void> PerformanceObserver::observe(Init&& init)
     OptionSet<PerformanceEntry::Type> filter;
     for (const String& entryType : init.entryTypes) {
         if (auto type = PerformanceEntry::parseEntryTypeString(entryType))
     OptionSet<PerformanceEntry::Type> filter;
     for (const String& entryType : init.entryTypes) {
         if (auto type = PerformanceEntry::parseEntryTypeString(entryType))
-            filter |= *type;
+            filter.add(*type);
     }
 
     if (filter.isEmpty())
     }
 
     if (filter.isEmpty())
index 73120c4..2ac016c 100644 (file)
@@ -78,8 +78,8 @@ RefPtr<TextIndicator> TextIndicator::createWithRange(const Range& range, TextInd
     VisibleSelection oldSelection = frame->selection().selection();
     OptionSet<TemporarySelectionOption> temporarySelectionOptions;
 #if PLATFORM(IOS)
     VisibleSelection oldSelection = frame->selection().selection();
     OptionSet<TemporarySelectionOption> temporarySelectionOptions;
 #if PLATFORM(IOS)
-    temporarySelectionOptions |= TemporarySelectionOptionIgnoreSelectionChanges;
-    temporarySelectionOptions |= TemporarySelectionOptionEnableAppearanceUpdates;
+    temporarySelectionOptions.add(TemporarySelectionOptionIgnoreSelectionChanges);
+    temporarySelectionOptions.add(TemporarySelectionOptionEnableAppearanceUpdates);
 #endif
     TemporarySelectionChange selectionChange(*frame, { range }, temporarySelectionOptions);
 
 #endif
     TemporarySelectionChange selectionChange(*frame, { range }, temporarySelectionOptions);
 
index cf90107..067645c 100644 (file)
@@ -120,7 +120,7 @@ OptionSet<DisabledAdaptations> parseDisabledAdaptations(const String& disabledAd
     for (auto& name : disabledAdaptationsString.split(',')) {
         auto normalizedName = name.stripWhiteSpace().convertToASCIILowercase();
         if (normalizedName == watchAdaptationName())
     for (auto& name : disabledAdaptationsString.split(',')) {
         auto normalizedName = name.stripWhiteSpace().convertToASCIILowercase();
         if (normalizedName == watchAdaptationName())
-            disabledAdaptations |= DisabledAdaptations::Watch;
+            disabledAdaptations.add(DisabledAdaptations::Watch);
     }
     return disabledAdaptations;
 }
     }
     return disabledAdaptations;
 }
index 7904611..5b592fd 100644 (file)
@@ -151,11 +151,11 @@ public:
     void enforceSandboxFlags(SandboxFlags sandboxFlags) { m_sandboxFlags |= sandboxFlags; }
     void addHashAlgorithmsForInlineScripts(OptionSet<ContentSecurityPolicyHashAlgorithm> hashAlgorithmsForInlineScripts)
     {
     void enforceSandboxFlags(SandboxFlags sandboxFlags) { m_sandboxFlags |= sandboxFlags; }
     void addHashAlgorithmsForInlineScripts(OptionSet<ContentSecurityPolicyHashAlgorithm> hashAlgorithmsForInlineScripts)
     {
-        m_hashAlgorithmsForInlineScripts |= hashAlgorithmsForInlineScripts;
+        m_hashAlgorithmsForInlineScripts.add(hashAlgorithmsForInlineScripts);
     }
     void addHashAlgorithmsForInlineStylesheets(OptionSet<ContentSecurityPolicyHashAlgorithm> hashAlgorithmsForInlineStylesheets)
     {
     }
     void addHashAlgorithmsForInlineStylesheets(OptionSet<ContentSecurityPolicyHashAlgorithm> hashAlgorithmsForInlineStylesheets)
     {
-        m_hashAlgorithmsForInlineStylesheets |= hashAlgorithmsForInlineStylesheets;
+        m_hashAlgorithmsForInlineStylesheets.add(hashAlgorithmsForInlineStylesheets);
     }
 
     // Used by ContentSecurityPolicySource
     }
 
     // Used by ContentSecurityPolicySource
index 40b5dd1..07e946d 100644 (file)
@@ -473,7 +473,7 @@ bool ContentSecurityPolicySourceList::parseHashSource(const UChar* begin, const
     if (digest->value.size() > ContentSecurityPolicyHash::maximumDigestLength)
         return false;
 
     if (digest->value.size() > ContentSecurityPolicyHash::maximumDigestLength)
         return false;
 
-    m_hashAlgorithmsUsed |= digest->algorithm;
+    m_hashAlgorithmsUsed.add(digest->algorithm);
     m_hashes.add(WTFMove(*digest));
     return true;
 }
     m_hashes.add(WTFMove(*digest));
     return true;
 }
index 815a3c9..b176c03 100644 (file)
@@ -115,13 +115,13 @@ protected:
         , m_timestamp(timestamp)
     {
         if (shiftKey)
         , m_timestamp(timestamp)
     {
         if (shiftKey)
-            m_modifiers |= Modifier::ShiftKey;
+            m_modifiers.add(Modifier::ShiftKey);
         if (ctrlKey)
         if (ctrlKey)
-            m_modifiers |= Modifier::CtrlKey;
+            m_modifiers.add(Modifier::CtrlKey);
         if (altKey)
         if (altKey)
-            m_modifiers |= Modifier::AltKey;
+            m_modifiers.add(Modifier::AltKey);
         if (metaKey)
         if (metaKey)
-            m_modifiers |= Modifier::MetaKey;
+            m_modifiers.add(Modifier::MetaKey);
     }
 
     // Explicit protected destructor so that people don't accidentally
     }
 
     // Explicit protected destructor so that people don't accidentally
index 5e71b3a..e14a9c8 100644 (file)
@@ -1330,15 +1330,15 @@ static OptionSet<PlatformEvent::Modifier> modifiersForGdkKeyEvent(GdkEventKey* e
 {
     OptionSet<PlatformEvent::Modifier> modifiers;
     if (event->state & GDK_SHIFT_MASK || event->keyval == GDK_3270_BackTab)
 {
     OptionSet<PlatformEvent::Modifier> modifiers;
     if (event->state & GDK_SHIFT_MASK || event->keyval == GDK_3270_BackTab)
-        modifiers |= PlatformEvent::Modifier::ShiftKey;
+        modifiers.add(PlatformEvent::Modifier::ShiftKey);
     if (event->state & GDK_CONTROL_MASK)
     if (event->state & GDK_CONTROL_MASK)
-        modifiers |= PlatformEvent::Modifier::CtrlKey;
+        modifiers.add(PlatformEvent::Modifier::CtrlKey);
     if (event->state & GDK_MOD1_MASK)
     if (event->state & GDK_MOD1_MASK)
-        modifiers |= PlatformEvent::Modifier::AltKey;
+        modifiers.add(PlatformEvent::Modifier::AltKey);
     if (event->state & GDK_META_MASK)
     if (event->state & GDK_META_MASK)
-        modifiers |= PlatformEvent::Modifier::MetaKey;
+        modifiers.add(PlatformEvent::Modifier::MetaKey);
     if (event->state & GDK_LOCK_MASK)
     if (event->state & GDK_LOCK_MASK)
-        modifiers |= PlatformEvent::Modifier::CapsLockKey;
+        modifiers.add(PlatformEvent::Modifier::CapsLockKey);
     return modifiers;
 }
 
     return modifiers;
 }
 
index e90204a..9337f81 100644 (file)
@@ -47,15 +47,15 @@ PlatformMouseEvent::PlatformMouseEvent(GdkEventButton* event)
     m_modifierFlags = 0;
 
     if (event->state & GDK_SHIFT_MASK)
     m_modifierFlags = 0;
 
     if (event->state & GDK_SHIFT_MASK)
-        m_modifiers |= PlatformEvent::Modifier::ShiftKey;
+        m_modifiers.add(PlatformEvent::Modifier::ShiftKey);
     if (event->state & GDK_CONTROL_MASK)
     if (event->state & GDK_CONTROL_MASK)
-        m_modifiers |= PlatformEvent::Modifier::CtrlKey;
+        m_modifiers.add(PlatformEvent::Modifier::CtrlKey);
     if (event->state & GDK_MOD1_MASK)
     if (event->state & GDK_MOD1_MASK)
-        m_modifiers |= PlatformEvent::Modifier::AltKey;
+        m_modifiers.add(PlatformEvent::Modifier::AltKey);
     if (event->state & GDK_META_MASK)
     if (event->state & GDK_META_MASK)
-        m_modifiers |= PlatformEvent::Modifier::MetaKey;
+        m_modifiers.add(PlatformEvent::Modifier::MetaKey);
     if (PlatformKeyboardEvent::modifiersContainCapsLock(event->state))
     if (PlatformKeyboardEvent::modifiersContainCapsLock(event->state))
-        m_modifiers |= PlatformEvent::Modifier::CapsLockKey;
+        m_modifiers.add(PlatformEvent::Modifier::CapsLockKey);
 
     switch (event->type) {
     case GDK_BUTTON_PRESS:
 
     switch (event->type) {
     case GDK_BUTTON_PRESS:
@@ -96,15 +96,15 @@ PlatformMouseEvent::PlatformMouseEvent(GdkEventMotion* motion)
     m_modifierFlags = 0;
 
     if (motion->state & GDK_SHIFT_MASK)
     m_modifierFlags = 0;
 
     if (motion->state & GDK_SHIFT_MASK)
-        m_modifiers |= PlatformEvent::Modifier::ShiftKey;
+        m_modifiers.add(PlatformEvent::Modifier::ShiftKey);
     if (motion->state & GDK_CONTROL_MASK)
     if (motion->state & GDK_CONTROL_MASK)
-        m_modifiers |= PlatformEvent::Modifier::CtrlKey;
+        m_modifiers.add(PlatformEvent::Modifier::CtrlKey);
     if (motion->state & GDK_MOD1_MASK)
     if (motion->state & GDK_MOD1_MASK)
-        m_modifiers |= PlatformEvent::Modifier::AltKey;
+        m_modifiers.add(PlatformEvent::Modifier::AltKey);
     if (motion->state & GDK_META_MASK)
     if (motion->state & GDK_META_MASK)
-        m_modifiers |= PlatformEvent::Modifier::MetaKey;
+        m_modifiers.add(PlatformEvent::Modifier::MetaKey);
     if (PlatformKeyboardEvent::modifiersContainCapsLock(motion->state))
     if (PlatformKeyboardEvent::modifiersContainCapsLock(motion->state))
-        m_modifiers |= PlatformEvent::Modifier::CapsLockKey;
+        m_modifiers.add(PlatformEvent::Modifier::CapsLockKey);
 
     switch (motion->type) {
     case GDK_MOTION_NOTIFY:
 
     switch (motion->type) {
     case GDK_MOTION_NOTIFY:
index 3ae1dad..a3b4774 100644 (file)
@@ -47,15 +47,15 @@ PlatformWheelEvent::PlatformWheelEvent(GdkEventScroll* event)
     m_timestamp = wallTimeForEvent(event);
 
     if (event->state & GDK_SHIFT_MASK)
     m_timestamp = wallTimeForEvent(event);
 
     if (event->state & GDK_SHIFT_MASK)
-        m_modifiers |= Modifier::ShiftKey;
+        m_modifiers.add(Modifier::ShiftKey);
     if (event->state & GDK_CONTROL_MASK)
     if (event->state & GDK_CONTROL_MASK)
-        m_modifiers |= Modifier::CtrlKey;
+        m_modifiers.add(Modifier::CtrlKey);
     if (event->state & GDK_MOD1_MASK)
     if (event->state & GDK_MOD1_MASK)
-        m_modifiers |= Modifier::AltKey;
+        m_modifiers.add(Modifier::AltKey);
     if (event->state & GDK_META_MASK)
     if (event->state & GDK_META_MASK)
-        m_modifiers |= Modifier::MetaKey;
+        m_modifiers.add(Modifier::MetaKey);
     if (PlatformKeyboardEvent::modifiersContainCapsLock(event->state))
     if (PlatformKeyboardEvent::modifiersContainCapsLock(event->state))
-        m_modifiers |= PlatformEvent::Modifier::CapsLockKey;
+        m_modifiers.add(PlatformEvent::Modifier::CapsLockKey);
 
     m_deltaX = 0;
     m_deltaY = 0;
 
     m_deltaX = 0;
     m_deltaY = 0;
index dbdae99..d4e5e0a 100644 (file)
@@ -358,13 +358,13 @@ RenderThemeScrollbarGadget::RenderThemeScrollbarGadget(const RenderThemeGadget::
     gtk_style_context_get_style(m_context.get(), "has-backward-stepper", &hasBackward, "has-forward-stepper", &hasForward,
         "has-secondary-backward-stepper", &hasSecondaryBackward, "has-secondary-forward-stepper", &hasSecondaryForward, nullptr);
     if (hasBackward)
     gtk_style_context_get_style(m_context.get(), "has-backward-stepper", &hasBackward, "has-forward-stepper", &hasForward,
         "has-secondary-backward-stepper", &hasSecondaryBackward, "has-secondary-forward-stepper", &hasSecondaryForward, nullptr);
     if (hasBackward)
-        m_steppers |= Steppers::Backward;
+        m_steppers.add(Steppers::Backward);
     if (hasForward)
     if (hasForward)
-        m_steppers |= Steppers::Forward;
+        m_steppers.add(Steppers::Forward);
     if (hasSecondaryBackward)
     if (hasSecondaryBackward)
-        m_steppers |= Steppers::SecondaryBackward;
+        m_steppers.add(Steppers::SecondaryBackward);
     if (hasSecondaryForward)
     if (hasSecondaryForward)
-        m_steppers |= Steppers::SecondaryForward;
+        m_steppers.add(Steppers::SecondaryForward);
 }
 
 void RenderThemeScrollbarGadget::renderStepper(cairo_t* cr, const FloatRect& paintRect, RenderThemeGadget* stepperGadget, GtkOrientation orientation, Steppers stepper)
 }
 
 void RenderThemeScrollbarGadget::renderStepper(cairo_t* cr, const FloatRect& paintRect, RenderThemeGadget* stepperGadget, GtkOrientation orientation, Steppers stepper)
index 6f24819..9e1fb97 100644 (file)
@@ -43,15 +43,15 @@ static OptionSet<PlatformEvent::Modifier> modifiersForEvent(WebEvent *event)
     OptionSet<PlatformEvent::Modifier> modifiers;
 
     if (event.modifierFlags & WebEventFlagMaskShift)
     OptionSet<PlatformEvent::Modifier> modifiers;
 
     if (event.modifierFlags & WebEventFlagMaskShift)
-        modifiers |= PlatformEvent::Modifier::ShiftKey;
+        modifiers.add(PlatformEvent::Modifier::ShiftKey);
     if (event.modifierFlags & WebEventFlagMaskControl)
     if (event.modifierFlags & WebEventFlagMaskControl)
-        modifiers |= PlatformEvent::Modifier::CtrlKey;
+        modifiers.add(PlatformEvent::Modifier::CtrlKey);
     if (event.modifierFlags & WebEventFlagMaskAlternate)
     if (event.modifierFlags & WebEventFlagMaskAlternate)
-        modifiers |= PlatformEvent::Modifier::AltKey;
+        modifiers.add(PlatformEvent::Modifier::AltKey);
     if (event.modifierFlags & WebEventFlagMaskCommand)
     if (event.modifierFlags & WebEventFlagMaskCommand)
-        modifiers |= PlatformEvent::Modifier::MetaKey;
+        modifiers.add(PlatformEvent::Modifier::MetaKey);
     if (event.modifierFlags & WebEventFlagMaskAlphaShift)
     if (event.modifierFlags & WebEventFlagMaskAlphaShift)
-        modifiers |= PlatformEvent::Modifier::CapsLockKey;
+        modifiers.add(PlatformEvent::Modifier::CapsLockKey);
 
     return modifiers;
 }
 
     return modifiers;
 }
index 5985477..ce6e00b 100644 (file)
@@ -666,15 +666,15 @@ OptionSet<PlatformEvent::Modifier> modifiersForEvent(NSEvent *event)
     OptionSet<PlatformEvent::Modifier> modifiers;
 
     if (event.modifierFlags & NSEventModifierFlagShift)
     OptionSet<PlatformEvent::Modifier> modifiers;
 
     if (event.modifierFlags & NSEventModifierFlagShift)
-        modifiers |= PlatformEvent::Modifier::ShiftKey;
+        modifiers.add(PlatformEvent::Modifier::ShiftKey);
     if (event.modifierFlags & NSEventModifierFlagControl)
     if (event.modifierFlags & NSEventModifierFlagControl)
-        modifiers |= PlatformEvent::Modifier::CtrlKey;
+        modifiers.add(PlatformEvent::Modifier::CtrlKey);
     if (event.modifierFlags & NSEventModifierFlagOption)
     if (event.modifierFlags & NSEventModifierFlagOption)
-        modifiers |= PlatformEvent::Modifier::AltKey;
+        modifiers.add(PlatformEvent::Modifier::AltKey);
     if (event.modifierFlags & NSEventModifierFlagCommand)
     if (event.modifierFlags & NSEventModifierFlagCommand)
-        modifiers |= PlatformEvent::Modifier::MetaKey;
+        modifiers.add(PlatformEvent::Modifier::MetaKey);
     if (event.modifierFlags & NSEventModifierFlagCapsLock)
     if (event.modifierFlags & NSEventModifierFlagCapsLock)
-        modifiers |= PlatformEvent::Modifier::CapsLockKey;
+        modifiers.add(PlatformEvent::Modifier::CapsLockKey);
 
     return modifiers;
 }
 
     return modifiers;
 }
index 0678dee..981ab30 100644 (file)
@@ -557,17 +557,17 @@ void RenderLayer::updateLayerPositions(RenderGeometryMap* geometryMap, OptionSet
     // Clear the IsCompositingUpdateRoot flag once we've found the first compositing layer in this update.
     bool isUpdateRoot = flags.contains(IsCompositingUpdateRoot);
     if (isComposited())
     // Clear the IsCompositingUpdateRoot flag once we've found the first compositing layer in this update.
     bool isUpdateRoot = flags.contains(IsCompositingUpdateRoot);
     if (isComposited())
-        flags -= IsCompositingUpdateRoot;
+        flags.remove(IsCompositingUpdateRoot);
 
     if (renderer().isInFlowRenderFragmentedFlow()) {
         updatePagination();
 
     if (renderer().isInFlowRenderFragmentedFlow()) {
         updatePagination();
-        flags |= UpdatePagination;
+        flags.add(UpdatePagination);
     }
 
     if (transform()) {
     }
 
     if (transform()) {
-        flags |= SeenTransformedLayer;
+        flags.add(SeenTransformedLayer);
         if (!transform()->isAffine())
         if (!transform()->isAffine())
-            flags |= Seen3DTransformedLayer;
+            flags.add(Seen3DTransformedLayer);
     }
 
     for (RenderLayer* child = firstChild(); child; child = child->nextSibling())
     }
 
     for (RenderLayer* child = firstChild(); child; child = child->nextSibling())
@@ -576,9 +576,9 @@ void RenderLayer::updateLayerPositions(RenderGeometryMap* geometryMap, OptionSet
     if ((flags & UpdateCompositingLayers) && isComposited()) {
         OptionSet<RenderLayerBacking::UpdateAfterLayoutFlags> updateFlags;
         if (flags & NeedsFullRepaintInBacking)
     if ((flags & UpdateCompositingLayers) && isComposited()) {
         OptionSet<RenderLayerBacking::UpdateAfterLayoutFlags> updateFlags;
         if (flags & NeedsFullRepaintInBacking)
-            updateFlags |= RenderLayerBacking::UpdateAfterLayoutFlags::NeedsFullRepaint;
+            updateFlags.add(RenderLayerBacking::UpdateAfterLayoutFlags::NeedsFullRepaint);
         if (isUpdateRoot)
         if (isUpdateRoot)
-            updateFlags |= RenderLayerBacking::UpdateAfterLayoutFlags::IsUpdateRoot;
+            updateFlags.add(RenderLayerBacking::UpdateAfterLayoutFlags::IsUpdateRoot);
         backing()->updateAfterLayout(updateFlags);
     }
         
         backing()->updateAfterLayout(updateFlags);
     }
         
@@ -851,16 +851,16 @@ void RenderLayer::updateLayerPositionsAfterScroll(RenderGeometryMap* geometryMap
 
     bool positionChanged = updateLayerPosition();
     if (positionChanged)
 
     bool positionChanged = updateLayerPosition();
     if (positionChanged)
-        flags |= HasChangedAncestor;
+        flags.add(HasChangedAncestor);
 
     if (flags.containsAny({ HasChangedAncestor, HasSeenViewportConstrainedAncestor, IsOverflowScroll }))
         clearClipRects();
 
     if (renderer().style().hasViewportConstrainedPosition())
 
     if (flags.containsAny({ HasChangedAncestor, HasSeenViewportConstrainedAncestor, IsOverflowScroll }))
         clearClipRects();
 
     if (renderer().style().hasViewportConstrainedPosition())
-        flags |= HasSeenViewportConstrainedAncestor;
+        flags.add(HasSeenViewportConstrainedAncestor);
 
     if (renderer().hasOverflowClip())
 
     if (renderer().hasOverflowClip())
-        flags |= HasSeenAncestorWithOverflowClip;
+        flags.add(HasSeenAncestorWithOverflowClip);
     
     bool shouldComputeRepaintRects = (flags.contains(HasSeenViewportConstrainedAncestor) || flags.containsAll({ IsOverflowScroll, HasSeenAncestorWithOverflowClip })) && isSelfPaintingLayer();
     bool isVisuallyEmpty = !isVisuallyNonEmpty();
     
     bool shouldComputeRepaintRects = (flags.contains(HasSeenViewportConstrainedAncestor) || flags.containsAll({ IsOverflowScroll, HasSeenAncestorWithOverflowClip })) && isSelfPaintingLayer();
     bool isVisuallyEmpty = !isVisuallyNonEmpty();
@@ -3973,7 +3973,7 @@ void RenderLayer::paintLayer(GraphicsContext& context, const LayerPaintingInfo&
         // The performingPaintInvalidation() painting pass goes through compositing layers,
         // but we need to ensure that we don't cache clip rects computed with the wrong root in this case.
         if (context.performingPaintInvalidation() || (paintingInfo.paintBehavior & PaintBehavior::FlattenCompositingLayers))
         // The performingPaintInvalidation() painting pass goes through compositing layers,
         // but we need to ensure that we don't cache clip rects computed with the wrong root in this case.
         if (context.performingPaintInvalidation() || (paintingInfo.paintBehavior & PaintBehavior::FlattenCompositingLayers))
-            paintFlags |= PaintLayerTemporaryClipRects;
+            paintFlags.add(PaintLayerTemporaryClipRects);
         else if (!backing()->paintsIntoWindow()
             && !backing()->paintsIntoCompositedAncestor()
             && !shouldDoSoftwarePaint(this, paintFlags.contains(PaintLayerPaintingReflection))
         else if (!backing()->paintsIntoWindow()
             && !backing()->paintsIntoCompositedAncestor()
             && !shouldDoSoftwarePaint(this, paintFlags.contains(PaintLayerPaintingReflection))
@@ -4000,7 +4000,7 @@ void RenderLayer::paintLayer(GraphicsContext& context, const LayerPaintingInfo&
         return;
 
     if (paintsWithTransparency(paintingInfo.paintBehavior))
         return;
 
     if (paintsWithTransparency(paintingInfo.paintBehavior))
-        paintFlags |= PaintLayerHaveTransparency;
+        paintFlags.add(PaintLayerHaveTransparency);
 
     // PaintLayerAppliedTransform is used in RenderReplica, to avoid applying the transform twice.
     if (paintsWithTransform(paintingInfo.paintBehavior) && !(paintFlags & PaintLayerAppliedTransform)) {
 
     // PaintLayerAppliedTransform is used in RenderReplica, to avoid applying the transform twice.
     if (paintsWithTransform(paintingInfo.paintBehavior) && !(paintFlags & PaintLayerAppliedTransform)) {
@@ -4061,7 +4061,7 @@ void RenderLayer::paintLayerContentsAndReflection(GraphicsContext& context, cons
         m_paintingInsideReflection = false;
     }
 
         m_paintingInsideReflection = false;
     }
 
-    localPaintFlags |= paintLayerPaintingCompositingAllPhasesFlags();
+    localPaintFlags.add(paintLayerPaintingCompositingAllPhasesFlags());
     paintLayerContents(context, paintingInfo, localPaintFlags);
 }
 
     paintLayerContents(context, paintingInfo, localPaintFlags);
 }
 
@@ -4355,21 +4355,21 @@ void RenderLayer::paintLayerContents(GraphicsContext& context, const LayerPainti
 
         OptionSet<PaintBehavior> paintBehavior = PaintBehavior::Normal;
         if (localPaintFlags & PaintLayerPaintingSkipRootBackground)
 
         OptionSet<PaintBehavior> paintBehavior = PaintBehavior::Normal;
         if (localPaintFlags & PaintLayerPaintingSkipRootBackground)
-            paintBehavior |= PaintBehavior::SkipRootBackground;
+            paintBehavior.add(PaintBehavior::SkipRootBackground);
         else if (localPaintFlags & PaintLayerPaintingRootBackgroundOnly)
         else if (localPaintFlags & PaintLayerPaintingRootBackgroundOnly)
-            paintBehavior |= PaintBehavior::RootBackgroundOnly;
+            paintBehavior.add(PaintBehavior::RootBackgroundOnly);
 
         if (paintingInfo.paintBehavior & PaintBehavior::FlattenCompositingLayers)
 
         if (paintingInfo.paintBehavior & PaintBehavior::FlattenCompositingLayers)
-            paintBehavior |= PaintBehavior::FlattenCompositingLayers;
+            paintBehavior.add(PaintBehavior::FlattenCompositingLayers);
         
         if (paintingInfo.paintBehavior & PaintBehavior::Snapshotting)
         
         if (paintingInfo.paintBehavior & PaintBehavior::Snapshotting)
-            paintBehavior |= PaintBehavior::Snapshotting;
+            paintBehavior.add(PaintBehavior::Snapshotting);
         
         if ((paintingInfo.paintBehavior & PaintBehavior::TileFirstPaint) && isRenderViewLayer())
         
         if ((paintingInfo.paintBehavior & PaintBehavior::TileFirstPaint) && isRenderViewLayer())
-            paintBehavior |= PaintBehavior::TileFirstPaint;
+            paintBehavior.add(PaintBehavior::TileFirstPaint);
 
         if (paintingInfo.paintBehavior & PaintBehavior::ExcludeSelection)
 
         if (paintingInfo.paintBehavior & PaintBehavior::ExcludeSelection)
-            paintBehavior |= PaintBehavior::ExcludeSelection;
+            paintBehavior.add(PaintBehavior::ExcludeSelection);
 
         LayoutRect paintDirtyRect = localPaintingInfo.paintDirtyRect;
         if (shouldPaintContent || shouldPaintOutline || isPaintingOverlayScrollbars) {
 
         LayoutRect paintDirtyRect = localPaintingInfo.paintDirtyRect;
         if (shouldPaintContent || shouldPaintOutline || isPaintingOverlayScrollbars) {
@@ -4438,13 +4438,13 @@ void RenderLayer::paintLayerContents(GraphicsContext& context, const LayerPainti
     if (shouldPaintContent && !(selectionOnly || selectionAndBackgroundsOnly)) {
         OptionSet<PaintBehavior> paintBehavior = PaintBehavior::Normal;
         if (paintingInfo.paintBehavior & PaintBehavior::FlattenCompositingLayers)
     if (shouldPaintContent && !(selectionOnly || selectionAndBackgroundsOnly)) {
         OptionSet<PaintBehavior> paintBehavior = PaintBehavior::Normal;
         if (paintingInfo.paintBehavior & PaintBehavior::FlattenCompositingLayers)
-            paintBehavior |= PaintBehavior::FlattenCompositingLayers;
+            paintBehavior.add(PaintBehavior::FlattenCompositingLayers);
         
         if (paintingInfo.paintBehavior & PaintBehavior::Snapshotting)
         
         if (paintingInfo.paintBehavior & PaintBehavior::Snapshotting)
-            paintBehavior |= PaintBehavior::Snapshotting;
+            paintBehavior.add(PaintBehavior::Snapshotting);
         
         if (paintingInfo.paintBehavior & PaintBehavior::TileFirstPaint)
         
         if (paintingInfo.paintBehavior & PaintBehavior::TileFirstPaint)
-            paintBehavior |= PaintBehavior::TileFirstPaint;
+            paintBehavior.add(PaintBehavior::TileFirstPaint);
 
         if (shouldPaintMask(paintingInfo.paintBehavior, localPaintFlags)) {
             // Paint the mask for the fragments.
 
         if (shouldPaintMask(paintingInfo.paintBehavior, localPaintFlags)) {
             // Paint the mask for the fragments.
@@ -4770,13 +4770,13 @@ void RenderLayer::paintForegroundForFragments(const LayerFragments& layerFragmen
         localPaintBehavior = paintBehavior;
 
     if (localPaintingInfo.paintBehavior & PaintBehavior::ExcludeSelection)
         localPaintBehavior = paintBehavior;
 
     if (localPaintingInfo.paintBehavior & PaintBehavior::ExcludeSelection)
-        localPaintBehavior |= PaintBehavior::ExcludeSelection;
+        localPaintBehavior.add(PaintBehavior::ExcludeSelection);
     
     if (localPaintingInfo.paintBehavior & PaintBehavior::Snapshotting)
     
     if (localPaintingInfo.paintBehavior & PaintBehavior::Snapshotting)
-        localPaintBehavior |= PaintBehavior::Snapshotting;
+        localPaintBehavior.add(PaintBehavior::Snapshotting);
     
     if (localPaintingInfo.paintBehavior & PaintBehavior::TileFirstPaint)
     
     if (localPaintingInfo.paintBehavior & PaintBehavior::TileFirstPaint)
-        localPaintBehavior |= PaintBehavior::TileFirstPaint;
+        localPaintBehavior.add(PaintBehavior::TileFirstPaint);
 
     // Optimize clipping for the single fragment case.
     bool shouldClip = localPaintingInfo.clipToDirtyRect && layerFragments.size() == 1 && layerFragments[0].shouldPaintContent && !layerFragments[0].foregroundRect.isEmpty();
 
     // Optimize clipping for the single fragment case.
     bool shouldClip = localPaintingInfo.clipToDirtyRect && layerFragments.size() == 1 && layerFragments[0].shouldPaintContent && !layerFragments[0].foregroundRect.isEmpty();
index 8656ece..8bb59ea 100644 (file)
@@ -2534,24 +2534,24 @@ void RenderLayerBacking::paintIntoLayer(const GraphicsLayer* graphicsLayer, Grap
 
     OptionSet<RenderLayer::PaintLayerFlag> paintFlags;
     if (paintingPhase & GraphicsLayerPaintBackground)
 
     OptionSet<RenderLayer::PaintLayerFlag> paintFlags;
     if (paintingPhase & GraphicsLayerPaintBackground)
-        paintFlags |= RenderLayer::PaintLayerPaintingCompositingBackgroundPhase;
+        paintFlags.add(RenderLayer::PaintLayerPaintingCompositingBackgroundPhase);
     if (paintingPhase & GraphicsLayerPaintForeground)
     if (paintingPhase & GraphicsLayerPaintForeground)
-        paintFlags |= RenderLayer::PaintLayerPaintingCompositingForegroundPhase;
+        paintFlags.add(RenderLayer::PaintLayerPaintingCompositingForegroundPhase);
     if (paintingPhase & GraphicsLayerPaintMask)
     if (paintingPhase & GraphicsLayerPaintMask)
-        paintFlags |= RenderLayer::PaintLayerPaintingCompositingMaskPhase;
+        paintFlags.add(RenderLayer::PaintLayerPaintingCompositingMaskPhase);
     if (paintingPhase & GraphicsLayerPaintClipPath)
     if (paintingPhase & GraphicsLayerPaintClipPath)
-        paintFlags |= RenderLayer::PaintLayerPaintingCompositingClipPathPhase;
+        paintFlags.add(RenderLayer::PaintLayerPaintingCompositingClipPathPhase);
     if (paintingPhase & GraphicsLayerPaintChildClippingMask)
     if (paintingPhase & GraphicsLayerPaintChildClippingMask)
-        paintFlags |= RenderLayer::PaintLayerPaintingChildClippingMaskPhase;
+        paintFlags.add(RenderLayer::PaintLayerPaintingChildClippingMaskPhase);
     if (paintingPhase & GraphicsLayerPaintOverflowContents)
     if (paintingPhase & GraphicsLayerPaintOverflowContents)
-        paintFlags |= RenderLayer::PaintLayerPaintingOverflowContents;
+        paintFlags.add(RenderLayer::PaintLayerPaintingOverflowContents);
     if (paintingPhase & GraphicsLayerPaintCompositedScroll)
     if (paintingPhase & GraphicsLayerPaintCompositedScroll)
-        paintFlags |= RenderLayer::PaintLayerPaintingCompositingScrollingPhase;
+        paintFlags.add(RenderLayer::PaintLayerPaintingCompositingScrollingPhase);
 
     if (graphicsLayer == m_backgroundLayer.get() && m_backgroundLayerPaintsFixedRootBackground)
 
     if (graphicsLayer == m_backgroundLayer.get() && m_backgroundLayerPaintsFixedRootBackground)
-        paintFlags |= { RenderLayer::PaintLayerPaintingRootBackgroundOnly, RenderLayer::PaintLayerPaintingCompositingForegroundPhase }; // Need PaintLayerPaintingCompositingForegroundPhase to walk child layers.
+        paintFlags.add({ RenderLayer::PaintLayerPaintingRootBackgroundOnly, RenderLayer::PaintLayerPaintingCompositingForegroundPhase }); // Need PaintLayerPaintingCompositingForegroundPhase to walk child layers.
     else if (compositor().fixedRootBackgroundLayer())
     else if (compositor().fixedRootBackgroundLayer())
-        paintFlags |= RenderLayer::PaintLayerPaintingSkipRootBackground;
+        paintFlags.add(RenderLayer::PaintLayerPaintingSkipRootBackground);
 
 #ifndef NDEBUG
     RenderElement::SetLayoutNeededForbiddenScope forbidSetNeedsLayout(&renderer());
 
 #ifndef NDEBUG
     RenderElement::SetLayoutNeededForbiddenScope forbidSetNeedsLayout(&renderer());
@@ -2609,10 +2609,10 @@ void RenderLayerBacking::paintContents(const GraphicsLayer* graphicsLayer, Graph
         // We have to use the same root as for hit testing, because both methods can compute and cache clipRects.
         OptionSet<PaintBehavior> behavior = PaintBehavior::Normal;
         if (layerPaintBehavior == GraphicsLayerPaintSnapshotting)
         // We have to use the same root as for hit testing, because both methods can compute and cache clipRects.
         OptionSet<PaintBehavior> behavior = PaintBehavior::Normal;
         if (layerPaintBehavior == GraphicsLayerPaintSnapshotting)
-            behavior |= PaintBehavior::Snapshotting;
+            behavior.add(PaintBehavior::Snapshotting);
         
         if (layerPaintBehavior == GraphicsLayerPaintFirstTilePaint)
         
         if (layerPaintBehavior == GraphicsLayerPaintFirstTilePaint)
-            behavior |= PaintBehavior::TileFirstPaint;
+            behavior.add(PaintBehavior::TileFirstPaint);
 
         paintIntoLayer(graphicsLayer, context, dirtyRect, behavior, paintingPhase);
 
 
         paintIntoLayer(graphicsLayer, context, dirtyRect, behavior, paintingPhase);
 
index 5b3ab98..175d58d 100644 (file)
@@ -2164,89 +2164,89 @@ OptionSet<CompositingReason> RenderLayerCompositor::reasonsForCompositing(const
     auto& renderer = rendererForCompositingTests(layer);
 
     if (requiresCompositingForTransform(renderer))
     auto& renderer = rendererForCompositingTests(layer);
 
     if (requiresCompositingForTransform(renderer))
-        reasons |= CompositingReason::Transform3D;
+        reasons.add(CompositingReason::Transform3D);
 
     if (requiresCompositingForVideo(renderer))
 
     if (requiresCompositingForVideo(renderer))
-        reasons |= CompositingReason::Video;
+        reasons.add(CompositingReason::Video);
     else if (requiresCompositingForCanvas(renderer))
     else if (requiresCompositingForCanvas(renderer))
-        reasons |= CompositingReason::Canvas;
+        reasons.add(CompositingReason::Canvas);
     else if (requiresCompositingForPlugin(renderer))
     else if (requiresCompositingForPlugin(renderer))
-        reasons |= CompositingReason::Plugin;
+        reasons.add(CompositingReason::Plugin);
     else if (requiresCompositingForFrame(renderer))
     else if (requiresCompositingForFrame(renderer))
-        reasons |= CompositingReason::IFrame;
+        reasons.add(CompositingReason::IFrame);
 
     if ((canRender3DTransforms() && renderer.style().backfaceVisibility() == BackfaceVisibility::Hidden))
 
     if ((canRender3DTransforms() && renderer.style().backfaceVisibility() == BackfaceVisibility::Hidden))
-        reasons |= CompositingReason::BackfaceVisibilityHidden;
+        reasons.add(CompositingReason::BackfaceVisibilityHidden);
 
     if (clipsCompositingDescendants(*renderer.layer()))
 
     if (clipsCompositingDescendants(*renderer.layer()))
-        reasons |= CompositingReason::ClipsCompositingDescendants;
+        reasons.add(CompositingReason::ClipsCompositingDescendants);
 
     if (requiresCompositingForAnimation(renderer))
 
     if (requiresCompositingForAnimation(renderer))
-        reasons |= CompositingReason::Animation;
+        reasons.add(CompositingReason::Animation);
 
     if (requiresCompositingForFilters(renderer))
 
     if (requiresCompositingForFilters(renderer))
-        reasons |= CompositingReason::Filters;
+        reasons.add(CompositingReason::Filters);
 
     if (requiresCompositingForWillChange(renderer))
 
     if (requiresCompositingForWillChange(renderer))
-        reasons |= CompositingReason::WillChange;
+        reasons.add(CompositingReason::WillChange);
 
     if (requiresCompositingForPosition(renderer, *renderer.layer()))
 
     if (requiresCompositingForPosition(renderer, *renderer.layer()))
-        reasons |= renderer.isFixedPositioned() ? CompositingReason::PositionFixed : CompositingReason::PositionSticky;
+        reasons.add(renderer.isFixedPositioned() ? CompositingReason::PositionFixed : CompositingReason::PositionSticky);
 
 #if PLATFORM(IOS)
     if (requiresCompositingForScrolling(*renderer.layer()))
 
 #if PLATFORM(IOS)
     if (requiresCompositingForScrolling(*renderer.layer()))
-        reasons |= CompositingReason::OverflowScrollingTouch;
+        reasons.add(CompositingReason::OverflowScrollingTouch);
 #endif
 
     if (requiresCompositingForOverflowScrolling(*renderer.layer()))
 #endif
 
     if (requiresCompositingForOverflowScrolling(*renderer.layer()))
-        reasons |= CompositingReason::OverflowScrollingTouch;
+        reasons.add(CompositingReason::OverflowScrollingTouch);
 
     switch (renderer.layer()->indirectCompositingReason()) {
     case RenderLayer::IndirectCompositingReason::None:
         break;
     case RenderLayer::IndirectCompositingReason::Stacking:
 
     switch (renderer.layer()->indirectCompositingReason()) {
     case RenderLayer::IndirectCompositingReason::None:
         break;
     case RenderLayer::IndirectCompositingReason::Stacking:
-        reasons |= CompositingReason::Stacking;
+        reasons.add(CompositingReason::Stacking);
         break;
     case RenderLayer::IndirectCompositingReason::Overlap:
         break;
     case RenderLayer::IndirectCompositingReason::Overlap:
-        reasons |= CompositingReason::Overlap;
+        reasons.add(CompositingReason::Overlap);
         break;
     case RenderLayer::IndirectCompositingReason::BackgroundLayer:
         break;
     case RenderLayer::IndirectCompositingReason::BackgroundLayer:
-        reasons |= CompositingReason::NegativeZIndexChildren;
+        reasons.add(CompositingReason::NegativeZIndexChildren);
         break;
     case RenderLayer::IndirectCompositingReason::GraphicalEffect:
         if (renderer.hasTransform())
         break;
     case RenderLayer::IndirectCompositingReason::GraphicalEffect:
         if (renderer.hasTransform())
-            reasons |= CompositingReason::TransformWithCompositedDescendants;
+            reasons.add(CompositingReason::TransformWithCompositedDescendants);
 
         if (renderer.isTransparent())
 
         if (renderer.isTransparent())
-            reasons |= CompositingReason::OpacityWithCompositedDescendants;
+            reasons.add(CompositingReason::OpacityWithCompositedDescendants);
 
         if (renderer.hasMask())
 
         if (renderer.hasMask())
-            reasons |= CompositingReason::MaskWithCompositedDescendants;
+            reasons.add(CompositingReason::MaskWithCompositedDescendants);
 
         if (renderer.hasReflection())
 
         if (renderer.hasReflection())
-            reasons |= CompositingReason::ReflectionWithCompositedDescendants;
+            reasons.add(CompositingReason::ReflectionWithCompositedDescendants);
 
         if (renderer.hasFilter() || renderer.hasBackdropFilter())
 
         if (renderer.hasFilter() || renderer.hasBackdropFilter())
-            reasons |= CompositingReason::FilterWithCompositedDescendants;
+            reasons.add(CompositingReason::FilterWithCompositedDescendants);
 
 #if ENABLE(CSS_COMPOSITING)
         if (layer.isolatesCompositedBlending())
 
 #if ENABLE(CSS_COMPOSITING)
         if (layer.isolatesCompositedBlending())
-            reasons |= CompositingReason::IsolatesCompositedBlendingDescendants;
+            reasons.add(CompositingReason::IsolatesCompositedBlendingDescendants);
 
         if (layer.hasBlendMode())
 
         if (layer.hasBlendMode())
-            reasons |= CompositingReason::BlendingWithCompositedDescendants;
+            reasons.add(CompositingReason::BlendingWithCompositedDescendants);
 #endif
         break;
     case RenderLayer::IndirectCompositingReason::Perspective:
 #endif
         break;
     case RenderLayer::IndirectCompositingReason::Perspective:
-        reasons |= CompositingReason::Perspective;
+        reasons.add(CompositingReason::Perspective);
         break;
     case RenderLayer::IndirectCompositingReason::Preserve3D:
         break;
     case RenderLayer::IndirectCompositingReason::Preserve3D:
-        reasons |= CompositingReason::Preserve3D;
+        reasons.add(CompositingReason::Preserve3D);
         break;
     }
 
     if (inCompositingMode() && renderer.layer()->isRenderViewLayer())
         break;
     }
 
     if (inCompositingMode() && renderer.layer()->isRenderViewLayer())
-        reasons |= CompositingReason::Root;
+        reasons.add(CompositingReason::Root);
 
     return reasons;
 }
 
     return reasons;
 }
@@ -3625,10 +3625,10 @@ void RenderLayerCompositor::updateScrollCoordinatedStatus(RenderLayer& layer, Op
 {
     OptionSet<LayerScrollCoordinationRole> coordinationRoles;
     if (isViewportConstrainedFixedOrStickyLayer(layer))
 {
     OptionSet<LayerScrollCoordinationRole> coordinationRoles;
     if (isViewportConstrainedFixedOrStickyLayer(layer))
-        coordinationRoles |= ViewportConstrained;
+        coordinationRoles.add(ViewportConstrained);
 
     if (useCoordinatedScrollingForLayer(layer))
 
     if (useCoordinatedScrollingForLayer(layer))
-        coordinationRoles |= Scrolling;
+        coordinationRoles.add(Scrolling);
 
     if (layer.isComposited())
         layer.backing()->setIsScrollCoordinatedWithViewportConstrainedRole(coordinationRoles.contains(ViewportConstrained));
 
     if (layer.isComposited())
         layer.backing()->setIsScrollCoordinatedWithViewportConstrainedRole(coordinationRoles.contains(ViewportConstrained));
index 82d1c92..98e88dc 100644 (file)
@@ -383,17 +383,17 @@ static void collectStylesForRenderer(TextDecorationPainter::Styles& result, cons
         auto decorationStyle = style.textDecorationStyle();
 
         if (decorations.contains(TextDecoration::Underline)) {
         auto decorationStyle = style.textDecorationStyle();
 
         if (decorations.contains(TextDecoration::Underline)) {
-            remainingDecorations -= TextDecoration::Underline;
+            remainingDecorations.remove(TextDecoration::Underline);
             result.underlineColor = color;
             result.underlineStyle = decorationStyle;
         }
         if (decorations.contains(TextDecoration::Overline)) {
             result.underlineColor = color;
             result.underlineStyle = decorationStyle;
         }
         if (decorations.contains(TextDecoration::Overline)) {
-            remainingDecorations -= TextDecoration::Overline;
+            remainingDecorations.remove(TextDecoration::Overline);
             result.overlineColor = color;
             result.overlineStyle = decorationStyle;
         }
         if (decorations.contains(TextDecoration::LineThrough)) {
             result.overlineColor = color;
             result.overlineStyle = decorationStyle;
         }
         if (decorations.contains(TextDecoration::LineThrough)) {
-            remainingDecorations -= TextDecoration::LineThrough;
+            remainingDecorations.remove(TextDecoration::LineThrough);
             result.linethroughColor = color;
             result.linethroughStyle = decorationStyle;
         }
             result.linethroughColor = color;
             result.linethroughStyle = decorationStyle;
         }
index 3b4123a..6b0a184 100644 (file)
@@ -100,7 +100,7 @@ TextPaintStyle computeTextPaintStyle(const Frame& frame, const RenderStyle& line
         if (page && page->focusController().isActive()) {
             OptionSet<StyleColor::Options> options;
             if (page->useSystemAppearance())
         if (page && page->focusController().isActive()) {
             OptionSet<StyleColor::Options> options;
             if (page->useSystemAppearance())
-                options |= StyleColor::Options::UseSystemAppearance;
+                options.add(StyleColor::Options::UseSystemAppearance);
             paintStyle.fillColor = RenderTheme::singleton().systemColor(CSSValueActivebuttontext, options);
             return paintStyle;
         }
             paintStyle.fillColor = RenderTheme::singleton().systemColor(CSSValueActivebuttontext, options);
             return paintStyle;
         }
index c2c4e85..38097d2 100644 (file)
@@ -613,7 +613,7 @@ bool RenderStyle::changeRequiresLayout(const RenderStyle& other, OptionSet<Style
             if (m_rareNonInheritedData->transform->hasTransform() != other.m_rareNonInheritedData->transform->hasTransform())
                 return true;
             if (*m_rareNonInheritedData->transform != *other.m_rareNonInheritedData->transform) {
             if (m_rareNonInheritedData->transform->hasTransform() != other.m_rareNonInheritedData->transform->hasTransform())
                 return true;
             if (*m_rareNonInheritedData->transform != *other.m_rareNonInheritedData->transform) {
-                changedContextSensitiveProperties |= StyleDifferenceContextSensitiveProperty::Transform;
+                changedContextSensitiveProperties.add(StyleDifferenceContextSensitiveProperty::Transform);
                 // Don't return; keep looking for another change
             }
         }
                 // Don't return; keep looking for another change
             }
         }
@@ -629,7 +629,7 @@ bool RenderStyle::changeRequiresLayout(const RenderStyle& other, OptionSet<Style
 #endif
 
         if (!arePointingToEqualData(m_rareNonInheritedData->willChange, other.m_rareNonInheritedData->willChange)) {
 #endif
 
         if (!arePointingToEqualData(m_rareNonInheritedData->willChange, other.m_rareNonInheritedData->willChange)) {
-            changedContextSensitiveProperties |= StyleDifferenceContextSensitiveProperty::WillChange;
+            changedContextSensitiveProperties.add(StyleDifferenceContextSensitiveProperty::WillChange);
             // Don't return; keep looking for another change
         }
     }
             // Don't return; keep looking for another change
         }
     }
@@ -849,7 +849,7 @@ bool RenderStyle::changeRequiresLayerRepaint(const RenderStyle& other, OptionSet
 
     if (position() != PositionType::Static) {
         if (m_visualData->clip != other.m_visualData->clip || m_visualData->hasClip != other.m_visualData->hasClip) {
 
     if (position() != PositionType::Static) {
         if (m_visualData->clip != other.m_visualData->clip || m_visualData->hasClip != other.m_visualData->hasClip) {
-            changedContextSensitiveProperties |= StyleDifferenceContextSensitiveProperty::ClipRect;
+            changedContextSensitiveProperties.add(StyleDifferenceContextSensitiveProperty::ClipRect);
             return true;
         }
     }
             return true;
         }
     }
@@ -860,18 +860,18 @@ bool RenderStyle::changeRequiresLayerRepaint(const RenderStyle& other, OptionSet
 #endif
 
     if (m_rareNonInheritedData->opacity != other.m_rareNonInheritedData->opacity) {
 #endif
 
     if (m_rareNonInheritedData->opacity != other.m_rareNonInheritedData->opacity) {
-        changedContextSensitiveProperties |= StyleDifferenceContextSensitiveProperty::Opacity;
+        changedContextSensitiveProperties.add(StyleDifferenceContextSensitiveProperty::Opacity);
         // Don't return; keep looking for another change.
     }
 
     if (m_rareNonInheritedData->filter != other.m_rareNonInheritedData->filter) {
         // Don't return; keep looking for another change.
     }
 
     if (m_rareNonInheritedData->filter != other.m_rareNonInheritedData->filter) {
-        changedContextSensitiveProperties |= StyleDifferenceContextSensitiveProperty::Filter;
+        changedContextSensitiveProperties.add(StyleDifferenceContextSensitiveProperty::Filter);
         // Don't return; keep looking for another change.
     }
 
 #if ENABLE(FILTERS_LEVEL_2)
     if (m_rareNonInheritedData->backdropFilter != other.m_rareNonInheritedData->backdropFilter) {
         // Don't return; keep looking for another change.
     }
 
 #if ENABLE(FILTERS_LEVEL_2)
     if (m_rareNonInheritedData->backdropFilter != other.m_rareNonInheritedData->backdropFilter) {
-        changedContextSensitiveProperties |= StyleDifferenceContextSensitiveProperty::Filter;
+        changedContextSensitiveProperties.add(StyleDifferenceContextSensitiveProperty::Filter);
         // Don't return; keep looking for another change.
     }
 #endif
         // Don't return; keep looking for another change.
     }
 #endif
@@ -921,7 +921,7 @@ bool RenderStyle::changeRequiresRepaint(const RenderStyle& other, OptionSet<Styl
 
     // FIXME: this should probably be moved to changeRequiresLayerRepaint().
     if (m_rareNonInheritedData->clipPath != other.m_rareNonInheritedData->clipPath) {
 
     // FIXME: this should probably be moved to changeRequiresLayerRepaint().
     if (m_rareNonInheritedData->clipPath != other.m_rareNonInheritedData->clipPath) {
-        changedContextSensitiveProperties |= StyleDifferenceContextSensitiveProperty::ClipPath;
+        changedContextSensitiveProperties.add(StyleDifferenceContextSensitiveProperty::ClipPath);
         // Don't return; keep looking for another change.
     }
 
         // Don't return; keep looking for another change.
     }
 
index c600b35..49fc7c0 100644 (file)
@@ -2242,7 +2242,7 @@ static ExceptionOr<FindOptions> parseFindOptions(const Vector<String>& optionLis
         bool found = false;
         for (auto& flag : flagList) {
             if (flag.name == option) {
         bool found = false;
         for (auto& flag : flagList) {
             if (flag.name == option) {
-                result |= flag.value;
+                result.add(flag.value);
                 found = true;
                 break;
             }
                 found = true;
                 break;
             }
@@ -3189,7 +3189,7 @@ void Internals::forceReload(bool endToEnd)
 {
     OptionSet<ReloadOption> reloadOptions;
     if (endToEnd)
 {
     OptionSet<ReloadOption> reloadOptions;
     if (endToEnd)
-        reloadOptions |= ReloadOption::FromOrigin;
+        reloadOptions.add(ReloadOption::FromOrigin);
 
     frame()->loader().reload(reloadOptions);
 }
 
     frame()->loader().reload(reloadOptions);
 }
@@ -4342,9 +4342,9 @@ void Internals::setPageVisibility(bool isVisible)
     auto state = page.activityState();
 
     if (!isVisible)
     auto state = page.activityState();
 
     if (!isVisible)
-        state -= ActivityState::IsVisible;
+        state.remove(ActivityState::IsVisible);
     else
     else
-        state |= ActivityState::IsVisible;
+        state.add(ActivityState::IsVisible);
 
     page.setActivityState(state);
 }
 
     page.setActivityState(state);
 }
@@ -4358,9 +4358,9 @@ void Internals::setPageIsFocusedAndActive(bool isFocusedAndActive)
     auto state = page.activityState();
 
     if (!isFocusedAndActive)
     auto state = page.activityState();
 
     if (!isFocusedAndActive)
-        state -= { ActivityState::IsFocused, ActivityState::WindowIsActive };
+        state.remove({ ActivityState::IsFocused, ActivityState::WindowIsActive });
     else
     else
-        state |= { ActivityState::IsFocused, ActivityState::WindowIsActive };
+        state.add({ ActivityState::IsFocused, ActivityState::WindowIsActive });
 
     page.setActivityState(state);
 }
 
     page.setActivityState(state);
 }
index 7583535..7a63732 100644 (file)
@@ -1514,8 +1514,7 @@ void Session::elementClick(const String& elementID, Function<void (CommandResult
         return;
     }
 
         return;
     }
 
-    OptionSet<ElementLayoutOption> options = ElementLayoutOption::ScrollIntoViewIfNeeded;
-    options |= ElementLayoutOption::UseViewportCoordinates;
+    OptionSet<ElementLayoutOption> options = { ElementLayoutOption::ScrollIntoViewIfNeeded, ElementLayoutOption::UseViewportCoordinates };
     computeElementLayout(elementID, options, [this, protectedThis = makeRef(*this), elementID, completionHandler = WTFMove(completionHandler)](std::optional<Rect>&& rect, std::optional<Point>&& inViewCenter, bool isObscured, RefPtr<JSON::Object>&& error) mutable {
         if (!rect || error) {
             completionHandler(CommandResult::fail(WTFMove(error)));
     computeElementLayout(elementID, options, [this, protectedThis = makeRef(*this), elementID, completionHandler = WTFMove(completionHandler)](std::optional<Rect>&& rect, std::optional<Point>&& inViewCenter, bool isObscured, RefPtr<JSON::Object>&& error) mutable {
         if (!rect || error) {
             completionHandler(CommandResult::fail(WTFMove(error)));
index 6b7f2a2..1185678 100644 (file)
@@ -1,3 +1,58 @@
+2018-08-31  Antti Koivisto  <antti@apple.com>
+
+        Replace OptionSet |= and -= operators with add() and remove() functions
+        https://bugs.webkit.org/show_bug.cgi?id=189169
+
+        Reviewed by Anders Carlsson.
+
+        * 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):
+
 2018-08-31  Chris Dumez  <cdumez@apple.com>
 
         Rename ShouldProcessSwapIfPossible to ProcessSwapRequestedByClient for clarity
 2018-08-31  Chris Dumez  <cdumez@apple.com>
 
         Rename ShouldProcessSwapIfPossible to ProcessSwapRequestedByClient for clarity
index 0023fe1..fd7664c 100644 (file)
@@ -114,12 +114,12 @@ void NetworkProcess::platformInitializeNetworkProcessCocoa(const NetworkProcessC
     SandboxExtension::consumePermanently(parameters.diskCacheDirectoryExtensionHandle);
     OptionSet<NetworkCache::Cache::Option> cacheOptions { NetworkCache::Cache::Option::RegisterNotify };
     if (parameters.shouldEnableNetworkCacheEfficacyLogging)
     SandboxExtension::consumePermanently(parameters.diskCacheDirectoryExtensionHandle);
     OptionSet<NetworkCache::Cache::Option> cacheOptions { NetworkCache::Cache::Option::RegisterNotify };
     if (parameters.shouldEnableNetworkCacheEfficacyLogging)
-        cacheOptions |= NetworkCache::Cache::Option::EfficacyLogging;
+        cacheOptions.add(NetworkCache::Cache::Option::EfficacyLogging);
     if (parameters.shouldUseTestingNetworkSession)
     if (parameters.shouldUseTestingNetworkSession)
-        cacheOptions |= NetworkCache::Cache::Option::TestingMode;
+        cacheOptions.add(NetworkCache::Cache::Option::TestingMode);
 #if ENABLE(NETWORK_CACHE_SPECULATIVE_REVALIDATION)
     if (parameters.shouldEnableNetworkCacheSpeculativeRevalidation)
 #if ENABLE(NETWORK_CACHE_SPECULATIVE_REVALIDATION)
     if (parameters.shouldEnableNetworkCacheSpeculativeRevalidation)
-        cacheOptions |= NetworkCache::Cache::Option::SpeculativeRevalidation;
+        cacheOptions.add(NetworkCache::Cache::Option::SpeculativeRevalidation);
 #endif
 
     m_cache = NetworkCache::Cache::open(m_diskCacheDirectory, cacheOptions);
 #endif
 
     m_cache = NetworkCache::Cache::open(m_diskCacheDirectory, cacheOptions);
index a4e9856..59bfe28 100644 (file)
@@ -113,10 +113,10 @@ void NetworkProcess::platformInitializeNetworkProcess(const NetworkProcessCreati
 
     OptionSet<NetworkCache::Cache::Option> cacheOptions { NetworkCache::Cache::Option::RegisterNotify };
     if (parameters.shouldEnableNetworkCacheEfficacyLogging)
 
     OptionSet<NetworkCache::Cache::Option> cacheOptions { NetworkCache::Cache::Option::RegisterNotify };
     if (parameters.shouldEnableNetworkCacheEfficacyLogging)
-        cacheOptions |= NetworkCache::Cache::Option::EfficacyLogging;
+        cacheOptions.add(NetworkCache::Cache::Option::EfficacyLogging);
 #if ENABLE(NETWORK_CACHE_SPECULATIVE_REVALIDATION)
     if (parameters.shouldEnableNetworkCacheSpeculativeRevalidation)
 #if ENABLE(NETWORK_CACHE_SPECULATIVE_REVALIDATION)
     if (parameters.shouldEnableNetworkCacheSpeculativeRevalidation)
-        cacheOptions |= NetworkCache::Cache::Option::SpeculativeRevalidation;
+        cacheOptions.add(NetworkCache::Cache::Option::SpeculativeRevalidation);
 #endif
 
     m_cache = NetworkCache::Cache::open(m_diskCacheDirectory, cacheOptions);
 #endif
 
     m_cache = NetworkCache::Cache::open(m_diskCacheDirectory, cacheOptions);
index aa28ce6..0fd4ee0 100644 (file)
@@ -116,7 +116,7 @@ public:
 
         void notePropertiesChanged(OptionSet<LayerChange> changeFlags)
         {
 
         void notePropertiesChanged(OptionSet<LayerChange> changeFlags)
         {
-            changedProperties |= changeFlags;
+            changedProperties.add(changeFlags);
         }
 
         void resetChangedProperties()
         }
 
         void resetChangedProperties()
index 47c0a87..0e23b19 100644 (file)
@@ -69,15 +69,15 @@ public:
         }
 
         if (webEvent.shiftKey())
         }
 
         if (webEvent.shiftKey())
-            m_modifiers |= Modifier::ShiftKey;
+            m_modifiers.add(Modifier::ShiftKey);
         if (webEvent.controlKey())
         if (webEvent.controlKey())
-            m_modifiers |= Modifier::CtrlKey;
+            m_modifiers.add(Modifier::CtrlKey);
         if (webEvent.altKey())
         if (webEvent.altKey())
-            m_modifiers |= Modifier::AltKey;
+            m_modifiers.add(Modifier::AltKey);
         if (webEvent.metaKey())
         if (webEvent.metaKey())
-            m_modifiers |= Modifier::MetaKey;
+            m_modifiers.add(Modifier::MetaKey);
         if (webEvent.capsLockKey())
         if (webEvent.capsLockKey())
-            m_modifiers |= Modifier::CapsLockKey;
+            m_modifiers.add(Modifier::CapsLockKey);
 
         m_timestamp = webEvent.timestamp();
 
 
         m_timestamp = webEvent.timestamp();
 
@@ -136,15 +136,15 @@ public:
         m_type = PlatformEvent::Wheel;
 
         if (webEvent.shiftKey())
         m_type = PlatformEvent::Wheel;
 
         if (webEvent.shiftKey())
-            m_modifiers |= Modifier::ShiftKey;
+            m_modifiers.add(Modifier::ShiftKey);
         if (webEvent.controlKey())
         if (webEvent.controlKey())
-            m_modifiers |= Modifier::CtrlKey;
+            m_modifiers.add(Modifier::CtrlKey);
         if (webEvent.altKey())
         if (webEvent.altKey())
-            m_modifiers |= Modifier::AltKey;
+            m_modifiers.add(Modifier::AltKey);
         if (webEvent.metaKey())
         if (webEvent.metaKey())
-            m_modifiers |= Modifier::MetaKey;
+            m_modifiers.add(Modifier::MetaKey);
         if (webEvent.capsLockKey())
         if (webEvent.capsLockKey())
-            m_modifiers |= Modifier::CapsLockKey;
+            m_modifiers.add(Modifier::CapsLockKey);
 
         m_timestamp = webEvent.timestamp();
 
 
         m_timestamp = webEvent.timestamp();
 
@@ -198,15 +198,15 @@ public:
         }
 
         if (webEvent.shiftKey())
         }
 
         if (webEvent.shiftKey())
-            m_modifiers |= Modifier::ShiftKey;
+            m_modifiers.add(Modifier::ShiftKey);
         if (webEvent.controlKey())
         if (webEvent.controlKey())
-            m_modifiers |= Modifier::CtrlKey;
+            m_modifiers.add(Modifier::CtrlKey);
         if (webEvent.altKey())
         if (webEvent.altKey())
-            m_modifiers |= Modifier::AltKey;
+            m_modifiers.add(Modifier::AltKey);
         if (webEvent.metaKey())
         if (webEvent.metaKey())
-            m_modifiers |= Modifier::MetaKey;
+            m_modifiers.add(Modifier::MetaKey);
         if (webEvent.capsLockKey())
         if (webEvent.capsLockKey())
-            m_modifiers |= Modifier::CapsLockKey;
+            m_modifiers.add(Modifier::CapsLockKey);
 
         m_timestamp = webEvent.timestamp();
 
 
         m_timestamp = webEvent.timestamp();
 
@@ -339,15 +339,15 @@ public:
         }
 
         if (webEvent.shiftKey())
         }
 
         if (webEvent.shiftKey())
-            m_modifiers |= Modifier::ShiftKey;
+            m_modifiers.add(Modifier::ShiftKey);
         if (webEvent.controlKey())
         if (webEvent.controlKey())
-            m_modifiers |= Modifier::CtrlKey;
+            m_modifiers.add(Modifier::CtrlKey);
         if (webEvent.altKey())
         if (webEvent.altKey())
-            m_modifiers |= Modifier::AltKey;
+            m_modifiers.add(Modifier::AltKey);
         if (webEvent.metaKey())
         if (webEvent.metaKey())
-            m_modifiers |= Modifier::MetaKey;
+            m_modifiers.add(Modifier::MetaKey);
         if (webEvent.capsLockKey())
         if (webEvent.capsLockKey())
-            m_modifiers |= Modifier::CapsLockKey;
+            m_modifiers.add(Modifier::CapsLockKey);
 
         m_timestamp = webEvent.timestamp();
 
 
         m_timestamp = webEvent.timestamp();
 
@@ -398,15 +398,15 @@ public:
         }
 
         if (webEvent.shiftKey())
         }
 
         if (webEvent.shiftKey())
-            m_modifiers |= Modifier::ShiftKey;
+            m_modifiers.add(Modifier::ShiftKey);
         if (webEvent.controlKey())
         if (webEvent.controlKey())
-            m_modifiers |= Modifier::CtrlKey;
+            m_modifiers.add(Modifier::CtrlKey);
         if (webEvent.altKey())
         if (webEvent.altKey())
-            m_modifiers |= Modifier::AltKey;
+            m_modifiers.add(Modifier::AltKey);
         if (webEvent.metaKey())
         if (webEvent.metaKey())
-            m_modifiers |= Modifier::MetaKey;
+            m_modifiers.add(Modifier::MetaKey);
         if (webEvent.capsLockKey())
         if (webEvent.capsLockKey())
-            m_modifiers |= Modifier::CapsLockKey;
+            m_modifiers.add(Modifier::CapsLockKey);
 
         m_timestamp = webEvent.timestamp();
 
 
         m_timestamp = webEvent.timestamp();
 
index 6eb4be2..6073b2f 100644 (file)
@@ -98,13 +98,13 @@ void WebsitePoliciesData::applyToDocumentLoader(WebsitePoliciesData&& websitePol
     const auto& allowedQuirks = websitePolicies.allowedAutoplayQuirks;
     
     if (allowedQuirks.contains(WebsiteAutoplayQuirk::InheritedUserGestures))
     const auto& allowedQuirks = websitePolicies.allowedAutoplayQuirks;
     
     if (allowedQuirks.contains(WebsiteAutoplayQuirk::InheritedUserGestures))
-        quirks |= WebCore::AutoplayQuirk::InheritedUserGestures;
+        quirks.add(WebCore::AutoplayQuirk::InheritedUserGestures);
     
     if (allowedQuirks.contains(WebsiteAutoplayQuirk::SynthesizedPauseEvents))
     
     if (allowedQuirks.contains(WebsiteAutoplayQuirk::SynthesizedPauseEvents))
-        quirks |= WebCore::AutoplayQuirk::SynthesizedPauseEvents;
+        quirks.add(WebCore::AutoplayQuirk::SynthesizedPauseEvents);
     
     if (allowedQuirks.contains(WebsiteAutoplayQuirk::ArbitraryUserGestures))
     
     if (allowedQuirks.contains(WebsiteAutoplayQuirk::ArbitraryUserGestures))
-        quirks |= WebCore::AutoplayQuirk::ArbitraryUserGestures;
+        quirks.add(WebCore::AutoplayQuirk::ArbitraryUserGestures);
 
     documentLoader.setAllowedAutoplayQuirks(quirks);
 
 
     documentLoader.setAllowedAutoplayQuirks(quirks);
 
index 0399741..515cacb 100644 (file)
@@ -270,7 +270,7 @@ void WKPageReload(WKPageRef pageRef)
     OptionSet<WebCore::ReloadOption> reloadOptions;
 #if PLATFORM(COCOA)
     if (linkedOnOrAfter(WebKit::SDKVersion::FirstWithExpiredOnlyReloadBehavior))
     OptionSet<WebCore::ReloadOption> reloadOptions;
 #if PLATFORM(COCOA)
     if (linkedOnOrAfter(WebKit::SDKVersion::FirstWithExpiredOnlyReloadBehavior))
-        reloadOptions |= WebCore::ReloadOption::ExpiredOnly;
+        reloadOptions.add(WebCore::ReloadOption::ExpiredOnly);
 #endif
 
     toImpl(pageRef)->reload(reloadOptions);
 #endif
 
     toImpl(pageRef)->reload(reloadOptions);
index 6b16c2a..442fc8f 100644 (file)
@@ -40,12 +40,10 @@ WKTypeID WKResourceCacheManagerGetTypeID()
 
 static OptionSet<WebsiteDataType> toWebsiteDataTypes(WKResourceCachesToClear cachesToClear)
 {
 
 static OptionSet<WebsiteDataType> toWebsiteDataTypes(WKResourceCachesToClear cachesToClear)
 {
-    OptionSet<WebsiteDataType> websiteDataTypes;
-
-    websiteDataTypes |= WebsiteDataType::MemoryCache;
+    OptionSet<WebsiteDataType> websiteDataTypes { WebsiteDataType::MemoryCache };
 
     if (cachesToClear == WKResourceCachesToClearAll)
 
     if (cachesToClear == WKResourceCachesToClearAll)
-        websiteDataTypes |= WebsiteDataType::DiskCache;
+        websiteDataTypes.add(WebsiteDataType::DiskCache);
 
     return websiteDataTypes;
 }
 
     return websiteDataTypes;
 }
index 6b36923..668edb2 100644 (file)
@@ -83,13 +83,13 @@ void WKWebsitePoliciesSetAllowedAutoplayQuirks(WKWebsitePoliciesRef websitePolic
 {
     OptionSet<WebsiteAutoplayQuirk> quirks;
     if (allowedQuirks & kWKWebsiteAutoplayQuirkInheritedUserGestures)
 {
     OptionSet<WebsiteAutoplayQuirk> quirks;
     if (allowedQuirks & kWKWebsiteAutoplayQuirkInheritedUserGestures)
-        quirks |= WebsiteAutoplayQuirk::InheritedUserGestures;
+        quirks.add(WebsiteAutoplayQuirk::InheritedUserGestures);
 
     if (allowedQuirks & kWKWebsiteAutoplayQuirkSynthesizedPauseEvents)
 
     if (allowedQuirks & kWKWebsiteAutoplayQuirkSynthesizedPauseEvents)
-        quirks |= WebsiteAutoplayQuirk::SynthesizedPauseEvents;
+        quirks.add(WebsiteAutoplayQuirk::SynthesizedPauseEvents);
 
     if (allowedQuirks & kWKWebsiteAutoplayQuirkArbitraryUserGestures)
 
     if (allowedQuirks & kWKWebsiteAutoplayQuirkArbitraryUserGestures)
-        quirks |= WebsiteAutoplayQuirk::ArbitraryUserGestures;
+        quirks.add(WebsiteAutoplayQuirk::ArbitraryUserGestures);
 
     toImpl(websitePolicies)->setAllowedAutoplayQuirks(quirks);
 }
 
     toImpl(websitePolicies)->setAllowedAutoplayQuirks(quirks);
 }
index 865d0ff..4bfe6cc 100644 (file)
@@ -53,9 +53,9 @@ inline OptionSet<WebCore::ActivityState::Flag> toViewStateFlags(WKViewState wkVi
     OptionSet<WebCore::ActivityState::Flag> viewStateFlags;
 
     if (wkViewState & kWKViewStateIsInWindow)
     OptionSet<WebCore::ActivityState::Flag> viewStateFlags;
 
     if (wkViewState & kWKViewStateIsInWindow)
-        viewStateFlags |= WebCore::ActivityState::IsInWindow;
+        viewStateFlags.add(WebCore::ActivityState::IsInWindow);
     if (wkViewState & kWKViewStateIsVisible)
     if (wkViewState & kWKViewStateIsVisible)
-        viewStateFlags |= WebCore::ActivityState::IsVisible;
+        viewStateFlags.add(WebCore::ActivityState::IsVisible);
 
     return viewStateFlags;
 }
 
     return viewStateFlags;
 }
index dbc5243..6fff3a0 100644 (file)
@@ -961,7 +961,7 @@ static void validate(WKWebViewConfiguration *configuration)
 {
     OptionSet<WebCore::ReloadOption> reloadOptions;
     if (linkedOnOrAfter(WebKit::SDKVersion::FirstWithExpiredOnlyReloadBehavior))
 {
     OptionSet<WebCore::ReloadOption> reloadOptions;
     if (linkedOnOrAfter(WebKit::SDKVersion::FirstWithExpiredOnlyReloadBehavior))
-        reloadOptions |= WebCore::ReloadOption::ExpiredOnly;
+        reloadOptions.add(WebCore::ReloadOption::ExpiredOnly);
 
     return wrapper(_page->reload(reloadOptions));
 }
 
     return wrapper(_page->reload(reloadOptions));
 }
index 64eaaf1..c6b3eb5 100644 (file)
@@ -85,7 +85,7 @@ static inline OptionSet<WebKit::WebsiteDataType> toWebsiteDataTypes(NSSet *websi
 
     for (NSString *websiteDataType in websiteDataTypes) {
         if (auto dataType = toWebsiteDataType(websiteDataType))
 
     for (NSString *websiteDataType in websiteDataTypes) {
         if (auto dataType = toWebsiteDataType(websiteDataType))
-            result |= *dataType;
+            result.add(*dataType);
     }
 
     return result;
     }
 
     return result;
index ec809d8..fd85ef6 100644 (file)
@@ -223,7 +223,7 @@ static Vector<WebKit::WebsiteDataRecord> toWebsiteDataRecords(NSArray *dataRecor
 
     OptionSet<WebKit::WebsiteDataFetchOption> fetchOptions;
     if (options & _WKWebsiteDataStoreFetchOptionComputeSizes)
 
     OptionSet<WebKit::WebsiteDataFetchOption> fetchOptions;
     if (options & _WKWebsiteDataStoreFetchOptionComputeSizes)
-        fetchOptions |= WebKit::WebsiteDataFetchOption::ComputeSizes;
+        fetchOptions.add(WebKit::WebsiteDataFetchOption::ComputeSizes);
 
     _websiteDataStore->websiteDataStore().fetchData(WebKit::toWebsiteDataTypes(dataTypes), fetchOptions, [completionHandlerCopy = WTFMove(completionHandlerCopy)](auto websiteDataRecords) {
         Vector<RefPtr<API::Object>> elements;
 
     _websiteDataStore->websiteDataStore().fetchData(WebKit::toWebsiteDataTypes(dataTypes), fetchOptions, [completionHandlerCopy = WTFMove(completionHandlerCopy)](auto websiteDataRecords) {
         Vector<RefPtr<API::Object>> elements;
index 613554b..375f08d 100644 (file)
     OptionSet<WebKit::WebsiteAutoplayQuirk> quirks;
 
     if (allowedQuirks & _WKWebsiteAutoplayQuirkInheritedUserGestures)
     OptionSet<WebKit::WebsiteAutoplayQuirk> quirks;
 
     if (allowedQuirks & _WKWebsiteAutoplayQuirkInheritedUserGestures)
-        quirks |= WebKit::WebsiteAutoplayQuirk::InheritedUserGestures;
+        quirks.add(WebKit::WebsiteAutoplayQuirk::InheritedUserGestures);
 
     if (allowedQuirks & _WKWebsiteAutoplayQuirkSynthesizedPauseEvents)
 
     if (allowedQuirks & _WKWebsiteAutoplayQuirkSynthesizedPauseEvents)
-        quirks |= WebKit::WebsiteAutoplayQuirk::SynthesizedPauseEvents;
+        quirks.add(WebKit::WebsiteAutoplayQuirk::SynthesizedPauseEvents);
 
     if (allowedQuirks & _WKWebsiteAutoplayQuirkArbitraryUserGestures)
 
     if (allowedQuirks & _WKWebsiteAutoplayQuirkArbitraryUserGestures)
-        quirks |= WebKit::WebsiteAutoplayQuirk::ArbitraryUserGestures;
+        quirks.add(WebKit::WebsiteAutoplayQuirk::ArbitraryUserGestures);
 
     _websitePolicies->setAllowedAutoplayQuirks(quirks);
 }
 
     _websitePolicies->setAllowedAutoplayQuirks(quirks);
 }
index 7b7f037..3f52625 100644 (file)
@@ -775,8 +775,8 @@ void webkit_web_context_clear_cache(WebKitWebContext* context)
     g_return_if_fail(WEBKIT_IS_WEB_CONTEXT(context));
 
     OptionSet<WebsiteDataType> websiteDataTypes;
     g_return_if_fail(WEBKIT_IS_WEB_CONTEXT(context));
 
     OptionSet<WebsiteDataType> websiteDataTypes;
-    websiteDataTypes |= WebsiteDataType::MemoryCache;
-    websiteDataTypes |= WebsiteDataType::DiskCache;
+    websiteDataTypes.add(WebsiteDataType::MemoryCache);
+    websiteDataTypes.add(WebsiteDataType::DiskCache);
     auto& websiteDataStore = webkitWebsiteDataManagerGetDataStore(context->priv->websiteDataManager.get()).websiteDataStore();
     websiteDataStore.removeData(websiteDataTypes, -WallTime::infinity(), [] { });
 }
     auto& websiteDataStore = webkitWebsiteDataManagerGetDataStore(context->priv->websiteDataManager.get()).websiteDataStore();
     websiteDataStore.removeData(websiteDataTypes, -WallTime::infinity(), [] { });
 }
index 3020ecb..86bf47f 100644 (file)
@@ -630,25 +630,25 @@ static OptionSet<WebsiteDataType> toWebsiteDataTypes(WebKitWebsiteDataTypes type
 {
     OptionSet<WebsiteDataType> returnValue;
     if (types & WEBKIT_WEBSITE_DATA_MEMORY_CACHE)
 {
     OptionSet<WebsiteDataType> returnValue;
     if (types & WEBKIT_WEBSITE_DATA_MEMORY_CACHE)
-        returnValue |= WebsiteDataType::MemoryCache;
+        returnValue.add(WebsiteDataType::MemoryCache);
     if (types & WEBKIT_WEBSITE_DATA_DISK_CACHE)
     if (types & WEBKIT_WEBSITE_DATA_DISK_CACHE)
-        returnValue |= WebsiteDataType::DiskCache;
+        returnValue.add(WebsiteDataType::DiskCache);
     if (types & WEBKIT_WEBSITE_DATA_OFFLINE_APPLICATION_CACHE)
     if (types & WEBKIT_WEBSITE_DATA_OFFLINE_APPLICATION_CACHE)
-        returnValue |= WebsiteDataType::OfflineWebApplicationCache;
+        returnValue.add(WebsiteDataType::OfflineWebApplicationCache);
     if (types & WEBKIT_WEBSITE_DATA_SESSION_STORAGE)
     if (types & WEBKIT_WEBSITE_DATA_SESSION_STORAGE)
-        returnValue |= WebsiteDataType::SessionStorage;
+        returnValue.add(WebsiteDataType::SessionStorage);
     if (types & WEBKIT_WEBSITE_DATA_LOCAL_STORAGE)
     if (types & WEBKIT_WEBSITE_DATA_LOCAL_STORAGE)
-        returnValue |= WebsiteDataType::LocalStorage;
+        returnValue.add(WebsiteDataType::LocalStorage);
     if (types & WEBKIT_WEBSITE_DATA_WEBSQL_DATABASES)
     if (types & WEBKIT_WEBSITE_DATA_WEBSQL_DATABASES)
-        returnValue |= WebsiteDataType::WebSQLDatabases;
+        returnValue.add(WebsiteDataType::WebSQLDatabases);
     if (types & WEBKIT_WEBSITE_DATA_INDEXEDDB_DATABASES)
     if (types & WEBKIT_WEBSITE_DATA_INDEXEDDB_DATABASES)
-        returnValue |= WebsiteDataType::IndexedDBDatabases;
+        returnValue.add(WebsiteDataType::IndexedDBDatabases);
 #if ENABLE(NETSCAPE_PLUGIN_API)
     if (types & WEBKIT_WEBSITE_DATA_PLUGIN_DATA)
 #if ENABLE(NETSCAPE_PLUGIN_API)
     if (types & WEBKIT_WEBSITE_DATA_PLUGIN_DATA)
-        returnValue |= WebsiteDataType::PlugInData;
+        returnValue.add(WebsiteDataType::PlugInData);
 #endif
     if (types & WEBKIT_WEBSITE_DATA_COOKIES)
 #endif
     if (types & WEBKIT_WEBSITE_DATA_COOKIES)
-        returnValue |= WebsiteDataType::Cookies;
+        returnValue.add(WebsiteDataType::Cookies);
     return returnValue;
 }
 
     return returnValue;
 }
 
index d122584..98824fe 100644 (file)
@@ -210,7 +210,7 @@ WEBKIT_DEFINE_TYPE(WebKitWebViewBase, webkit_web_view_base, GTK_TYPE_CONTAINER)
 static void webkitWebViewBaseScheduleUpdateActivityState(WebKitWebViewBase* webViewBase, OptionSet<ActivityState::Flag> flagsToUpdate)
 {
     WebKitWebViewBasePrivate* priv = webViewBase->priv;
 static void webkitWebViewBaseScheduleUpdateActivityState(WebKitWebViewBase* webViewBase, OptionSet<ActivityState::Flag> flagsToUpdate)
 {
     WebKitWebViewBasePrivate* priv = webViewBase->priv;
-    priv->activityStateFlagsToUpdate |= flagsToUpdate;
+    priv->activityStateFlagsToUpdate.add(flagsToUpdate);
     if (priv->updateActivityStateTimer.isActive())
         return;
 
     if (priv->updateActivityStateTimer.isActive())
         return;
 
@@ -227,7 +227,7 @@ static gboolean toplevelWindowFocusInEvent(GtkWidget* widget, GdkEventFocus*, We
     if (priv->activityState & ActivityState::WindowIsActive)
         return FALSE;
 
     if (priv->activityState & ActivityState::WindowIsActive)
         return FALSE;
 
-    priv->activityState |= ActivityState::WindowIsActive;
+    priv->activityState.add(ActivityState::WindowIsActive);
     webkitWebViewBaseScheduleUpdateActivityState(webViewBase, ActivityState::WindowIsActive);
 
     return FALSE;
     webkitWebViewBaseScheduleUpdateActivityState(webViewBase, ActivityState::WindowIsActive);
 
     return FALSE;
@@ -239,7 +239,7 @@ static gboolean toplevelWindowFocusOutEvent(GtkWidget*, GdkEventFocus*, WebKitWe
     if (!(priv->activityState & ActivityState::WindowIsActive))
         return FALSE;
 
     if (!(priv->activityState & ActivityState::WindowIsActive))
         return FALSE;
 
-    priv->activityState -= ActivityState::WindowIsActive;
+    priv->activityState.remove(ActivityState::WindowIsActive);
     webkitWebViewBaseScheduleUpdateActivityState(webViewBase, ActivityState::WindowIsActive);
 
     return FALSE;
     webkitWebViewBaseScheduleUpdateActivityState(webViewBase, ActivityState::WindowIsActive);
 
     return FALSE;
@@ -256,9 +256,9 @@ static gboolean toplevelWindowStateEvent(GtkWidget*, GdkEventWindowState* event,
         return FALSE;
 
     if (visible)
         return FALSE;
 
     if (visible)
-        priv->activityState |= ActivityState::IsVisible;
+        priv->activityState.add(ActivityState::IsVisible);
     else
     else
-        priv->activityState -= ActivityState::IsVisible;
+        priv->activityState.remove(ActivityState::IsVisible);
     webkitWebViewBaseScheduleUpdateActivityState(webViewBase, ActivityState::IsVisible);
 
     return FALSE;
     webkitWebViewBaseScheduleUpdateActivityState(webViewBase, ActivityState::IsVisible);
 
     return FALSE;
@@ -303,12 +303,12 @@ static void webkitWebViewBaseSetToplevelOnScreenWindow(WebKitWebViewBase* webVie
     if (!priv->toplevelOnScreenWindow) {
         OptionSet<ActivityState::Flag> flagsToUpdate;
         if (priv->activityState & ActivityState::IsInWindow) {
     if (!priv->toplevelOnScreenWindow) {
         OptionSet<ActivityState::Flag> flagsToUpdate;
         if (priv->activityState & ActivityState::IsInWindow) {
-            priv->activityState -= ActivityState::IsInWindow;
-            flagsToUpdate |= ActivityState::IsInWindow;
+            priv->activityState.remove(ActivityState::IsInWindow);
+            flagsToUpdate.add(ActivityState::IsInWindow);
         }
         if (priv->activityState & ActivityState::WindowIsActive) {
         }
         if (priv->activityState & ActivityState::WindowIsActive) {
-            priv->activityState -= ActivityState::WindowIsActive;
-            flagsToUpdate |= ActivityState::IsInWindow;
+            priv->activityState.remove(ActivityState::WindowIsActive);
+            flagsToUpdate.add(ActivityState::IsInWindow);
         }
         if (flagsToUpdate)
             webkitWebViewBaseScheduleUpdateActivityState(webViewBase, flagsToUpdate);
         }
         if (flagsToUpdate)
             webkitWebViewBaseScheduleUpdateActivityState(webViewBase, flagsToUpdate);
@@ -626,17 +626,17 @@ static void webkitWebViewBaseMap(GtkWidget* widget)
     WebKitWebViewBasePrivate* priv = webViewBase->priv;
     OptionSet<ActivityState::Flag> flagsToUpdate;
     if (!(priv->activityState & ActivityState::IsVisible))
     WebKitWebViewBasePrivate* priv = webViewBase->priv;
     OptionSet<ActivityState::Flag> flagsToUpdate;
     if (!(priv->activityState & ActivityState::IsVisible))
-        flagsToUpdate |= ActivityState::IsVisible;
+        flagsToUpdate.add(ActivityState::IsVisible);
     if (priv->toplevelOnScreenWindow) {
         if (!(priv->activityState & ActivityState::IsInWindow))
     if (priv->toplevelOnScreenWindow) {
         if (!(priv->activityState & ActivityState::IsInWindow))
-            flagsToUpdate |= ActivityState::IsInWindow;
+            flagsToUpdate.add(ActivityState::IsInWindow);
         if (gtk_window_is_active(GTK_WINDOW(priv->toplevelOnScreenWindow)) && !(priv->activityState & ActivityState::WindowIsActive))
         if (gtk_window_is_active(GTK_WINDOW(priv->toplevelOnScreenWindow)) && !(priv->activityState & ActivityState::WindowIsActive))
-            flagsToUpdate |= ActivityState::WindowIsActive;
+            flagsToUpdate.add(ActivityState::WindowIsActive);
     }
     if (!flagsToUpdate)
         return;
 
     }
     if (!flagsToUpdate)
         return;
 
-    priv->activityState |= flagsToUpdate;
+    priv->activityState.add(flagsToUpdate);
     webkitWebViewBaseScheduleUpdateActivityState(webViewBase, flagsToUpdate);
 }
 
     webkitWebViewBaseScheduleUpdateActivityState(webViewBase, flagsToUpdate);
 }
 
@@ -649,7 +649,7 @@ static void webkitWebViewBaseUnmap(GtkWidget* widget)
     if (!(priv->activityState & ActivityState::IsVisible))
         return;
 
     if (!(priv->activityState & ActivityState::IsVisible))
         return;
 
-    priv->activityState -= ActivityState::IsVisible;
+    priv->activityState.remove(ActivityState::IsVisible);
     webkitWebViewBaseScheduleUpdateActivityState(webViewBase, ActivityState::IsVisible);
 }
 
     webkitWebViewBaseScheduleUpdateActivityState(webViewBase, ActivityState::IsVisible);
 }
 
@@ -1498,7 +1498,7 @@ void webkitWebViewBaseSetFocus(WebKitWebViewBase* webViewBase, bool focused)
 
     OptionSet<ActivityState::Flag> flagsToUpdate { ActivityState::IsFocused };
     if (focused) {
 
     OptionSet<ActivityState::Flag> flagsToUpdate { ActivityState::IsFocused };
     if (focused) {
-        priv->activityState |= ActivityState::IsFocused;
+        priv->activityState.add(ActivityState::IsFocused);
 
         // If the view has received the focus and the window is not active
         // mark the current window as active now. This can happen if the
 
         // If the view has received the focus and the window is not active
         // mark the current window as active now. This can happen if the
@@ -1506,11 +1506,11 @@ void webkitWebViewBaseSetFocus(WebKitWebViewBase* webViewBase, bool focused)
         // set programatically like WebKitTestRunner does, because POPUP
         // can't be focused.
         if (!(priv->activityState & ActivityState::WindowIsActive)) {
         // set programatically like WebKitTestRunner does, because POPUP
         // can't be focused.
         if (!(priv->activityState & ActivityState::WindowIsActive)) {
-            priv->activityState |= ActivityState::WindowIsActive;
-            flagsToUpdate |= ActivityState::WindowIsActive;
+            priv->activityState.add(ActivityState::WindowIsActive);
+            flagsToUpdate.add(ActivityState::WindowIsActive);
         }
     } else
         }
     } else
-        priv->activityState -= ActivityState::IsFocused;
+        priv->activityState.remove(ActivityState::IsFocused);
 
     webkitWebViewBaseScheduleUpdateActivityState(webViewBase, flagsToUpdate);
 }
 
     webkitWebViewBaseScheduleUpdateActivityState(webViewBase, flagsToUpdate);
 }
index 5028700..de48e0f 100644 (file)
@@ -2118,7 +2118,7 @@ void WebViewImpl::viewDidMoveToWindow()
         if (m_shouldDeferViewInWindowChanges)
             m_viewInWindowChangeWasDeferred = true;
         else
         if (m_shouldDeferViewInWindowChanges)
             m_viewInWindowChangeWasDeferred = true;
         else
-            activityStateChanges |= WebCore::ActivityState::IsInWindow;
+            activityStateChanges.add(WebCore::ActivityState::IsInWindow);
         m_page->activityStateDidChange(activityStateChanges);
 
         updateWindowAndViewFrames();
         m_page->activityStateDidChange(activityStateChanges);
 
         updateWindowAndViewFrames();
@@ -2144,7 +2144,7 @@ void WebViewImpl::viewDidMoveToWindow()
         if (m_shouldDeferViewInWindowChanges)
             m_viewInWindowChangeWasDeferred = true;
         else
         if (m_shouldDeferViewInWindowChanges)
             m_viewInWindowChangeWasDeferred = true;
         else
-            activityStateChanges |= WebCore::ActivityState::IsInWindow;
+            activityStateChanges.add(WebCore::ActivityState::IsInWindow);
         m_page->activityStateDidChange(activityStateChanges);
 
         [NSEvent removeMonitor:m_flagsChangedEventMonitor];
         m_page->activityStateDidChange(activityStateChanges);
 
         [NSEvent removeMonitor:m_flagsChangedEventMonitor];
index 9fe531d..e28310b 100644 (file)
@@ -1446,32 +1446,32 @@ void WebPageProxy::setSuppressVisibilityUpdates(bool flag)
 
 void WebPageProxy::updateActivityState(OptionSet<ActivityState::Flag> flagsToUpdate)
 {
 
 void WebPageProxy::updateActivityState(OptionSet<ActivityState::Flag> flagsToUpdate)
 {
-    m_activityState = m_activityState - flagsToUpdate;
+    m_activityState.remove(flagsToUpdate);
     if (flagsToUpdate & ActivityState::IsFocused && m_pageClient.isViewFocused())
     if (flagsToUpdate & ActivityState::IsFocused && m_pageClient.isViewFocused())
-        m_activityState |= ActivityState::IsFocused;
+        m_activityState.add(ActivityState::IsFocused);
     if (flagsToUpdate & ActivityState::WindowIsActive && m_pageClient.isViewWindowActive())
     if (flagsToUpdate & ActivityState::WindowIsActive && m_pageClient.isViewWindowActive())
-        m_activityState |= ActivityState::WindowIsActive;
+        m_activityState.add(ActivityState::WindowIsActive);
     if (flagsToUpdate & ActivityState::IsVisible && m_pageClient.isViewVisible())
     if (flagsToUpdate & ActivityState::IsVisible && m_pageClient.isViewVisible())
-        m_activityState |= ActivityState::IsVisible;
+        m_activityState.add(ActivityState::IsVisible);
     if (flagsToUpdate & ActivityState::IsVisibleOrOccluded && m_pageClient.isViewVisibleOrOccluded())
     if (flagsToUpdate & ActivityState::IsVisibleOrOccluded && m_pageClient.isViewVisibleOrOccluded())
-        m_activityState |= ActivityState::IsVisibleOrOccluded;
+        m_activityState.add(ActivityState::IsVisibleOrOccluded);
     if (flagsToUpdate & ActivityState::IsInWindow && m_pageClient.isViewInWindow())
     if (flagsToUpdate & ActivityState::IsInWindow && m_pageClient.isViewInWindow())
-        m_activityState |= ActivityState::IsInWindow;
+        m_activityState.add(ActivityState::IsInWindow);
     if (flagsToUpdate & ActivityState::IsVisuallyIdle && m_pageClient.isVisuallyIdle())
     if (flagsToUpdate & ActivityState::IsVisuallyIdle && m_pageClient.isVisuallyIdle())
-        m_activityState |= ActivityState::IsVisuallyIdle;
+        m_activityState.add(ActivityState::IsVisuallyIdle);
     if (flagsToUpdate & ActivityState::IsAudible && m_mediaState & MediaProducer::IsPlayingAudio && !(m_mutedState & MediaProducer::AudioIsMuted))
     if (flagsToUpdate & ActivityState::IsAudible && m_mediaState & MediaProducer::IsPlayingAudio && !(m_mutedState & MediaProducer::AudioIsMuted))
-        m_activityState |= ActivityState::IsAudible;
+        m_activityState.add(ActivityState::IsAudible);
     if (flagsToUpdate & ActivityState::IsLoading && m_pageLoadState.isLoading())
     if (flagsToUpdate & ActivityState::IsLoading && m_pageLoadState.isLoading())
-        m_activityState |= ActivityState::IsLoading;
+        m_activityState.add(ActivityState::IsLoading);
     if (flagsToUpdate & ActivityState::IsCapturingMedia && m_mediaState & (MediaProducer::HasActiveAudioCaptureDevice | MediaProducer::HasActiveVideoCaptureDevice))
     if (flagsToUpdate & ActivityState::IsCapturingMedia && m_mediaState & (MediaProducer::HasActiveAudioCaptureDevice | MediaProducer::HasActiveVideoCaptureDevice))
-        m_activityState |= ActivityState::IsCapturingMedia;
+        m_activityState.add(ActivityState::IsCapturingMedia);
 }
 
 void WebPageProxy::activityStateDidChange(OptionSet<ActivityState::Flag> mayHaveChanged, bool wantsSynchronousReply, ActivityStateChangeDispatchMode dispatchMode)
 {
     LOG_WITH_STREAM(ActivityState, stream << "WebPageProxy " << pageID() << " activityStateDidChange - mayHaveChanged " << mayHaveChanged);
 
 }
 
 void WebPageProxy::activityStateDidChange(OptionSet<ActivityState::Flag> mayHaveChanged, bool wantsSynchronousReply, ActivityStateChangeDispatchMode dispatchMode)
 {
     LOG_WITH_STREAM(ActivityState, stream << "WebPageProxy " << pageID() << " activityStateDidChange - mayHaveChanged " << mayHaveChanged);
 
-    m_potentiallyChangedActivityStateFlags |= mayHaveChanged;
+    m_potentiallyChangedActivityStateFlags.add(mayHaveChanged);
     m_activityStateChangeWantsSynchronousReply = m_activityStateChangeWantsSynchronousReply || wantsSynchronousReply;
 
     if (m_suppressVisibilityUpdates && dispatchMode != ActivityStateChangeDispatchMode::Immediate)
     m_activityStateChangeWantsSynchronousReply = m_activityStateChangeWantsSynchronousReply || wantsSynchronousReply;
 
     if (m_suppressVisibilityUpdates && dispatchMode != ActivityStateChangeDispatchMode::Immediate)
@@ -1522,7 +1522,7 @@ void WebPageProxy::dispatchActivityStateChange()
 
     // If the visibility state may have changed, then so may the visually idle & occluded agnostic state.
     if (m_potentiallyChangedActivityStateFlags & ActivityState::IsVisible)
 
     // If the visibility state may have changed, then so may the visually idle & occluded agnostic state.
     if (m_potentiallyChangedActivityStateFlags & ActivityState::IsVisible)
-        m_potentiallyChangedActivityStateFlags |= { ActivityState::IsVisibleOrOccluded, ActivityState::IsVisuallyIdle };
+        m_potentiallyChangedActivityStateFlags.add({ ActivityState::IsVisibleOrOccluded, ActivityState::IsVisuallyIdle });
 
     // Record the prior view state, update the flags that may have changed,
     // and check which flags have actually changed.
 
     // Record the prior view state, update the flags that may have changed,
     // and check which flags have actually changed.
index 7dfc423..56d40c7 100644 (file)
@@ -79,30 +79,27 @@ String WebsiteDataRecord::displayNameForOrigin(const WebCore::SecurityOriginData
 
 void WebsiteDataRecord::add(WebsiteDataType type, const WebCore::SecurityOriginData& origin)
 {
 
 void WebsiteDataRecord::add(WebsiteDataType type, const WebCore::SecurityOriginData& origin)
 {
-    types |= type;
-
+    types.add(type);
     origins.add(origin);
 }
 
 void WebsiteDataRecord::addCookieHostName(const String& hostName)
 {
     origins.add(origin);
 }
 
 void WebsiteDataRecord::addCookieHostName(const String& hostName)
 {
-    types |= WebsiteDataType::Cookies;
-
+    types.add(WebsiteDataType::Cookies);
     cookieHostNames.add(hostName);
 }
 
 #if ENABLE(NETSCAPE_PLUGIN_API)
 void WebsiteDataRecord::addPluginDataHostName(const String& hostName)
 {
     cookieHostNames.add(hostName);
 }
 
 #if ENABLE(NETSCAPE_PLUGIN_API)
 void WebsiteDataRecord::addPluginDataHostName(const String& hostName)
 {
-    types |= WebsiteDataType::PlugInData;
-
+    types.add(WebsiteDataType::PlugInData);
     pluginDataHostNames.add(hostName);
 }
 #endif
 
 void WebsiteDataRecord::addHSTSCacheHostname(const String& hostName)
 {
     pluginDataHostNames.add(hostName);
 }
 #endif
 
 void WebsiteDataRecord::addHSTSCacheHostname(const String& hostName)
 {
-    types |= WebsiteDataType::HSTSCache;
+    types.add(WebsiteDataType::HSTSCache);
     HSTSCacheHostNames.add(hostName);
 }
 
     HSTSCacheHostNames.add(hostName);
 }
 
@@ -157,8 +154,7 @@ String WebsiteDataRecord::topPrivatelyControlledDomain()
 
 void WebsiteDataRecord::addOriginWithCredential(const String& origin)
 {
 
 void WebsiteDataRecord::addOriginWithCredential(const String& origin)
 {
-    types |= WebsiteDataType::Credentials;
-
+    types.add(WebsiteDataType::Credentials);
     originsWithCredentials.add(origin);
 }
 
     originsWithCredentials.add(origin);
 }
 
index 8b88a23..70c7d5a 100644 (file)
 
     OptionSet<WebCore::ReloadOption> reloadOptions;
     if (WebKit::linkedOnOrAfter(WebKit::SDKVersion::FirstWithExpiredOnlyReloadBehavior))
 
     OptionSet<WebCore::ReloadOption> reloadOptions;
     if (WebKit::linkedOnOrAfter(WebKit::SDKVersion::FirstWithExpiredOnlyReloadBehavior))
-        reloadOptions |= WebCore::ReloadOption::ExpiredOnly;
+        reloadOptions.add(WebCore::ReloadOption::ExpiredOnly);
 
     _inspectedPage->reload(reloadOptions);
 }
 
     _inspectedPage->reload(reloadOptions);
 }
index f93419b..a8e2c8e 100644 (file)
@@ -170,9 +170,9 @@ static RefPtr<WebImage> imageForRect(FrameView* frameView, const IntRect& painti
 
     auto paintBehavior = frameView->paintBehavior() | PaintBehavior::FlattenCompositingLayers | PaintBehavior::Snapshotting;
     if (options & SnapshotOptionsForceBlackText)
 
     auto paintBehavior = frameView->paintBehavior() | PaintBehavior::FlattenCompositingLayers | PaintBehavior::Snapshotting;
     if (options & SnapshotOptionsForceBlackText)
-        paintBehavior |= PaintBehavior::ForceBlackText;
+        paintBehavior.add(PaintBehavior::ForceBlackText);
     if (options & SnapshotOptionsForceWhiteText)
     if (options & SnapshotOptionsForceWhiteText)
-        paintBehavior |= PaintBehavior::ForceWhiteText;
+        paintBehavior.add(PaintBehavior::ForceWhiteText);
 
     auto oldPaintBehavior = frameView->paintBehavior();
     frameView->setPaintBehavior(paintBehavior);
 
     auto oldPaintBehavior = frameView->paintBehavior();
     frameView->setPaintBehavior(paintBehavior);
index 6dcf657..6a80186 100644 (file)
@@ -150,11 +150,12 @@ RefPtr<WebImage> InjectedBundleRangeHandle::renderedImage(SnapshotOptions option
     graphicsContext->translate(-paintRect.location());
 
     OptionSet<PaintBehavior> oldPaintBehavior = frameView->paintBehavior();
     graphicsContext->translate(-paintRect.location());
 
     OptionSet<PaintBehavior> oldPaintBehavior = frameView->paintBehavior();
-    OptionSet<PaintBehavior> paintBehavior = oldPaintBehavior | PaintBehavior::SelectionOnly | PaintBehavior::FlattenCompositingLayers | PaintBehavior::Snapshotting;
+    OptionSet<PaintBehavior> paintBehavior = oldPaintBehavior;
+    paintBehavior.add({ PaintBehavior::SelectionOnly, PaintBehavior::FlattenCompositingLayers, PaintBehavior::Snapshotting });
     if (options & SnapshotOptionsForceBlackText)
     if (options & SnapshotOptionsForceBlackText)
-        paintBehavior |= PaintBehavior::ForceBlackText;
+        paintBehavior.add(PaintBehavior::ForceBlackText);
     if (options & SnapshotOptionsForceWhiteText)
     if (options & SnapshotOptionsForceWhiteText)
-        paintBehavior |= PaintBehavior::ForceWhiteText;
+        paintBehavior.add(PaintBehavior::ForceWhiteText);
 
     frameView->setPaintBehavior(paintBehavior);
     ownerDocument.updateLayout();
 
     frameView->setPaintBehavior(paintBehavior);
     ownerDocument.updateLayout();
index d99f16b..500ef14 100644 (file)
@@ -156,7 +156,7 @@ void ThreadedCoordinatedLayerTreeHost::scrollNonCompositedContents(const IntRect
 
     m_viewportController.didScroll(rect.location());
     if (m_isDiscardable)
 
     m_viewportController.didScroll(rect.location());
     if (m_isDiscardable)
-        m_discardableSyncActions |= DiscardableSyncActions::UpdateViewport;
+        m_discardableSyncActions.add(DiscardableSyncActions::UpdateViewport);
     else
         didChangeViewport();
 }
     else
         didChangeViewport();
 }
@@ -165,7 +165,7 @@ void ThreadedCoordinatedLayerTreeHost::contentsSizeChanged(const IntSize& newSiz
 {
     m_viewportController.didChangeContentsSize(newSize);
     if (m_isDiscardable)
 {
     m_viewportController.didChangeContentsSize(newSize);
     if (m_isDiscardable)
-        m_discardableSyncActions |= DiscardableSyncActions::UpdateViewport;
+        m_discardableSyncActions.add(DiscardableSyncActions::UpdateViewport);
     else
         didChangeViewport();
 }
     else
         didChangeViewport();
 }
@@ -173,7 +173,7 @@ void ThreadedCoordinatedLayerTreeHost::contentsSizeChanged(const IntSize& newSiz
 void ThreadedCoordinatedLayerTreeHost::deviceOrPageScaleFactorChanged()
 {
     if (m_isDiscardable) {
 void ThreadedCoordinatedLayerTreeHost::deviceOrPageScaleFactorChanged()
 {
     if (m_isDiscardable) {
-        m_discardableSyncActions |= DiscardableSyncActions::UpdateScale;
+        m_discardableSyncActions.add(DiscardableSyncActions::UpdateScale);
         return;
     }
 
         return;
     }
 
@@ -187,7 +187,7 @@ void ThreadedCoordinatedLayerTreeHost::deviceOrPageScaleFactorChanged()
 void ThreadedCoordinatedLayerTreeHost::pageBackgroundTransparencyChanged()
 {
     if (m_isDiscardable) {
 void ThreadedCoordinatedLayerTreeHost::pageBackgroundTransparencyChanged()
 {
     if (m_isDiscardable) {
-        m_discardableSyncActions |= DiscardableSyncActions::UpdateBackground;
+        m_discardableSyncActions.add(DiscardableSyncActions::UpdateBackground);
         return;
     }
 
         return;
     }
 
@@ -198,7 +198,7 @@ void ThreadedCoordinatedLayerTreeHost::pageBackgroundTransparencyChanged()
 void ThreadedCoordinatedLayerTreeHost::sizeDidChange(const IntSize& size)
 {
     if (m_isDiscardable) {
 void ThreadedCoordinatedLayerTreeHost::sizeDidChange(const IntSize& size)
 {
     if (m_isDiscardable) {
-        m_discardableSyncActions |= DiscardableSyncActions::UpdateSize;
+        m_discardableSyncActions.add(DiscardableSyncActions::UpdateSize);
         m_viewportController.didChangeViewportSize(size);
         return;
     }
         m_viewportController.didChangeViewportSize(size);
         return;
     }
@@ -218,7 +218,7 @@ void ThreadedCoordinatedLayerTreeHost::didChangeViewportAttributes(ViewportAttri
 {
     m_viewportController.didChangeViewportAttributes(WTFMove(attr));
     if (m_isDiscardable)
 {
     m_viewportController.didChangeViewportAttributes(WTFMove(attr));
     if (m_isDiscardable)
-        m_discardableSyncActions |= DiscardableSyncActions::UpdateViewport;
+        m_discardableSyncActions.add(DiscardableSyncActions::UpdateViewport);
     else
         didChangeViewport();
 }
     else
         didChangeViewport();
 }
index ead0d87..0387263 100644 (file)
@@ -56,15 +56,15 @@ WebCore::FindOptions core(FindOptions options)
 {
     WebCore::FindOptions result;
     if (options & FindOptionsCaseInsensitive)
 {
     WebCore::FindOptions result;
     if (options & FindOptionsCaseInsensitive)
-        result |= WebCore::CaseInsensitive;
+        result.add(WebCore::CaseInsensitive);
     if (options & FindOptionsAtWordStarts)
     if (options & FindOptionsAtWordStarts)
-        result |= WebCore::AtWordStarts;
+        result.add(WebCore::AtWordStarts);
     if (options & FindOptionsTreatMedialCapitalAsWordStart)
     if (options & FindOptionsTreatMedialCapitalAsWordStart)
-        result |= WebCore::TreatMedialCapitalAsWordStart;
+        result.add(WebCore::TreatMedialCapitalAsWordStart);
     if (options & FindOptionsBackwards)
     if (options & FindOptionsBackwards)
-        result |= WebCore::Backwards;
+        result.add(WebCore::Backwards);
     if (options & FindOptionsWrapAround)
     if (options & FindOptionsWrapAround)
-        result |= WebCore::WrapAround;
+        result.add(WebCore::WrapAround);
     return result;
 }
 
     return result;
 }
 
@@ -204,7 +204,7 @@ void FindController::findString(const String& string, FindOptions options, unsig
     // we need to avoid sending the non-painted selection change to the UI process
     // so that it does not clear the selection out from under us.
 #if PLATFORM(IOS)
     // we need to avoid sending the non-painted selection change to the UI process
     // so that it does not clear the selection out from under us.
 #if PLATFORM(IOS)
-    coreOptions |= DoNotRevealSelection;
+    coreOptions.add(DoNotRevealSelection);
 #endif
 
     willFindString();
 #endif
 
     willFindString();
index 685ecf2..e0c685c 100644 (file)
@@ -1,3 +1,15 @@
+2018-08-31  Antti Koivisto  <antti@apple.com>
+
+        Replace OptionSet |= and -= operators with add() and remove() functions
+        https://bugs.webkit.org/show_bug.cgi?id=189169
+
+        Reviewed by Anders Carlsson.
+
+        * WebView/WebFrame.mm:
+        (-[WebFrame _drawRect:contentsOnly:]):
+        * WebView/WebView.mm:
+        (coreOptions):
+
 2018-08-31  Frederic Wang  <fwang@igalia.com>
 
         Bug 182053 - [CSSOM View] Implement standard behavior for scrollingElement
 2018-08-31  Frederic Wang  <fwang@igalia.com>
 
         Bug 182053 - [CSSOM View] Implement standard behavior for scrollingElement
index 4f007d0..860db29 100644 (file)
@@ -649,16 +649,16 @@ static inline WebDataSource *dataSource(DocumentLoader* loader)
         // For subframes, we need to inherit the paint behavior from our parent
         if (FrameView* parentView = parentFrame ? parentFrame->view() : nullptr) {
             if (parentView->paintBehavior().contains(PaintBehavior::FlattenCompositingLayers))
         // For subframes, we need to inherit the paint behavior from our parent
         if (FrameView* parentView = parentFrame ? parentFrame->view() : nullptr) {
             if (parentView->paintBehavior().contains(PaintBehavior::FlattenCompositingLayers))
-                paintBehavior |= PaintBehavior::FlattenCompositingLayers;
+                paintBehavior.add(PaintBehavior::FlattenCompositingLayers);
             
             if (parentView->paintBehavior().contains(PaintBehavior::Snapshotting))
             
             if (parentView->paintBehavior().contains(PaintBehavior::Snapshotting))
-                paintBehavior |= PaintBehavior::Snapshotting;
+                paintBehavior.add(PaintBehavior::Snapshotting);
             
             if (parentView->paintBehavior().contains(PaintBehavior::TileFirstPaint))
             
             if (parentView->paintBehavior().contains(PaintBehavior::TileFirstPaint))
-                paintBehavior |= PaintBehavior::TileFirstPaint;
+                paintBehavior.add(PaintBehavior::TileFirstPaint);
         }
     } else
         }
     } else
-        paintBehavior |= [self _paintBehaviorForDestinationContext:ctx];
+        paintBehavior.add([self _paintBehaviorForDestinationContext:ctx]);
         
     view->setPaintBehavior(paintBehavior);
 
         
     view->setPaintBehavior(paintBehavior);
 
index e621843..19619aa 100644 (file)
@@ -571,17 +571,17 @@ FindOptions coreOptions(WebFindOptions options)
 {
     FindOptions findOptions;
     if (options & WebFindOptionsCaseInsensitive)
 {
     FindOptions findOptions;
     if (options & WebFindOptionsCaseInsensitive)
-        findOptions |= CaseInsensitive;
+        findOptions.add(CaseInsensitive);
     if (options & WebFindOptionsAtWordStarts)
     if (options & WebFindOptionsAtWordStarts)
-        findOptions |= AtWordStarts;
+        findOptions.add(AtWordStarts);
     if (options & WebFindOptionsTreatMedialCapitalAsWordStart)
     if (options & WebFindOptionsTreatMedialCapitalAsWordStart)
-        findOptions |= TreatMedialCapitalAsWordStart;
+        findOptions.add(TreatMedialCapitalAsWordStart);
     if (options & WebFindOptionsBackwards)
     if (options & WebFindOptionsBackwards)
-        findOptions |= Backwards;
+        findOptions.add(Backwards);
     if (options & WebFindOptionsWrapAround)
     if (options & WebFindOptionsWrapAround)
-        findOptions |= WrapAround;
+        findOptions.add(WrapAround);
     if (options & WebFindOptionsStartInSelection)
     if (options & WebFindOptionsStartInSelection)
-        findOptions |= StartInSelection;
+        findOptions.add(StartInSelection);
     return findOptions;
 }
 
     return findOptions;
 }
 
index f543a03..9ffd8c4 100644 (file)
@@ -3832,11 +3832,11 @@ HRESULT WebView::searchFor(_In_ BSTR str, BOOL forward, BOOL caseFlag, BOOL wrap
 
     FindOptions options;
     if (!caseFlag)
 
     FindOptions options;
     if (!caseFlag)
-        options |= CaseInsensitive;
+        options.add(CaseInsensitive);
     if (!forward)
     if (!forward)
-        options |= Backwards;
+        options.add(Backwards);
     if (wrapFlag)
     if (wrapFlag)
-        options |= WrapAround;
+        options.add(WrapAround);
     *found = m_page->findString(toString(str), options);
     return S_OK;
 }
     *found = m_page->findString(toString(str), options);
     return S_OK;
 }
@@ -3901,7 +3901,7 @@ HRESULT WebView::markAllMatchesForText(_In_ BSTR str, BOOL caseSensitive, BOOL h
 
     WebCore::FindOptions options;
     if (!caseSensitive)
 
     WebCore::FindOptions options;
     if (!caseSensitive)
-        options |= WebCore::CaseInsensitive;
+        options.add(WebCore::CaseInsensitive);
 
     *matches = m_page->markAllMatchesForText(toString(str), options, highlight, limit);
     return S_OK;
 
     *matches = m_page->markAllMatchesForText(toString(str), options, highlight, limit);
     return S_OK;
@@ -7840,17 +7840,17 @@ HRESULT WebView::findString(_In_ BSTR string, WebFindOptions options, _Deref_opt
     WebCore::FindOptions coreOptions;
 
     if (options & WebFindOptionsCaseInsensitive)
     WebCore::FindOptions coreOptions;
 
     if (options & WebFindOptionsCaseInsensitive)
-        coreOptions |= WebCore::CaseInsensitive;
+        coreOptions.add(WebCore::CaseInsensitive);
     if (options & WebFindOptionsAtWordStarts)
     if (options & WebFindOptionsAtWordStarts)
-        coreOptions |= WebCore::AtWordStarts;
+        coreOptions.add(WebCore::AtWordStarts);
     if (options & WebFindOptionsTreatMedialCapitalAsWordStart)
     if (options & WebFindOptionsTreatMedialCapitalAsWordStart)
-        coreOptions |= WebCore::TreatMedialCapitalAsWordStart;
+        coreOptions.add(WebCore::TreatMedialCapitalAsWordStart);
     if (options & WebFindOptionsBackwards)
     if (options & WebFindOptionsBackwards)
-        coreOptions |= WebCore::Backwards;
+        coreOptions.add(WebCore::Backwards);
     if (options & WebFindOptionsWrapAround)
     if (options & WebFindOptionsWrapAround)
-        coreOptions |= WebCore::WrapAround;
+        coreOptions.add(WebCore::WrapAround);
     if (options & WebFindOptionsStartInSelection)
     if (options & WebFindOptionsStartInSelection)
-        coreOptions |= WebCore::StartInSelection;
+        coreOptions.add(WebCore::StartInSelection);
 
     *found = m_page->findString(toString(string), coreOptions);
     return S_OK;
 
     *found = m_page->findString(toString(string), coreOptions);
     return S_OK;
index 80f8002..cd4a9ad 100644 (file)
@@ -1,3 +1,13 @@
+2018-08-31  Antti Koivisto  <antti@apple.com>
+
+        Replace OptionSet |= and -= operators with add() and remove() functions
+        https://bugs.webkit.org/show_bug.cgi?id=189169
+
+        Reviewed by Anders Carlsson.
+
+        * TestWebKitAPI/Tests/WTF/OptionSet.cpp:
+        (TestWebKitAPI::TEST):
+
 2018-08-31  Daniel Bates  <dabates@apple.com>
 
         lldb-webkit: KeyError thrown for OptionSet with invalid value
 2018-08-31  Daniel Bates  <dabates@apple.com>
 
         lldb-webkit: KeyError thrown for OptionSet with invalid value
index 101b335..493ec25 100644 (file)
@@ -96,16 +96,29 @@ TEST(WTF_OptionSet, Minus)
     EXPECT_TRUE((set - set).isEmpty());
 }
 
     EXPECT_TRUE((set - set).isEmpty());
 }
 
-TEST(WTF_OptionSet, MinusEqual)
+TEST(WTF_OptionSet, AddAndRemove)
 {
 {
-    OptionSet<ExampleFlags> set { ExampleFlags::A, ExampleFlags::B, ExampleFlags::C };
+    OptionSet<ExampleFlags> set;
 
 
-    EXPECT_TRUE(((set -= ExampleFlags::A) == OptionSet<ExampleFlags> { ExampleFlags::B, ExampleFlags::C }));
-    EXPECT_TRUE((set == OptionSet<ExampleFlags> { ExampleFlags::B, ExampleFlags::C }));
-    EXPECT_TRUE(((set -= ExampleFlags::D) == OptionSet<ExampleFlags> { ExampleFlags::B, ExampleFlags::C }));
-    EXPECT_TRUE((set == OptionSet<ExampleFlags> { ExampleFlags::B, ExampleFlags::C }));
-    EXPECT_TRUE((set -= set).isEmpty());
-    EXPECT_TRUE(set.isEmpty());
+    set.add(ExampleFlags::A);
+    EXPECT_TRUE(set.contains(ExampleFlags::A));
+    EXPECT_FALSE(set.contains(ExampleFlags::B));
+    EXPECT_FALSE(set.contains(ExampleFlags::C));
+
+    set.add({ ExampleFlags::B, ExampleFlags::C });
+    EXPECT_TRUE(set.contains(ExampleFlags::A));
+    EXPECT_TRUE(set.contains(ExampleFlags::B));
+    EXPECT_TRUE(set.contains(ExampleFlags::C));
+
+    set.remove(ExampleFlags::B);
+    EXPECT_TRUE(set.contains(ExampleFlags::A));
+    EXPECT_FALSE(set.contains(ExampleFlags::B));
+    EXPECT_TRUE(set.contains(ExampleFlags::C));
+
+    set.remove({ ExampleFlags::A, ExampleFlags::C });
+    EXPECT_FALSE(set.contains(ExampleFlags::A));
+    EXPECT_FALSE(set.contains(ExampleFlags::B));
+    EXPECT_FALSE(set.contains(ExampleFlags::C));
 }
 
 TEST(WTF_OptionSet, ContainsTwoFlags)
 }
 
 TEST(WTF_OptionSet, ContainsTwoFlags)
@@ -141,15 +154,6 @@ TEST(WTF_OptionSet, ContainsTwoFlags3)
     EXPECT_FALSE(set.contains(ExampleFlags::C));
 }
 
     EXPECT_FALSE(set.contains(ExampleFlags::C));
 }
 
-TEST(WTF_OptionSet, OperatorBitwiseOr)
-{
-    OptionSet<ExampleFlags> set = ExampleFlags::A;
-    set |= ExampleFlags::C;
-    EXPECT_TRUE(set.contains(ExampleFlags::A));
-    EXPECT_FALSE(set.contains(ExampleFlags::B));
-    EXPECT_TRUE(set.contains(ExampleFlags::C));
-}
-
 TEST(WTF_OptionSet, EmptyOptionSetToRawValueToOptionSet)
 {
     OptionSet<ExampleFlags> set;
 TEST(WTF_OptionSet, EmptyOptionSetToRawValueToOptionSet)
 {
     OptionSet<ExampleFlags> set;
@@ -302,10 +306,10 @@ TEST(WTF_OptionSet, NextItemAfterLargestIn64BitFlagSet)
 TEST(WTF_OptionSet, IterationOrderTheSameRegardlessOfInsertionOrder)
 {
     OptionSet<ExampleFlags> set1 = ExampleFlags::C;
 TEST(WTF_OptionSet, IterationOrderTheSameRegardlessOfInsertionOrder)
 {
     OptionSet<ExampleFlags> set1 = ExampleFlags::C;
-    set1 |= ExampleFlags::A;
+    set1.add(ExampleFlags::A);
 
     OptionSet<ExampleFlags> set2 = ExampleFlags::A;
 
     OptionSet<ExampleFlags> set2 = ExampleFlags::A;
-    set2 |= ExampleFlags::C;
+    set2.add(ExampleFlags::C);
 
     OptionSet<ExampleFlags>::iterator it1 = set1.begin();
     OptionSet<ExampleFlags>::iterator it2 = set2.begin();
 
     OptionSet<ExampleFlags>::iterator it1 = set1.begin();
     OptionSet<ExampleFlags>::iterator it2 = set2.begin();