Bug 1610064 - Avoid including StyleSheet.h from Document.h. r=nordzilla,firefox-style-system-reviewers

This in turn requires fixing various other include hell / missing include
issues.

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Emilio Cobos Álvarez 2020-01-21 20:31:05 +00:00
parent 76ce9d96fa
commit 8a7906f381
6 changed files with 16 additions and 7 deletions

View File

@ -41,6 +41,7 @@
#include "nsStubMutationObserver.h" #include "nsStubMutationObserver.h"
#include "nsTHashtable.h" // for member #include "nsTHashtable.h" // for member
#include "nsURIHashKey.h" #include "nsURIHashKey.h"
#include "mozilla/ServoBindingTypes.h"
#include "mozilla/UseCounter.h" #include "mozilla/UseCounter.h"
#include "mozilla/WeakPtr.h" #include "mozilla/WeakPtr.h"
#include "Units.h" #include "Units.h"
@ -59,7 +60,6 @@
#include "mozilla/LinkedList.h" #include "mozilla/LinkedList.h"
#include "mozilla/NotNull.h" #include "mozilla/NotNull.h"
#include "mozilla/SegmentedVector.h" #include "mozilla/SegmentedVector.h"
#include "mozilla/StyleSheet.h"
#include "mozilla/TimeStamp.h" #include "mozilla/TimeStamp.h"
#include "mozilla/UniquePtr.h" #include "mozilla/UniquePtr.h"
#include "mozilla/dom/FailedCertSecurityInfoBinding.h" #include "mozilla/dom/FailedCertSecurityInfoBinding.h"
@ -133,10 +133,11 @@ class nsXULPrototypeElement;
class PermissionDelegateHandler; class PermissionDelegateHandler;
class nsIPermissionDelegateHandler; class nsIPermissionDelegateHandler;
struct nsFont; struct nsFont;
struct StyleUseCounters;
namespace mozilla { namespace mozilla {
class AbstractThread; class AbstractThread;
class CSSStyleSheet; class StyleSheet;
class EditorCommand; class EditorCommand;
class Encoding; class Encoding;
class ErrorResult; class ErrorResult;
@ -144,9 +145,11 @@ class EventStates;
class EventListenerManager; class EventListenerManager;
class FullscreenExit; class FullscreenExit;
class FullscreenRequest; class FullscreenRequest;
struct LangGroupFontPrefs;
class PendingAnimationTracker; class PendingAnimationTracker;
class PresShell; class PresShell;
class ServoStyleSet; class ServoStyleSet;
enum class StyleOrigin : uint8_t;
class SMILAnimationController; class SMILAnimationController;
enum class StyleCursorKind : uint8_t; enum class StyleCursorKind : uint8_t;
template <typename> template <typename>

View File

@ -654,6 +654,11 @@ nsRadioGroupStruct* DocumentOrShadowRoot::GetOrCreateRadioGroup(
.get(); .get();
} }
void DocumentOrShadowRoot::GetAdoptedStyleSheets(
nsTArray<RefPtr<StyleSheet>>& aAdoptedStyleSheets, ErrorResult& aRv) const {
aAdoptedStyleSheets = mAdoptedStyleSheets;
}
void DocumentOrShadowRoot::Traverse(DocumentOrShadowRoot* tmp, void DocumentOrShadowRoot::Traverse(DocumentOrShadowRoot* tmp,
nsCycleCollectionTraversalCallback& cb) { nsCycleCollectionTraversalCallback& cb) {
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mStyleSheets) NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mStyleSheets)

View File

@ -29,11 +29,14 @@ namespace dom {
class Animation; class Animation;
class Element; class Element;
class Document;
class DocumentOrShadowRoot; class DocumentOrShadowRoot;
class HTMLInputElement; class HTMLInputElement;
struct nsRadioGroupStruct; struct nsRadioGroupStruct;
class StyleSheetList; class StyleSheetList;
class ShadowRoot; class ShadowRoot;
template <typename T>
class Sequence;
/** /**
* A class meant to be shared by ShadowRoot and Document, that holds a list of * A class meant to be shared by ShadowRoot and Document, that holds a list of
@ -77,9 +80,7 @@ class DocumentOrShadowRoot {
StyleSheetList* StyleSheets(); StyleSheetList* StyleSheets();
void GetAdoptedStyleSheets(nsTArray<RefPtr<StyleSheet>>& aAdoptedStyleSheets, void GetAdoptedStyleSheets(nsTArray<RefPtr<StyleSheet>>& aAdoptedStyleSheets,
ErrorResult& aRv) const { ErrorResult& aRv) const;
aAdoptedStyleSheets = mAdoptedStyleSheets;
}
void SetAdoptedStyleSheets( void SetAdoptedStyleSheets(
const Sequence<OwningNonNull<StyleSheet>>& aAdoptedStyleSheets, const Sequence<OwningNonNull<StyleSheet>>& aAdoptedStyleSheets,

View File

@ -10,7 +10,6 @@
#include "nsDataHashtable.h" #include "nsDataHashtable.h"
#include "nsHashKeys.h" #include "nsHashKeys.h"
#include "nsAtom.h" #include "nsAtom.h"
#include "mozilla/dom/Document.h"
#include "nsStringFwd.h" #include "nsStringFwd.h"
#include "nsTArray.h" #include "nsTArray.h"

View File

@ -54,6 +54,7 @@
#include "mozilla/Preferences.h" #include "mozilla/Preferences.h"
#include "mozilla/ResultExtensions.h" #include "mozilla/ResultExtensions.h"
#include "mozilla/ScriptPreloader.h" #include "mozilla/ScriptPreloader.h"
#include "mozilla/ScopeExit.h"
#include "mozilla/dom/ScriptSettings.h" #include "mozilla/dom/ScriptSettings.h"
#include "mozilla/ResultExtensions.h" #include "mozilla/ResultExtensions.h"
#include "mozilla/UniquePtrExtensions.h" #include "mozilla/UniquePtrExtensions.h"

View File

@ -7,13 +7,13 @@
#ifndef nsDigestAuth_h__ #ifndef nsDigestAuth_h__
#define nsDigestAuth_h__ #define nsDigestAuth_h__
#include "nsICryptoHash.h"
#include "nsIHttpAuthenticator.h" #include "nsIHttpAuthenticator.h"
#include "nsStringFwd.h" #include "nsStringFwd.h"
#include "nsCOMPtr.h" #include "nsCOMPtr.h"
#include "mozilla/Attributes.h" #include "mozilla/Attributes.h"
#include "mozilla/StaticPtr.h" #include "mozilla/StaticPtr.h"
class nsICryptoHash;
namespace mozilla { namespace mozilla {
namespace net { namespace net {