Bug 1444481 part 3: #include nsStringFwd.h rather than nsString.h in some layout/style headers. r?xidorn draft
authorDaniel Holbert <dholbert@cs.stanford.edu>
Fri, 09 Mar 2018 11:55:12 -0800
changeset 765456 2e7851de17952e3000a84013875e00506c602031
parent 765452 d9f1ca240dc8b95c26c3d560bc64041829da53ec
push id102078
push userdholbert@mozilla.com
push dateFri, 09 Mar 2018 19:55:20 +0000
reviewersxidorn
bugs1444481
milestone60.0a1
Bug 1444481 part 3: #include nsStringFwd.h rather than nsString.h in some layout/style headers. r?xidorn These files only use references to string types, e.g. "nsAString&", so they only need forward-declarations of these types -- not the full definition. Note that the last file here (nsStyleUtil.h) already has an #include for nsStringFwd.h, which is why that files change is just a pure removal (of the unnecessary nsString.h #include). MozReview-Commit-ID: 9sLSyeBS49M
layout/style/CSSStyleSheet.h
layout/style/ServoCSSParser.h
layout/style/nsCSSProps.h
layout/style/nsICSSDeclaration.h
layout/style/nsStyleUtil.h
--- a/layout/style/CSSStyleSheet.h
+++ b/layout/style/CSSStyleSheet.h
@@ -15,17 +15,17 @@
 #include "mozilla/StyleSheet.h"
 #include "mozilla/StyleSheetInfo.h"
 #include "mozilla/css/SheetParsingMode.h"
 
 #include "nscore.h"
 #include "nsCOMPtr.h"
 #include "nsAutoPtr.h"
 #include "nsTArrayForwardDeclare.h"
-#include "nsString.h"
+#include "nsStringFwd.h"
 #include "mozilla/CORSMode.h"
 #include "nsCycleCollectionParticipant.h"
 #include "mozilla/net/ReferrerPolicy.h"
 #include "mozilla/dom/SRIMetadata.h"
 
 class CSSRuleListImpl;
 class nsCSSRuleProcessor;
 class nsIURI;
--- a/layout/style/ServoCSSParser.h
+++ b/layout/style/ServoCSSParser.h
@@ -10,17 +10,17 @@
 #define mozilla_ServoCSSParser_h
 
 #include "mozilla/gfx/Types.h"
 #include "mozilla/RefPtr.h"
 #include "mozilla/ServoTypes.h"
 #include "nsColor.h"
 #include "nsCSSPropertyID.h"
 #include "nsDOMCSSDeclaration.h"
-#include "nsString.h"
+#include "nsStringFwd.h"
 
 class nsCSSValue;
 class nsIDocument;
 struct nsCSSRect;
 struct nsTimingFunction;
 struct RawServoDeclarationBlock;
 
 using RawGeckoGfxMatrix4x4 = mozilla::gfx::Float[16];
--- a/layout/style/nsCSSProps.h
+++ b/layout/style/nsCSSProps.h
@@ -9,17 +9,17 @@
  * values they accept
  */
 
 #ifndef nsCSSProps_h___
 #define nsCSSProps_h___
 
 #include <limits>
 #include <type_traits>
-#include "nsString.h"
+#include "nsStringFwd.h"
 #include "nsCSSPropertyID.h"
 #include "nsStyleStructFwd.h"
 #include "nsCSSKeywords.h"
 #include "mozilla/CSSEnabledState.h"
 #include "mozilla/UseCounter.h"
 #include "mozilla/EnumTypeTraits.h"
 #include "mozilla/Preferences.h"
 #include "nsXULAppAPI.h"
--- a/layout/style/nsICSSDeclaration.h
+++ b/layout/style/nsICSSDeclaration.h
@@ -17,17 +17,17 @@
  * CSSStyleDeclaration; the difference is that these use nsCSSPropertyID
  * enums for the prop names instead of using strings.
  */
 
 #include "mozilla/Attributes.h"
 #include "nsCSSPropertyID.h"
 #include "mozilla/dom/CSSValue.h"
 #include "nsWrapperCache.h"
-#include "nsString.h"
+#include "nsStringFwd.h"
 #include "mozilla/ErrorResult.h"
 #include "nsCOMPtr.h"
 
 class nsINode;
 class nsIPrincipal;
 namespace mozilla {
 namespace css {
 class Rule;
--- a/layout/style/nsStyleUtil.h
+++ b/layout/style/nsStyleUtil.h
@@ -3,17 +3,16 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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 nsStyleUtil_h___
 #define nsStyleUtil_h___
 
 #include "nsCoord.h"
 #include "nsCSSPropertyID.h"
-#include "nsString.h"
 #include "nsTArrayForwardDeclare.h"
 #include "gfxFontFamilyList.h"
 #include "nsStringFwd.h"
 #include "nsStyleStruct.h"
 #include "nsCRT.h"
 
 class nsCSSValue;
 class nsStyleCoord;