зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1540015 - part 1: Make Document.h stop including nsIPresShell.h r=smaug
If `Document::GetShell()` returns `PresShell*` rather than `nsIPresShell`, it's a good step to deCOMTaminate `PresShell`. This patch makes `Document.h` stop including `nsIPresShell.h` since `nsIPresShell.h` includes `Document.h` indirectly and that causes bustage when we make `Document::GetShell()` return `PresShell*`. Differential Revision: https://phabricator.services.mozilla.com/D25332 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
2efaefdfc3
Коммит
854606257b
|
@ -9,6 +9,7 @@
|
|||
#include "mozilla/dom/AnimationBinding.h"
|
||||
#include "mozilla/dom/AnimationPlaybackEvent.h"
|
||||
#include "mozilla/dom/Document.h"
|
||||
#include "mozilla/dom/DocumentInlines.h"
|
||||
#include "mozilla/dom/DocumentTimeline.h"
|
||||
#include "mozilla/AnimationEventDispatcher.h"
|
||||
#include "mozilla/AnimationTarget.h"
|
||||
|
|
|
@ -19,6 +19,7 @@ struct JSContext;
|
|||
|
||||
namespace mozilla {
|
||||
|
||||
enum class PseudoStyleType : uint8_t;
|
||||
class ComputedTimingFunction;
|
||||
class EffectSet;
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
#ifndef mozilla_dom_Document_h___
|
||||
#define mozilla_dom_Document_h___
|
||||
|
||||
#include "mozilla/EventStates.h" // for EventStates
|
||||
#include "mozilla/FlushType.h" // for enum
|
||||
#include "mozilla/Pair.h" // for Pair
|
||||
#include "nsAutoPtr.h" // for member
|
||||
|
@ -23,7 +24,6 @@
|
|||
#include "nsILoadGroup.h" // for member (in nsCOMPtr)
|
||||
#include "nsINode.h" // for base class
|
||||
#include "nsIParser.h"
|
||||
#include "nsIPresShell.h"
|
||||
#include "nsIChannelEventSink.h"
|
||||
#include "nsIProgressEventSink.h"
|
||||
#include "nsIRadioGroupContainer.h"
|
||||
|
@ -107,6 +107,7 @@ class nsILayoutHistoryState;
|
|||
class nsILoadContext;
|
||||
class nsIObjectLoadingContent;
|
||||
class nsIObserver;
|
||||
class nsIPresShell;
|
||||
class nsIPrincipal;
|
||||
class nsIRequest;
|
||||
class nsIRunnable;
|
||||
|
@ -1252,18 +1253,12 @@ class Document : public nsINode,
|
|||
return GetBFCacheEntry() ? nullptr : mPresShell;
|
||||
}
|
||||
|
||||
nsIPresShell* GetObservingShell() const {
|
||||
return mPresShell && mPresShell->IsObservingDocument() ? mPresShell
|
||||
: nullptr;
|
||||
}
|
||||
inline nsIPresShell* GetObservingShell() const;
|
||||
|
||||
// Return whether the presshell for this document is safe to flush.
|
||||
bool IsSafeToFlush() const;
|
||||
|
||||
nsPresContext* GetPresContext() const {
|
||||
nsIPresShell* shell = GetShell();
|
||||
return shell ? shell->GetPresContext() : nullptr;
|
||||
}
|
||||
inline nsPresContext* GetPresContext() const;
|
||||
|
||||
bool HasShellOrBFCacheEntry() const { return mPresShell || mBFCacheEntry; }
|
||||
|
||||
|
|
|
@ -6,14 +6,26 @@
|
|||
#ifndef mozilla_dom_DocumentInlines_h
|
||||
#define mozilla_dom_DocumentInlines_h
|
||||
|
||||
#include "nsContentUtils.h"
|
||||
#include "mozilla/dom/Document.h"
|
||||
|
||||
#include "mozilla/dom/HTMLBodyElement.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsIPresShell.h"
|
||||
#include "nsPresContext.h"
|
||||
#include "nsStyleSheetService.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
||||
inline nsIPresShell* Document::GetObservingShell() const {
|
||||
return mPresShell && mPresShell->IsObservingDocument() ? mPresShell : nullptr;
|
||||
}
|
||||
|
||||
inline nsPresContext* Document::GetPresContext() const {
|
||||
nsIPresShell* presShell = GetShell();
|
||||
return presShell ? presShell->GetPresContext() : nullptr;
|
||||
}
|
||||
|
||||
inline HTMLBodyElement* Document::GetBodyElement() {
|
||||
return static_cast<HTMLBodyElement*>(GetHtmlChildElement(nsGkAtoms::body));
|
||||
}
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
#include "nsCOMPtr.h"
|
||||
#include "nsEscape.h"
|
||||
#include "nsIDOMWindow.h"
|
||||
#include "mozilla/dom/Document.h"
|
||||
#include "nsIPresShell.h"
|
||||
#include "nsPresContext.h"
|
||||
#include "nsError.h"
|
||||
|
@ -33,6 +32,8 @@
|
|||
#include "mozilla/Components.h"
|
||||
#include "mozilla/NullPrincipal.h"
|
||||
#include "mozilla/Unused.h"
|
||||
#include "mozilla/dom/Document.h"
|
||||
#include "mozilla/dom/DocumentInlines.h"
|
||||
#include "mozilla/dom/LocationBinding.h"
|
||||
#include "mozilla/dom/ScriptSettings.h"
|
||||
#include "ReferrerInfo.h"
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
#include "MessageEvent.h"
|
||||
#include "mozilla/dom/BlobBinding.h"
|
||||
#include "mozilla/dom/DocumentInlines.h"
|
||||
#include "mozilla/dom/File.h"
|
||||
#include "mozilla/dom/FileList.h"
|
||||
#include "mozilla/dom/FileListBinding.h"
|
||||
|
|
|
@ -50,6 +50,7 @@
|
|||
#include "mozilla/dom/ContentChild.h"
|
||||
#include "mozilla/dom/CustomElementRegistry.h"
|
||||
#include "mozilla/dom/Document.h"
|
||||
#include "mozilla/dom/DocumentInlines.h"
|
||||
#include "mozilla/dom/MessageBroadcaster.h"
|
||||
#include "mozilla/dom/DocumentFragment.h"
|
||||
#include "mozilla/dom/DOMException.h"
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
#include "mozilla/dom/Animation.h"
|
||||
#include "mozilla/dom/BindingDeclarations.h"
|
||||
#include "mozilla/dom/BlobBinding.h"
|
||||
#include "mozilla/dom/DocumentInlines.h"
|
||||
#include "mozilla/dom/Event.h"
|
||||
#include "mozilla/dom/Touch.h"
|
||||
#include "mozilla/PendingAnimationTracker.h"
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
#include "nsDOMNavigationTiming.h"
|
||||
#include "nsIDOMStorageManager.h"
|
||||
#include "mozilla/dom/ContentFrameMessageManager.h"
|
||||
#include "mozilla/dom/DocumentInlines.h"
|
||||
#include "mozilla/dom/DOMJSProxyHandler.h"
|
||||
#include "mozilla/dom/DOMPrefs.h"
|
||||
#include "mozilla/dom/EventTarget.h"
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
#include "nsCOMPtr.h"
|
||||
#include "nsPIDOMWindow.h"
|
||||
#include "mozilla/dom/Document.h"
|
||||
#include "mozilla/dom/DocumentInlines.h"
|
||||
#include "nsIPresShell.h"
|
||||
#include "nsPresContext.h"
|
||||
#include "nsIDocShell.h"
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
#include "nsIContent.h"
|
||||
#include "nsIContentInlines.h"
|
||||
#include "mozilla/dom/Document.h"
|
||||
#include "mozilla/dom/DocumentInlines.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
#include "nsIMutationObserver.h"
|
||||
#include "mozilla/EventListenerManager.h"
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
#include "BrowserElementParent.h"
|
||||
#include "mozilla/EventDispatcher.h"
|
||||
#include "mozilla/dom/DocumentInlines.h"
|
||||
#include "mozilla/dom/HTMLIFrameElement.h"
|
||||
#include "mozilla/dom/ToJSValue.h"
|
||||
#include "mozilla/dom/WindowProxyHolder.h"
|
||||
|
|
|
@ -7,8 +7,6 @@
|
|||
#include "AccessCheck.h"
|
||||
#include "base/basictypes.h"
|
||||
#include "ipc/IPCMessageUtils.h"
|
||||
#include "mozilla/dom/Event.h"
|
||||
#include "mozilla/dom/ShadowRoot.h"
|
||||
#include "mozilla/EventDispatcher.h"
|
||||
#include "mozilla/ContentEvents.h"
|
||||
#include "mozilla/DOMEventTargetHelper.h"
|
||||
|
@ -21,6 +19,10 @@
|
|||
#include "mozilla/Preferences.h"
|
||||
#include "mozilla/TextEvents.h"
|
||||
#include "mozilla/TouchEvents.h"
|
||||
#include "mozilla/dom/Document.h"
|
||||
#include "mozilla/dom/DocumentInlines.h"
|
||||
#include "mozilla/dom/Event.h"
|
||||
#include "mozilla/dom/ShadowRoot.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsDeviceContext.h"
|
||||
|
@ -29,7 +31,6 @@
|
|||
#include "nsIFrame.h"
|
||||
#include "nsIContent.h"
|
||||
#include "nsIContentInlines.h"
|
||||
#include "mozilla/dom/Document.h"
|
||||
#include "nsIPresShell.h"
|
||||
#include "nsIScrollableFrame.h"
|
||||
#include "nsJSEnvironment.h"
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
#include "mozilla/EventStates.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "mozilla/dom/DocumentInlines.h"
|
||||
#include "mozilla/dom/HTMLLinkElementBinding.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
#include "mozilla/BasicEvents.h"
|
||||
#include "mozilla/EventDispatcher.h"
|
||||
#include "mozilla/dom/DocumentInlines.h"
|
||||
#include "mozilla/dom/HTMLMenuElementBinding.h"
|
||||
#include "mozilla/dom/HTMLMenuItemElement.h"
|
||||
#include "nsIMenuBuilder.h"
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#include "mozilla/dom/HTMLSourceElement.h"
|
||||
#include "mozilla/dom/HTMLSourceElementBinding.h"
|
||||
|
||||
#include "mozilla/dom/DocumentInlines.h"
|
||||
#include "mozilla/dom/HTMLImageElement.h"
|
||||
#include "mozilla/dom/HTMLMediaElement.h"
|
||||
#include "mozilla/dom/ResponsiveImageSelector.h"
|
||||
|
|
|
@ -52,6 +52,7 @@ using mozilla::DefaultXDisplay;
|
|||
#include "mozilla/MouseEvents.h"
|
||||
#include "mozilla/NullPrincipal.h"
|
||||
#include "mozilla/TextEvents.h"
|
||||
#include "mozilla/dom/DocumentInlines.h"
|
||||
#include "mozilla/dom/DragEvent.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
#include "mozilla/dom/Event.h"
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
#include "mozilla/AutoRestore.h"
|
||||
#include "mozilla/RestyleManager.h"
|
||||
#include "mozilla/SMILTimedElement.h"
|
||||
#include "mozilla/dom/DocumentInlines.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
#include "mozilla/dom/SVGAnimationElement.h"
|
||||
#include "nsContentUtils.h"
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
#include "mozilla/SMILTimeValue.h"
|
||||
#include "mozilla/SMILTimeValueSpec.h"
|
||||
#include "mozilla/TaskCategory.h"
|
||||
#include "mozilla/dom/DocumentInlines.h"
|
||||
#include "mozilla/dom/SVGAnimationElement.h"
|
||||
#include "nsAttrValueInlines.h"
|
||||
#include "nsGkAtoms.h"
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/EventDispatcher.h"
|
||||
#include "mozilla/EventStates.h"
|
||||
#include "mozilla/dom/DocumentInlines.h"
|
||||
#include "mozilla/dom/SVGAElementBinding.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsContentUtils.h"
|
||||
|
|
|
@ -8,8 +8,9 @@
|
|||
#include "nsCOMPtr.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "mozilla/EventDispatcher.h"
|
||||
#include "nsXULElement.h"
|
||||
#include "mozilla/Logging.h"
|
||||
#include "mozilla/dom/DocumentInlines.h"
|
||||
#include "nsXULElement.h"
|
||||
|
||||
struct BroadcastListener {
|
||||
nsWeakPtr mListener;
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
#include "nsIPresShell.h"
|
||||
#include "nsPresContext.h"
|
||||
#include "mozilla/EventStateManager.h"
|
||||
#include "mozilla/dom/DocumentInlines.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
|
||||
using namespace mozilla;
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
#include "nsPresContext.h"
|
||||
#include "mozilla/EventStates.h"
|
||||
#include "mozilla/dom/Document.h"
|
||||
#include "mozilla/dom/DocumentInlines.h"
|
||||
#include "nsIPresShell.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsError.h"
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
#include "nsIBaseWindow.h"
|
||||
#include "nsIDocShell.h"
|
||||
#include "mozilla/dom/Document.h"
|
||||
#include "mozilla/dom/DocumentInlines.h"
|
||||
#include "nsIWidget.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "mozilla/StyleSheet.h"
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
#include "nsLeafFrame.h"
|
||||
#include "nsIPresShell.h"
|
||||
#include "mozilla/dom/Document.h"
|
||||
#include "mozilla/dom/DocumentInlines.h"
|
||||
#include "nsImageMap.h"
|
||||
#include "nsILinkHandler.h"
|
||||
#include "nsIURL.h"
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
#include "nsIObserverService.h"
|
||||
#include "XULDocument.h"
|
||||
#include "mozilla/AnimationUtils.h"
|
||||
#include "mozilla/dom/DocumentInlines.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
#include "mozilla/dom/Event.h" // for Event
|
||||
#include "mozilla/dom/KeyboardEvent.h"
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
#include "mozilla/BasicEvents.h"
|
||||
#include "mozilla/EventDispatcher.h"
|
||||
#include "mozilla/dom/Document.h"
|
||||
#include "mozilla/dom/DocumentInlines.h"
|
||||
#include "nsIPresShell.h"
|
||||
#include "nsPresContext.h"
|
||||
|
||||
|
|
|
@ -4,6 +4,8 @@
|
|||
|
||||
#include "js/JSON.h"
|
||||
#include "jsapi.h"
|
||||
#include "mozilla/dom/Document.h"
|
||||
#include "mozilla/dom/DocumentInlines.h"
|
||||
#include "mozilla/dom/HTMLInputElement.h"
|
||||
#include "mozilla/dom/HTMLSelectElement.h"
|
||||
#include "mozilla/dom/HTMLTextAreaElement.h"
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
#include "nsIDocShellTreeOwner.h"
|
||||
#include "nsIDocumentLoader.h"
|
||||
#include "mozilla/dom/Document.h"
|
||||
#include "mozilla/dom/DocumentInlines.h"
|
||||
#include "nsIDOMWindow.h"
|
||||
#include "nsIDOMChromeWindow.h"
|
||||
#include "nsIPrompt.h"
|
||||
|
|
|
@ -3,8 +3,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 "mozilla/dom/Event.h"
|
||||
#include "nsMenuUtilsX.h"
|
||||
|
||||
#include "mozilla/dom/Document.h"
|
||||
#include "mozilla/dom/DocumentInlines.h"
|
||||
#include "mozilla/dom/Event.h"
|
||||
#include "mozilla/dom/XULCommandEvent.h"
|
||||
#include "nsMenuBarX.h"
|
||||
#include "nsMenuX.h"
|
||||
#include "nsMenuItemX.h"
|
||||
|
@ -14,10 +18,8 @@
|
|||
#include "nsCocoaWindow.h"
|
||||
#include "nsGkAtoms.h"
|
||||
#include "nsGlobalWindowInner.h"
|
||||
#include "mozilla/dom/Document.h"
|
||||
#include "nsPIDOMWindow.h"
|
||||
#include "nsQueryObject.h"
|
||||
#include "mozilla/dom/XULCommandEvent.h"
|
||||
|
||||
using namespace mozilla;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче