Skip to content

Commit

Permalink
m_propertyVector should be a private member of MutableStyleProperties
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=271293

Reviewed by Simon Fraser.

Made m_propertyVector private to MutableStyleProperties.

* Source/WebCore/css/MutableStyleProperties.h:
* Source/WebCore/editing/EditingStyle.cpp:
(WebCore::EditingStyle::removeEquivalentProperties):

Canonical link: https://commits.webkit.org/276386@main
  • Loading branch information
rniwa committed Mar 20, 2024
1 parent e9f9c8b commit 4ff86d0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Source/WebCore/css/MutableStyleProperties.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,6 @@ class MutableStyleProperties final : public StyleProperties {
int findPropertyIndex(CSSPropertyID) const;
int findCustomPropertyIndex(StringView propertyName) const;

Vector<CSSProperty, 4> m_propertyVector;

// Methods for querying and altering CSS custom properties.
bool setCustomProperty(const String& propertyName, const String& value, bool important, CSSParserContext);
bool removeCustomProperty(const String& propertyName, String* returnText = nullptr);
Expand All @@ -105,6 +103,8 @@ class MutableStyleProperties final : public StyleProperties {
bool canUpdateInPlace(const CSSProperty&, CSSProperty* toReplace) const;

friend class StyleProperties;

Vector<CSSProperty, 4> m_propertyVector;
};

inline void MutableStyleProperties::deref() const
Expand Down
8 changes: 3 additions & 5 deletions Source/WebCore/editing/EditingStyle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1506,13 +1506,11 @@ template<typename T>
void EditingStyle::removeEquivalentProperties(T& style)
{
Vector<CSSPropertyID> propertiesToRemove;
for (auto& property : m_mutableStyle->m_propertyVector) {
if (style.propertyMatches(property.id(), property.protectedValue().get()))
for (auto property : *m_mutableStyle) {
if (style.propertyMatches(property.id(), property.value()))
propertiesToRemove.append(property.id());
}
// FIXME: This should use mass removal.
for (auto& property : propertiesToRemove)
m_mutableStyle->removeProperty(property);
m_mutableStyle->removeProperties(propertiesToRemove.span());
}

void EditingStyle::forceInline()
Expand Down

0 comments on commit 4ff86d0

Please sign in to comment.