diff --git a/layout/style/CSSNestingLowerer.cpp b/layout/style/CSSNestingFlattener.cpp similarity index 98% rename from layout/style/CSSNestingLowerer.cpp rename to layout/style/CSSNestingFlattener.cpp index 2dd45d58a9..ac8fc1a2ca 100644 --- a/layout/style/CSSNestingLowerer.cpp +++ b/layout/style/CSSNestingFlattener.cpp @@ -3,7 +3,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include "CSSNestingLowerer.h" +#include "CSSNestingFlattener.h" #include "mozilla/Assertions.h" #include "nsString.h" @@ -14,22 +14,22 @@ namespace css { namespace { -class CSSNestingLowerer final +class CSSNestingFlattener final { using SelectorList = nsTArray; public: - explicit CSSNestingLowerer(const nsAString& aInput) + explicit CSSNestingFlattener(const nsAString& aInput) : mInput(aInput) , mPos(0) , mSawNesting(false) { } - bool Lower(nsAString& aOutput) + bool Flatten(nsAString& aOutput) { - nsAutoString lowered; - if (!ProcessStylesheet(lowered, false)) { + nsAutoString flattened; + if (!ProcessStylesheet(flattened, false)) { return false; } @@ -38,7 +38,7 @@ public: return false; } - aOutput.Assign(lowered); + aOutput.Assign(flattened); return true; } @@ -952,10 +952,10 @@ private: } // namespace bool -LowerBasicCSSNesting(const nsAString& aInput, nsAString& aOutput) +FlattenBasicCSSNesting(const nsAString& aInput, nsAString& aOutput) { - CSSNestingLowerer lowerer(aInput); - return lowerer.Lower(aOutput); + CSSNestingFlattener flattener(aInput); + return flattener.Flatten(aOutput); } } // namespace css diff --git a/layout/style/CSSNestingLowerer.h b/layout/style/CSSNestingFlattener.h similarity index 69% rename from layout/style/CSSNestingLowerer.h rename to layout/style/CSSNestingFlattener.h index b74645186f..41a9d4432d 100644 --- a/layout/style/CSSNestingLowerer.h +++ b/layout/style/CSSNestingFlattener.h @@ -3,17 +3,17 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#ifndef CSSNestingLowerer_h -#define CSSNestingLowerer_h +#ifndef CSSNestingFlattener_h +#define CSSNestingFlattener_h class nsAString; namespace mozilla { namespace css { -bool LowerBasicCSSNesting(const nsAString& aInput, nsAString& aOutput); +bool FlattenBasicCSSNesting(const nsAString& aInput, nsAString& aOutput); } // namespace css } // namespace mozilla -#endif // CSSNestingLowerer_h +#endif // CSSNestingFlattener_h diff --git a/layout/style/moz.build b/layout/style/moz.build index e10c834daa..3dfbd58012 100644 --- a/layout/style/moz.build +++ b/layout/style/moz.build @@ -127,7 +127,7 @@ UNIFIED_SOURCES += [ 'CounterStyleManager.cpp', 'CSS.cpp', 'CSSLexer.cpp', - 'CSSNestingLowerer.cpp', + 'CSSNestingFlattener.cpp', 'CSSRuleList.cpp', 'CSSStyleSheet.cpp', 'CSSVariableDeclarations.cpp', diff --git a/layout/style/nsCSSParser.cpp b/layout/style/nsCSSParser.cpp index 6ca421a09b..6e24a427b0 100644 --- a/layout/style/nsCSSParser.cpp +++ b/layout/style/nsCSSParser.cpp @@ -18,7 +18,7 @@ #include // for std::regex and std::regex_match #include "nsCSSParser.h" -#include "CSSNestingLowerer.h" +#include "CSSNestingFlattener.h" #include "nsAlgorithm.h" #include "nsCSSProps.h" #include "nsCSSKeywords.h" @@ -1826,11 +1826,11 @@ CSSParserImpl::ParseSheet(const nsAString& aInput, "Sheet principal does not match passed principal"); #endif - nsAutoString loweredInput; + nsAutoString flattenedInput; const nsAString* input = &aInput; if (sNestingEnabled && - mozilla::css::LowerBasicCSSNesting(aInput, loweredInput)) { - input = &loweredInput; + mozilla::css::FlattenBasicCSSNesting(aInput, flattenedInput)) { + input = &flattenedInput; } nsCSSScanner scanner(*input, aLineNumber);