-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Add an iterator for the StyleProperties family of classes #6981
Add an iterator for the StyleProperties family of classes #6981
Conversation
EWS run on previous version of this PR (hash 9f61846) |
@@ -2271,8 +2271,8 @@ void KeyframeEffect::computeHasImplicitKeyframeForAcceleratedProperty() | |||
HashSet<CSSPropertyID> explicitZeroProperties; | |||
HashSet<CSSPropertyID> explicitOneProperties; | |||
auto styleProperties = keyframe.style; | |||
for (unsigned i = 0; i < styleProperties->propertyCount(); ++i) { | |||
auto property = styleProperties->propertyAt(i).id(); | |||
for (auto propertyReference : styleProperties.get()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
π
for (unsigned i = 0; i < styleProperties->propertyCount(); ++i) { | ||
auto property = styleProperties->propertyAt(i).id(); | ||
if (CSSPropertyAnimation::animationOfPropertyIsAccelerated(property)) | ||
for (auto property : styleProperties.get()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
π
bool hasRevert = false; | ||
for (unsigned i = 0; i < propertyCount; ++i) { | ||
auto propertyReference = keyframe.properties().propertyAt(i); | ||
for (auto propertyReference : keyframe.properties()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
π
9f61846
to
9a0837c
Compare
EWS run on previous version of this PR (hash 9a0837c) |
9a0837c
to
2adf7eb
Compare
EWS run on previous version of this PR (hash 2adf7eb) |
2adf7eb
to
e734b74
Compare
EWS run on previous version of this PR (hash e734b74) |
e734b74
to
62c3aa9
Compare
https://bugs.webkit.org/show_bug.cgi?id=248546 rdar://102823936 Reviewed by Antoine Quint. Add iterator support for StyleProperties, ImmutableStyleProperties and MutableStyleProperties to allow iterating through the stored properties using for-in as well generic algorithms. * Source/WTF/wtf/Vector.h: (WTF::Mapper::map): (WTF::CompactMapper::compactMap): (WTF::copyToVectorSpecialization): Use a universal reference to allow iterators that return temporaries (like the one for StyleProperties) to work with the mapping code. * Source/WebCore/animation/KeyframeEffect.cpp: (WebCore::KeyframeEffect::computeHasImplicitKeyframeForAcceleratedProperty): (WebCore::KeyframeEffect::computeHasKeyframeComposingAcceleratedProperty): Adopt range-based for loop using the new iterator. * Source/WebCore/css/CSSValueList.cpp: (WebCore::CSSValueList::removeAll): (WebCore::CSSValueList::hasValue const): * Source/WebCore/css/CSSValueList.h: Remove versions of removeAll() and hasValue() taking a nullable CSSValue*, and replace them with overloads that take either a CSSValue& or a CSSValueID. The CSSValueID allows us to check use without allocation or pool lookup. * Source/WebCore/css/ComputedStyleExtractor.cpp: (WebCore::ComputedStyleExtractor::fontVariantShorthandValue): (WebCore::ComputedStyleExtractor::getCSSPropertyValuesForShorthandProperties): (WebCore::ComputedStyleExtractor::getCSSPropertyValuesForGridShorthand): Adopt range-based for loop using existing shorthand iterator support. Use isValueID helper to simplify a condition. * Source/WebCore/css/PropertySetCSSStyleDeclaration.cpp: (WebCore::PropertySetCSSStyleDeclaration::length const): Adopt range-based for loop using the new iterator. * Source/WebCore/css/StyleProperties.cpp: (WebCore::MutableStyleProperties::MutableStyleProperties): (WebCore::StyleProperties::commonShorthandChecks const): (WebCore::StyleProperties::asTextInternal const): (WebCore::MutableStyleProperties::mergeAndOverrideOnConflict): (WebCore::StyleProperties::traverseSubresources const): * Source/WebCore/css/StyleProperties.h: (WebCore::StyleProperties::Iterator::Iterator): (WebCore::StyleProperties::Iterator::operator* const): (WebCore::StyleProperties::Iterator::operator++): (WebCore::StyleProperties::Iterator::operator== const): (WebCore::StyleProperties::Iterator::operator!= const): (WebCore::StyleProperties::begin const): (WebCore::StyleProperties::end): (WebCore::StyleProperties::size const): Adds and adopts iterator support. The two subclasses of StyleProperties overload begin() to allow specialization when the concrete type is known. * Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp: (WebCore::CSSPropertyParserHelpers::consumeTouchAction): (WebCore::CSSPropertyParserHelpers::consumeTextDecorationLine): Adopt template consumeIdent and update for new reference taking hasValue(). * Source/WebCore/css/typedom/DeclaredStylePropertyMap.cpp: (WebCore::DeclaredStylePropertyMap::entries const): Adopt WTF::map() now that it can be used due to iterator for StyleProperties. * Source/WebCore/editing/EditingStyle.cpp: (WebCore::applyTextDecorationChangeToValueList): Update for new hasValue/removeValue interfaces. (WebCore::EditingStyle::removeStyleAddedByNode): Use auto (which is going to infer Ref now rather than RefPtr) and update uses to pass non-null references. (WebCore::EditingStyle::removeStyleConflictingWithStyleOfNode): Adopt range-based for loop using the new iterator. (WebCore::EditingStyle::conflictsWithInlineStyleOfElement const): Adopt range-based for loop using the new iterator. * Source/WebCore/editing/Editor.cpp: (WebCore::Editor::fontAttributesAtSelectionStart): Adopt new CSSValueID overloads of hasValue. * Source/WebCore/page/PageSerializer.cpp: (WebCore::PageSerializer::retrieveResourcesForProperties): Adopt range-based for loop using the new iterator. * Source/WebCore/style/ElementRuleCollector.cpp: (WebCore::Style::ElementRuleCollector::addMatchedProperties): Adopt range-based for loop using the new iterator. * Source/WebCore/style/PropertyCascade.cpp: (WebCore::Style::PropertyCascade::addMatch): (WebCore::Style::hasImportantProperties): Adopt range-based for loop using the new iterator. * Source/WebCore/style/StyleResolver.cpp: (WebCore::Style::Resolver::styleForKeyframe): Adopt range-based for loop using the new iterator. Canonical link: https://commits.webkit.org/257356@main
62c3aa9
to
bd076ef
Compare
Committed 257356@main (bd076ef): https://commits.webkit.org/257356@main Reviewed commits have been landed. Closing PR #6981 and removing active labels. |
bd076ef
62c3aa9
π wincairoπ π§ͺ merge