-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Replace PseudoIdSet with EnumSet<PseudoId> #52373
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Contributor
Collaborator
|
EWS run on previous version of this PR (hash fd77271) Details |
fd77271 to
4c343ed
Compare
Collaborator
|
EWS run on current version of this PR (hash 4c343ed) Details |
https://bugs.webkit.org/show_bug.cgi?id=300396 rdar://162214153 Reviewed by Sam Weinig. Add a generic EnumSet class and use it for PseudoIds. EnumSet has the same interface as OptionSet but does not require using bitmask style enum. This makes it more convenient to use especially when compact storage for individual values is also important. Tests: Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj Tools/TestWebKitAPI/Tests/WTF/EnumSet.cpp * Source/WTF/WTF.xcodeproj/project.pbxproj: * Source/WTF/wtf/EnumSet.h: Added. (WTF::requires): (WTF::EnumSet::storageSize): (WTF::EnumSet::Iterator::operator* const): (WTF::EnumSet::Iterator::operator++): (WTF::EnumSet::Iterator::Iterator): (WTF::EnumSet::fromRaw): (WTF::EnumSet::EnumSet): (WTF::EnumSet::toRaw const): (WTF::EnumSet::isEmpty const): (WTF::EnumSet::begin const): (WTF::EnumSet::end const): (WTF::EnumSet::operator bool const): (WTF::EnumSet::contains const): (WTF::EnumSet::containsAny const): (WTF::EnumSet::containsAll const): (WTF::EnumSet::containsOnly const): (WTF::EnumSet::add): (WTF::EnumSet::remove): (WTF::EnumSet::set): (WTF::EnumSet::hasExactlyOneBitSet const): (WTF::EnumSet::toSingleValue const): (WTF::EnumSet::operator|): (WTF::EnumSet::operator|=): (WTF::EnumSet::operator&): (WTF::EnumSet::operator-): (WTF::EnumSet::operator^): (WTF::EnumSet::storageMemoryOffset): (WTF::EnumSet::get const): * Source/WTF/wtf/Forward.h: * Source/WebCore/animation/WebAnimationUtilities.h: * Source/WebCore/css/SelectorChecker.cpp: (WebCore::SelectorChecker::match const): (WebCore::SelectorChecker::matchHostPseudoClass const): (WebCore::hasViewTransitionPseudoElement): (WebCore::hasScrollbarPseudoElement): (WebCore::SelectorChecker::matchRecursively const): (WebCore::SelectorChecker::checkOne const): (WebCore::SelectorChecker::matchSelectorList const): (WebCore::SelectorChecker::matchHasPseudoClass const): * Source/WebCore/css/SelectorChecker.h: * Source/WebCore/cssjit/SelectorCompiler.cpp: (WebCore::SelectorCompiler::SelectorCodeGenerator::generateRequestedPseudoElementEqualsToSelectorPseudoElement): (WebCore::SelectorCompiler::SelectorCodeGenerator::generateMarkPseudoStyleForPseudoElement): * Source/WebCore/inspector/agents/InspectorCSSAgent.cpp: (WebCore::InspectorCSSAgent::getMatchedStylesForNode): * Source/WebCore/inspector/agents/InspectorDOMAgent.cpp: (WebCore::InspectorDOMAgent::highlightSelector): * Source/WebCore/rendering/RenderElement.cpp: (WebCore::RenderElement::getCachedPseudoStyle const): (WebCore::RenderElement::getUncachedPseudoStyle const): * Source/WebCore/rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::RenderStyle): * Source/WebCore/rendering/style/RenderStyle.h: * Source/WebCore/rendering/style/RenderStyleConstants.h: (WebCore::PseudoIdSet::PseudoIdSet): Deleted. (WebCore::PseudoIdSet::fromMask): Deleted. (WebCore::PseudoIdSet::has const): Deleted. (WebCore::PseudoIdSet::add): Deleted. (WebCore::PseudoIdSet::remove): Deleted. (WebCore::PseudoIdSet::merge): Deleted. (WebCore::PseudoIdSet::operator & const): Deleted. (WebCore::PseudoIdSet::operator | const): Deleted. (WebCore::PseudoIdSet::operator bool const): Deleted. (WebCore::PseudoIdSet::data const): Deleted. (WebCore::PseudoIdSet::dataMemoryOffset): Deleted. * Source/WebCore/rendering/style/RenderStyleInlines.h: (WebCore::RenderStyle::pseudoElementType const): (WebCore::RenderStyle::NonInheritedFlags::hasPseudoStyle const): (WebCore::RenderStyle::NonInheritedFlags::hasAnyPublicPseudoStyles const): * Source/WebCore/rendering/style/RenderStyleSetters.h: (WebCore::RenderStyle::setHasPseudoStyles): (WebCore::RenderStyle::NonInheritedFlags::setHasPseudoStyles): (WebCore::RenderStyle::setPseudoElementType): * Source/WebCore/style/ElementRuleCollector.cpp: (WebCore::Style::ElementRuleCollector::ruleMatches): * Source/WebCore/style/ElementRuleCollector.h: (WebCore::Style::ElementRuleCollector::matchedPseudoElementIds const): * Source/WebCore/style/PseudoElementIdentifier.h: (WTF::HashTraits<WebCore::Style::PseudoElementIdentifier>::emptyValue): (WTF::HashTraits<WebCore::Style::PseudoElementIdentifier>::constructDeletedValue): (WTF::HashTraits<WebCore::Style::PseudoElementIdentifier>::isDeletedValue): (WTF::HashTraits<std::optional<WebCore::Style::PseudoElementIdentifier>>::emptyValue): (WTF::HashTraits<std::optional<WebCore::Style::PseudoElementIdentifier>>::constructDeletedValue): (WTF::HashTraits<std::optional<WebCore::Style::PseudoElementIdentifier>>::isDeletedValue): * Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * Tools/TestWebKitAPI/Tests/WTF/EnumSet.cpp: Added. (TestWebKitAPI::TEST(WTF_EnumSet, EmptySet)): (TestWebKitAPI::TEST(WTF_EnumSet, StorageSize)): (TestWebKitAPI::TEST(WTF_EnumSet, ContainsOneFlag)): (TestWebKitAPI::TEST(WTF_EnumSet, Equal)): (TestWebKitAPI::TEST(WTF_EnumSet, NotEqual)): (TestWebKitAPI::TEST(WTF_EnumSet, Or)): (TestWebKitAPI::TEST(WTF_EnumSet, OrAssignment)): (TestWebKitAPI::TEST(WTF_EnumSet, Minus)): (TestWebKitAPI::TEST(WTF_EnumSet, AddAndRemove)): (TestWebKitAPI::TEST(WTF_EnumSet, Set)): (TestWebKitAPI::TEST(WTF_EnumSet, ContainsTwoFlags)): (TestWebKitAPI::TEST(WTF_EnumSet, ContainsTwoFlags2)): (TestWebKitAPI::TEST(WTF_EnumSet, ContainsTwoFlags3)): (TestWebKitAPI::TEST(WTF_EnumSet, EmptyEnumSetToRawValueToEnumSet)): (TestWebKitAPI::TEST(WTF_EnumSet, EnumSetThatContainsOneFlagToRawValueToEnumSet)): (TestWebKitAPI::TEST(WTF_EnumSet, EnumSetThatContainsOneFlagToRawValueToEnumSet2)): (TestWebKitAPI::TEST(WTF_EnumSet, EnumSetThatContainsTwoFlagsToRawValueToEnumSet)): (TestWebKitAPI::TEST(WTF_EnumSet, EnumSetThatContainsTwoFlagsToRawValueToEnumSet2)): (TestWebKitAPI::TEST(WTF_EnumSet, TwoIteratorsIntoSameEnumSet)): (TestWebKitAPI::TEST(WTF_EnumSet, IterateOverEnumSetThatContainsTwoFlags)): (TestWebKitAPI::TEST(WTF_EnumSet, IterateOverEnumSetThatContainsFlags2)): (TestWebKitAPI::TEST(WTF_EnumSet, NextItemAfterLargestIn32BitFlagSet)): (TestWebKitAPI::TEST(WTF_EnumSet, NextItemAfterLargestIn64BitFlagSet)): (TestWebKitAPI::TEST(WTF_EnumSet, IterationOrderTheSameRegardlessOfInsertionOrder)): (TestWebKitAPI::TEST(WTF_EnumSet, OperatorAnd)): (TestWebKitAPI::TEST(WTF_EnumSet, OperatorXor)): (TestWebKitAPI::TEST(WTF_EnumSet, ContainsAny)): (TestWebKitAPI::TEST(WTF_EnumSet, ContainsAll)): (TestWebKitAPI::TEST(WTF_EnumSet, ToSingleValue)): Canonical link: https://commits.webkit.org/301557@main
4c343ed to
3ec44e3
Compare
Collaborator
|
Committed 301557@main (3ec44e3): https://commits.webkit.org/301557@main Reviewed commits have been landed. Closing PR #52373 and removing active labels. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🛠 ios-apple
3ec44e3
4c343ed
🧪 win-tests🧪 gtk-wk2