tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit 358f49ab8a4afdb0417b74a1e340f1ca44317413
parent f6e3ccb5853c46f917578697a488d48c3bc09ac8
Author: Jan Varga <jan.varga@gmail.com>
Date:   Thu, 27 Nov 2025 07:07:07 +0000

Bug 1990419 - Rename CSSStyleValue::ValueType entries to use explicit *Value suffix; r=emilio,firefox-style-system-reviewers

Rename the CSSStyleValue::ValueType enum entries to include the *Value suffix
(e.g. KeywordValue instead of Keyword) for consistency with class names like
CSSKeywordValue and CSSUnsupportedValue.

This makes the naming more explicit and avoids ambiguity with future types
such as CSSMathSum.

Differential Revision: https://phabricator.services.mozilla.com/D270143

Diffstat:
Mlayout/style/typedom/CSSKeywordValue.cpp | 5+++--
Mlayout/style/typedom/CSSStyleValue.cpp | 4++--
Mlayout/style/typedom/CSSStyleValue.h | 2+-
Mlayout/style/typedom/CSSUnsupportedValue.cpp | 4++--
Mlayout/style/typedom/StylePropertyMap.cpp | 4++--
5 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/layout/style/typedom/CSSKeywordValue.cpp b/layout/style/typedom/CSSKeywordValue.cpp @@ -16,7 +16,8 @@ namespace mozilla::dom { CSSKeywordValue::CSSKeywordValue(nsCOMPtr<nsISupports> aParent, const nsACString& aValue) - : CSSStyleValue(std::move(aParent), ValueType::Keyword), mValue(aValue) {} + : CSSStyleValue(std::move(aParent), ValueType::KeywordValue), + mValue(aValue) {} JSObject* CSSKeywordValue::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) { @@ -63,7 +64,7 @@ void CSSKeywordValue::ToCssTextWithProperty(const CSSPropertyId& aPropertyId, } CSSKeywordValue& CSSStyleValue::GetAsCSSKeywordValue() { - MOZ_DIAGNOSTIC_ASSERT(mValueType == ValueType::Keyword); + MOZ_DIAGNOSTIC_ASSERT(mValueType == ValueType::KeywordValue); return *static_cast<CSSKeywordValue*>(this); } diff --git a/layout/style/typedom/CSSStyleValue.cpp b/layout/style/typedom/CSSStyleValue.cpp @@ -64,11 +64,11 @@ void CSSStyleValue::Stringify(nsAString& aRetVal) const {} // end of CSSStyleValue Web IDL implementation bool CSSStyleValue::IsCSSUnsupportedValue() const { - return mValueType == ValueType::Unsupported; + return mValueType == ValueType::UnsupportedValue; } bool CSSStyleValue::IsCSSKeywordValue() const { - return mValueType == ValueType::Keyword; + return mValueType == ValueType::KeywordValue; } } // namespace mozilla::dom diff --git a/layout/style/typedom/CSSStyleValue.h b/layout/style/typedom/CSSStyleValue.h @@ -31,7 +31,7 @@ class CSSUnsupportedValue; class CSSStyleValue : public nsISupports, public nsWrapperCache { public: - enum class ValueType { Uninitialized, Unsupported, Keyword }; + enum class ValueType { Uninitialized, UnsupportedValue, KeywordValue }; explicit CSSStyleValue(nsCOMPtr<nsISupports> aParent); diff --git a/layout/style/typedom/CSSUnsupportedValue.cpp b/layout/style/typedom/CSSUnsupportedValue.cpp @@ -14,7 +14,7 @@ namespace mozilla::dom { CSSUnsupportedValue::CSSUnsupportedValue(nsCOMPtr<nsISupports> aParent, const CSSPropertyId& aPropertyId, RefPtr<DeclarationBlock> aDeclarations) - : CSSStyleValue(std::move(aParent), ValueType::Unsupported), + : CSSStyleValue(std::move(aParent), ValueType::UnsupportedValue), mPropertyId(aPropertyId), mDeclarations(std::move(aDeclarations)) {} @@ -34,7 +34,7 @@ void CSSUnsupportedValue::ToCssTextWithProperty( } CSSUnsupportedValue& CSSStyleValue::GetAsCSSUnsupportedValue() { - MOZ_DIAGNOSTIC_ASSERT(mValueType == ValueType::Unsupported); + MOZ_DIAGNOSTIC_ASSERT(mValueType == ValueType::UnsupportedValue); return *static_cast<CSSUnsupportedValue*>(this); } diff --git a/layout/style/typedom/StylePropertyMap.cpp b/layout/style/typedom/StylePropertyMap.cpp @@ -76,14 +76,14 @@ void StylePropertyMap::Set( nsAutoCString cssText; switch (styleValue.GetValueType()) { - case CSSStyleValue::ValueType::Keyword: { + case CSSStyleValue::ValueType::KeywordValue: { CSSKeywordValue& keywordValue = styleValue.GetAsCSSKeywordValue(); keywordValue.ToCssTextWithProperty(propertyId, cssText); break; } - case CSSStyleValue::ValueType::Unsupported: { + case CSSStyleValue::ValueType::UnsupportedValue: { CSSUnsupportedValue& unsupportedValue = styleValue.GetAsCSSUnsupportedValue();