diff options
author | Moonchild <moonchild@palemoon.org> | 2020-04-30 16:41:13 +0000 |
---|---|---|
committer | Moonchild <moonchild@palemoon.org> | 2020-04-30 16:41:13 +0000 |
commit | ae707c8dbb26942e11c231965afc3505ba2f7d93 (patch) | |
tree | 92cd2f822be4867ee9ecc0dc9312b55367655f0a | |
parent | a78a87502d9973893d2d19daa17e75bc1a1043ca (diff) | |
download | UXP-ae707c8dbb26942e11c231965afc3505ba2f7d93.tar UXP-ae707c8dbb26942e11c231965afc3505ba2f7d93.tar.gz UXP-ae707c8dbb26942e11c231965afc3505ba2f7d93.tar.lz UXP-ae707c8dbb26942e11c231965afc3505ba2f7d93.tar.xz UXP-ae707c8dbb26942e11c231965afc3505ba2f7d93.zip |
Issue #80 - De-unify layout/style
-rw-r--r-- | layout/style/CSSLexer.h | 1 | ||||
-rw-r--r-- | layout/style/CSSStyleSheet.cpp | 1 | ||||
-rw-r--r-- | layout/style/DocumentStyleRootIterator.h | 1 | ||||
-rw-r--r-- | layout/style/RuleProcessorCache.cpp | 1 | ||||
-rw-r--r-- | layout/style/ServoStyleSet.cpp | 1 | ||||
-rw-r--r-- | layout/style/ServoStyleSheet.cpp | 4 | ||||
-rw-r--r-- | layout/style/StyleRule.cpp | 1 | ||||
-rw-r--r-- | layout/style/StyleSheet.cpp | 3 | ||||
-rw-r--r-- | layout/style/moz.build | 12 | ||||
-rw-r--r-- | layout/style/nsCSSProps.h | 4 | ||||
-rw-r--r-- | layout/style/nsCSSPseudoClassList.h | 2 | ||||
-rw-r--r-- | layout/style/nsCSSPseudoClasses.cpp | 1 | ||||
-rw-r--r-- | layout/style/nsCSSPseudoClasses.h | 2 | ||||
-rw-r--r-- | layout/style/nsCSSRules.h | 1 | ||||
-rw-r--r-- | layout/style/nsCSSValue.cpp | 7 | ||||
-rw-r--r-- | layout/style/nsComputedDOMStyle.cpp | 2 | ||||
-rw-r--r-- | layout/style/nsDOMCSSAttrDeclaration.cpp | 5 | ||||
-rw-r--r-- | layout/style/nsMediaFeatures.cpp | 1 | ||||
-rw-r--r-- | layout/style/nsStyleContext.cpp | 3 | ||||
-rw-r--r-- | layout/style/nsStyleStruct.cpp | 1 |
20 files changed, 39 insertions, 15 deletions
diff --git a/layout/style/CSSLexer.h b/layout/style/CSSLexer.h index 8b41d2778..4eff7a528 100644 --- a/layout/style/CSSLexer.h +++ b/layout/style/CSSLexer.h @@ -9,6 +9,7 @@ #include "mozilla/UniquePtr.h" #include "nsCSSScanner.h" #include "mozilla/dom/CSSLexerBinding.h" +#include "mozilla/dom/NonRefcountedDOMObject.h" namespace mozilla { namespace dom { diff --git a/layout/style/CSSStyleSheet.cpp b/layout/style/CSSStyleSheet.cpp index 43d47100d..40a4ee4d8 100644 --- a/layout/style/CSSStyleSheet.cpp +++ b/layout/style/CSSStyleSheet.cpp @@ -47,6 +47,7 @@ #include "mozilla/RuleProcessorCache.h" #include "nsIStyleSheetLinkingElement.h" #include "nsDOMWindowUtils.h" +#include "nsStyleSet.h" using namespace mozilla; using namespace mozilla::dom; diff --git a/layout/style/DocumentStyleRootIterator.h b/layout/style/DocumentStyleRootIterator.h index 7dcdc7fa1..98d9fd32f 100644 --- a/layout/style/DocumentStyleRootIterator.h +++ b/layout/style/DocumentStyleRootIterator.h @@ -8,6 +8,7 @@ #define DocumentStyleRootIterator_h #include "nsTArray.h" +#include "mozilla/dom/Element.h" class nsIContent; class nsIDocument; diff --git a/layout/style/RuleProcessorCache.cpp b/layout/style/RuleProcessorCache.cpp index 23832c230..e2e788c56 100644 --- a/layout/style/RuleProcessorCache.cpp +++ b/layout/style/RuleProcessorCache.cpp @@ -13,6 +13,7 @@ #include <algorithm> #include "nsCSSRuleProcessor.h" #include "nsThreadUtils.h" +#include "CSSStyleSheet.h" using namespace mozilla; diff --git a/layout/style/ServoStyleSet.cpp b/layout/style/ServoStyleSet.cpp index 331e2322a..38e02e66d 100644 --- a/layout/style/ServoStyleSet.cpp +++ b/layout/style/ServoStyleSet.cpp @@ -6,6 +6,7 @@ #include "mozilla/ServoStyleSet.h" +#include "ServoBindings.h" #include "mozilla/ServoRestyleManager.h" #include "mozilla/dom/ChildIterator.h" #include "nsCSSAnonBoxes.h" diff --git a/layout/style/ServoStyleSheet.cpp b/layout/style/ServoStyleSheet.cpp index 5f2a925b5..e03ad2865 100644 --- a/layout/style/ServoStyleSheet.cpp +++ b/layout/style/ServoStyleSheet.cpp @@ -4,8 +4,12 @@ * 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 "ServoBindings.h" #include "mozilla/ServoStyleSheet.h" #include "mozilla/StyleBackendType.h" +#include "CSSRuleList.h" + +using namespace mozilla::dom; namespace mozilla { diff --git a/layout/style/StyleRule.cpp b/layout/style/StyleRule.cpp index aca97a505..8fde72534 100644 --- a/layout/style/StyleRule.cpp +++ b/layout/style/StyleRule.cpp @@ -36,6 +36,7 @@ class nsIDOMCSSStyleDeclaration; class nsIDOMCSSStyleSheet; using namespace mozilla; +using namespace mozilla::dom; #define NS_IF_CLONE(member_) \ PR_BEGIN_MACRO \ diff --git a/layout/style/StyleSheet.cpp b/layout/style/StyleSheet.cpp index f125cf97e..d4bc94186 100644 --- a/layout/style/StyleSheet.cpp +++ b/layout/style/StyleSheet.cpp @@ -6,6 +6,7 @@ #include "mozilla/StyleSheet.h" +#include "mozilla/dom/BindingDeclarations.h" // for Optional<> #include "mozilla/dom/CSSRuleList.h" #include "mozilla/dom/ShadowRoot.h" #include "mozilla/ServoStyleSheet.h" @@ -16,6 +17,8 @@ #include "nsIMediaList.h" #include "nsNullPrincipal.h" +using namespace mozilla::dom; + namespace mozilla { StyleSheet::StyleSheet(StyleBackendType aType, css::SheetParsingMode aParsingMode) diff --git a/layout/style/moz.build b/layout/style/moz.build index 40b9fd659..74caf94df 100644 --- a/layout/style/moz.build +++ b/layout/style/moz.build @@ -140,7 +140,7 @@ EXPORTS.mozilla.css += [ 'StyleRule.h', ] -UNIFIED_SOURCES += [ +SOURCES += [ 'AnimationCollection.cpp', 'AnimationCommon.cpp', 'CounterStyleManager.cpp', @@ -171,6 +171,7 @@ UNIFIED_SOURCES += [ 'nsCSSProps.cpp', 'nsCSSPseudoClasses.cpp', 'nsCSSPseudoElements.cpp', + 'nsCSSRuleProcessor.cpp', 'nsCSSRules.cpp', 'nsCSSScanner.cpp', 'nsCSSValue.cpp', @@ -183,6 +184,7 @@ UNIFIED_SOURCES += [ 'nsFontFaceUtils.cpp', 'nsHTMLCSSStyleSheet.cpp', 'nsHTMLStyleSheet.cpp', + 'nsLayoutStylesheetCache.cpp', 'nsMediaFeatures.cpp', 'nsNthIndexCache.cpp', 'nsROCSSPrimitiveValue.cpp', @@ -208,14 +210,6 @@ UNIFIED_SOURCES += [ 'SVGAttrAnimationRuleProcessor.cpp', ] -# nsCSSRuleProcessor.cpp needs to be built separately because it uses plarena.h. -# nsLayoutStylesheetCache.cpp needs to be built separately because it uses -# nsExceptionHandler.h, which includes windows.h. -SOURCES += [ - 'nsCSSRuleProcessor.cpp', - 'nsLayoutStylesheetCache.cpp', -] - EXTRA_COMPONENTS += [ 'CSSUnprefixingService.js', 'CSSUnprefixingService.manifest', diff --git a/layout/style/nsCSSProps.h b/layout/style/nsCSSProps.h index e67e1d41d..aabbac07a 100644 --- a/layout/style/nsCSSProps.h +++ b/layout/style/nsCSSProps.h @@ -345,7 +345,7 @@ public: // KTableEntry objects can be initialized either with an int16_t value // or a value of an enumeration type that can fit within an int16_t. - constexpr KTableEntry(nsCSSKeyword aKeyword, int16_t aValue) + KTableEntry(nsCSSKeyword aKeyword, int16_t aValue) : mKeyword(aKeyword) , mValue(aValue) { @@ -353,7 +353,7 @@ public: template<typename T, typename = typename std::enable_if<std::is_enum<T>::value>::type> - constexpr KTableEntry(nsCSSKeyword aKeyword, T aValue) + KTableEntry(nsCSSKeyword aKeyword, T aValue) : mKeyword(aKeyword) , mValue(static_cast<int16_t>(aValue)) { diff --git a/layout/style/nsCSSPseudoClassList.h b/layout/style/nsCSSPseudoClassList.h index 12f43af5b..7f620ec32 100644 --- a/layout/style/nsCSSPseudoClassList.h +++ b/layout/style/nsCSSPseudoClassList.h @@ -38,6 +38,8 @@ * automatically defined to CSS_PSEUDO_CLASS. */ +#include "nsCSSPseudoElements.h" + // OUTPUT_CLASS=nsCSSPseudoClasses // MACRO_NAME=CSS_PSEUDO_CLASS diff --git a/layout/style/nsCSSPseudoClasses.cpp b/layout/style/nsCSSPseudoClasses.cpp index 9b26459dd..a174525b1 100644 --- a/layout/style/nsCSSPseudoClasses.cpp +++ b/layout/style/nsCSSPseudoClasses.cpp @@ -13,6 +13,7 @@ #include "nsString.h" using namespace mozilla; +using namespace mozilla::css; // define storage for all atoms #define CSS_PSEUDO_CLASS(_name, _value, _flags, _pref) \ diff --git a/layout/style/nsCSSPseudoClasses.h b/layout/style/nsCSSPseudoClasses.h index ca1cb2f39..55e5bf9d2 100644 --- a/layout/style/nsCSSPseudoClasses.h +++ b/layout/style/nsCSSPseudoClasses.h @@ -9,6 +9,8 @@ #define nsCSSPseudoClasses_h___ #include "nsStringFwd.h" +#include "mozilla/CSSEnabledState.h" +#include "nsStyleStruct.h" // The following two flags along with the pref defines where this pseudo // class can be used: diff --git a/layout/style/nsCSSRules.h b/layout/style/nsCSSRules.h index 1bd468cb6..1c6361c3e 100644 --- a/layout/style/nsCSSRules.h +++ b/layout/style/nsCSSRules.h @@ -41,7 +41,6 @@ namespace mozilla { namespace dom { class DocGroup; -class DocGroup; } // namespace dom class ErrorResult; diff --git a/layout/style/nsCSSValue.cpp b/layout/style/nsCSSValue.cpp index baf5b7897..0a905a055 100644 --- a/layout/style/nsCSSValue.cpp +++ b/layout/style/nsCSSValue.cpp @@ -6,11 +6,12 @@ /* representation of simple property values within CSS declarations */ +#include "mozilla/ArrayUtils.h" + #include "nsCSSValue.h" #include "mozilla/StyleSheetInlines.h" #include "mozilla/Likely.h" -#include "mozilla/MemoryReporting.h" #include "mozilla/Move.h" #include "mozilla/css/ImageLoader.h" #include "CSSCalc.h" @@ -18,8 +19,6 @@ #include "imgIRequest.h" #include "imgRequestProxy.h" #include "nsIDocument.h" -#include "nsIPrincipal.h" -#include "nsCSSProps.h" #include "nsNetUtil.h" #include "nsPresContext.h" #include "nsStyleUtil.h" @@ -27,7 +26,9 @@ #include "nsStyleSet.h" #include "nsContentUtils.h" + using namespace mozilla; +using namespace mozilla::css; static bool IsLocalRefURL(nsStringBuffer* aString) diff --git a/layout/style/nsComputedDOMStyle.cpp b/layout/style/nsComputedDOMStyle.cpp index 20e5651bd..1032be651 100644 --- a/layout/style/nsComputedDOMStyle.cpp +++ b/layout/style/nsComputedDOMStyle.cpp @@ -54,6 +54,8 @@ using namespace mozilla; using namespace mozilla::dom; +typedef nsCSSProps::KTableEntry KTableEntry; + #if defined(DEBUG_bzbarsky) || defined(DEBUG_caillon) #define DEBUG_ComputedDOMStyle #endif diff --git a/layout/style/nsDOMCSSAttrDeclaration.cpp b/layout/style/nsDOMCSSAttrDeclaration.cpp index 7b659a8cc..652bd4ad1 100644 --- a/layout/style/nsDOMCSSAttrDeclaration.cpp +++ b/layout/style/nsDOMCSSAttrDeclaration.cpp @@ -10,6 +10,7 @@ #include "mozilla/css/Declaration.h" #include "mozilla/css/StyleRule.h" #include "mozilla/dom/Element.h" +#include "mozilla/dom/DocGroup.h" #include "nsIDocument.h" #include "nsIDOMMutationEvent.h" #include "nsIURI.h" @@ -17,8 +18,12 @@ #include "nsWrapperCacheInlines.h" #include "nsIFrame.h" #include "ActiveLayerTracker.h" +#include "ServoDeclarationBlock.h" +#include "StyleSetHandle.h" +#include "DeclarationBlockInlines.h" using namespace mozilla; +using namespace mozilla::dom; nsDOMCSSAttributeDeclaration::nsDOMCSSAttributeDeclaration(dom::Element* aElement, bool aIsSMILOverride) diff --git a/layout/style/nsMediaFeatures.cpp b/layout/style/nsMediaFeatures.cpp index 854236e51..f33f8dd33 100644 --- a/layout/style/nsMediaFeatures.cpp +++ b/layout/style/nsMediaFeatures.cpp @@ -19,6 +19,7 @@ #include "nsDeviceContext.h" #include "nsIBaseWindow.h" #include "nsIDocument.h" +#include "nsIWidget.h" #include "nsContentUtils.h" #include "mozilla/StyleSheet.h" #include "mozilla/StyleSheetInlines.h" diff --git a/layout/style/nsStyleContext.cpp b/layout/style/nsStyleContext.cpp index 7ad260f1b..4b1a14897 100644 --- a/layout/style/nsStyleContext.cpp +++ b/layout/style/nsStyleContext.cpp @@ -12,6 +12,8 @@ #include "nsCSSAnonBoxes.h" #include "nsCSSPseudoElements.h" #include "nsStyleConsts.h" +#include "nsStyleStruct.h" +#include "nsStyleStructInlines.h" #include "nsString.h" #include "nsPresContext.h" #include "nsIStyleRule.h" @@ -35,6 +37,7 @@ #include "mozilla/ReflowInput.h" #include "nsLayoutUtils.h" #include "nsCoord.h" +#include "nsFontMetrics.h" // Ensure the binding function declarations in nsStyleContext.h matches // those in ServoBindings.h. diff --git a/layout/style/nsStyleStruct.cpp b/layout/style/nsStyleStruct.cpp index 72c103724..200f934c5 100644 --- a/layout/style/nsStyleStruct.cpp +++ b/layout/style/nsStyleStruct.cpp @@ -40,6 +40,7 @@ #include <algorithm> using namespace mozilla; +using namespace mozilla::dom; static_assert((((1 << nsStyleStructID_Length) - 1) & ~(NS_STYLE_INHERIT_MASK)) == 0, |