Bug 923151 - Part 2: Don't #include nsIDocument.h in mozilla/dom/Element.h; r=jst
This commit is contained in:
@@ -17,7 +17,6 @@
|
||||
#include "nsChangeHint.h" // for enum
|
||||
#include "nsEventStates.h" // for member
|
||||
#include "mozilla/dom/DirectionalityUtils.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsIDOMElement.h"
|
||||
#include "nsIDOMDocumentFragment.h"
|
||||
#include "nsILinkHandler.h"
|
||||
@@ -634,10 +633,7 @@ public:
|
||||
}
|
||||
}
|
||||
void MozRequestFullScreen();
|
||||
void MozRequestPointerLock()
|
||||
{
|
||||
OwnerDoc()->RequestPointerLock(this);
|
||||
}
|
||||
inline void MozRequestPointerLock();
|
||||
Attr* GetAttributeNode(const nsAString& aName);
|
||||
already_AddRefed<Attr> SetAttributeNode(Attr& aNewAttr,
|
||||
ErrorResult& aError);
|
||||
@@ -1071,37 +1067,14 @@ protected:
|
||||
Attr* GetAttributeNodeNSInternal(const nsAString& aNamespaceURI,
|
||||
const nsAString& aLocalName);
|
||||
|
||||
void RegisterFreezableElement() {
|
||||
OwnerDoc()->RegisterFreezableElement(this);
|
||||
}
|
||||
void UnregisterFreezableElement() {
|
||||
OwnerDoc()->UnregisterFreezableElement(this);
|
||||
}
|
||||
inline void RegisterFreezableElement();
|
||||
inline void UnregisterFreezableElement();
|
||||
|
||||
/**
|
||||
* Add/remove this element to the documents id cache
|
||||
*/
|
||||
void AddToIdTable(nsIAtom* aId) {
|
||||
NS_ASSERTION(HasID(), "Node doesn't have an ID?");
|
||||
nsIDocument* doc = GetCurrentDoc();
|
||||
if (doc && (!IsInAnonymousSubtree() || doc->IsXUL())) {
|
||||
doc->AddToIdTable(this, aId);
|
||||
}
|
||||
}
|
||||
void RemoveFromIdTable() {
|
||||
if (HasID()) {
|
||||
nsIDocument* doc = GetCurrentDoc();
|
||||
if (doc) {
|
||||
nsIAtom* id = DoGetID();
|
||||
// id can be null during mutation events evilness. Also, XUL elements
|
||||
// loose their proto attributes during cc-unlink, so this can happen
|
||||
// during cc-unlink too.
|
||||
if (id) {
|
||||
doc->RemoveFromIdTable(this, DoGetID());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
inline void AddToIdTable(nsIAtom* aId);
|
||||
inline void RemoveFromIdTable();
|
||||
|
||||
/**
|
||||
* Functions to carry out event default actions for links of all types
|
||||
|
||||
64
content/base/public/ElementInlines.h
Normal file
64
content/base/public/ElementInlines.h
Normal file
@@ -0,0 +1,64 @@
|
||||
/* -*- Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 8; -*- */
|
||||
/* vim: set sw=2 sts=2 ts=8 et tw=80 : */
|
||||
/* 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 mozilla_dom_ElementInlines_h
|
||||
#define mozilla_dom_ElementInlines_h
|
||||
|
||||
#include "mozilla/dom/Element.h"
|
||||
#include "nsIDocument.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
||||
inline void
|
||||
Element::AddToIdTable(nsIAtom* aId)
|
||||
{
|
||||
NS_ASSERTION(HasID(), "Node doesn't have an ID?");
|
||||
nsIDocument* doc = GetCurrentDoc();
|
||||
if (doc && (!IsInAnonymousSubtree() || doc->IsXUL())) {
|
||||
doc->AddToIdTable(this, aId);
|
||||
}
|
||||
}
|
||||
|
||||
inline void
|
||||
Element::RemoveFromIdTable()
|
||||
{
|
||||
if (HasID()) {
|
||||
nsIDocument* doc = GetCurrentDoc();
|
||||
if (doc) {
|
||||
nsIAtom* id = DoGetID();
|
||||
// id can be null during mutation events evilness. Also, XUL elements
|
||||
// loose their proto attributes during cc-unlink, so this can happen
|
||||
// during cc-unlink too.
|
||||
if (id) {
|
||||
doc->RemoveFromIdTable(this, DoGetID());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
inline void
|
||||
Element::MozRequestPointerLock()
|
||||
{
|
||||
OwnerDoc()->RequestPointerLock(this);
|
||||
}
|
||||
|
||||
inline void
|
||||
Element::RegisterFreezableElement()
|
||||
{
|
||||
OwnerDoc()->RegisterFreezableElement(this);
|
||||
}
|
||||
|
||||
inline void
|
||||
Element::UnregisterFreezableElement()
|
||||
{
|
||||
OwnerDoc()->UnregisterFreezableElement(this);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif // mozilla_dom_ElementInlines_h
|
||||
@@ -72,6 +72,7 @@ EXPORTS += [
|
||||
EXPORTS.mozilla.dom += [
|
||||
'DirectionalityUtils.h',
|
||||
'Element.h',
|
||||
'ElementInlines.h',
|
||||
'FragmentOrElement.h',
|
||||
'FromParser.h',
|
||||
]
|
||||
|
||||
@@ -17,6 +17,8 @@
|
||||
#include "nsDOMString.h"
|
||||
#include "nsContentUtils.h" // for NS_INTERFACE_MAP_ENTRY_TEAROFF
|
||||
#include "mozilla/dom/DocumentFragmentBinding.h"
|
||||
#include "nsPIDOMWindow.h"
|
||||
#include "nsIDocument.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
* utility methods for subclasses, and so forth.
|
||||
*/
|
||||
|
||||
#include "mozilla/dom/Element.h"
|
||||
#include "mozilla/dom/ElementInlines.h"
|
||||
|
||||
#include "mozilla/DebugOnly.h"
|
||||
#include "mozilla/dom/Attr.h"
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#include "nsCSSParser.h"
|
||||
#include "nsStyledElement.h"
|
||||
#include "nsIURI.h"
|
||||
#include "nsIDocument.h"
|
||||
#include <algorithm>
|
||||
|
||||
using namespace mozilla;
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include "nsIDOMMutationEvent.h"
|
||||
#include "nsWrapperCache.h"
|
||||
#include "mozilla/dom/MutationObserverBinding.h"
|
||||
#include "nsIDocument.h"
|
||||
|
||||
class nsDOMMutationObserver;
|
||||
using mozilla::dom::MutationObservingInfoInitializer;
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include "nsCycleCollectionParticipant.h"
|
||||
|
||||
#include "nsISMILAttr.h"
|
||||
#include "nsIDocument.h"
|
||||
|
||||
class nsIDOMAttr;
|
||||
class nsIDOMEventListener;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include "nsGkAtoms.h"
|
||||
#include "nsAttrValue.h"
|
||||
#include "nsAttrValueInlines.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
#include "mozilla/dom/ElementInlines.h"
|
||||
#include "mozilla/MutationEvent.h"
|
||||
#include "nsDOMCSSDeclaration.h"
|
||||
#include "nsDOMCSSAttrDeclaration.h"
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include "nsNullPrincipal.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsIParserUtils.h"
|
||||
#include "nsIDocument.h"
|
||||
|
||||
using namespace mozilla;
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
#include "mozilla/dom/HTMLMediaElement.h"
|
||||
#include "mozilla/dom/HTMLMediaElementBinding.h"
|
||||
#include "mozilla/dom/ElementInlines.h"
|
||||
#include "mozilla/MathAlgorithms.h"
|
||||
#include "mozilla/Util.h"
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include "mozilla/Util.h"
|
||||
|
||||
#include "mozilla/dom/HTMLObjectElementBinding.h"
|
||||
#include "mozilla/dom/ElementInlines.h"
|
||||
#include "nsAutoPtr.h"
|
||||
#include "nsAttrValueInlines.h"
|
||||
#include "nsGkAtoms.h"
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include "mozilla/dom/HTMLSharedObjectElement.h"
|
||||
#include "mozilla/dom/HTMLEmbedElementBinding.h"
|
||||
#include "mozilla/dom/HTMLAppletElementBinding.h"
|
||||
#include "mozilla/dom/ElementInlines.h"
|
||||
#include "mozilla/Util.h"
|
||||
|
||||
#include "nsIDocument.h"
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include "nsEventDispatcher.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "jsapi.h"
|
||||
#include "nsIDocument.h"
|
||||
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "mozilla/ErrorResult.h"
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
#include "nsIDOMHTMLMenuElement.h"
|
||||
#include "mozilla/dom/DOMRect.h"
|
||||
#include "mozilla/dom/ValidityState.h"
|
||||
#include "mozilla/dom/ElementInlines.h"
|
||||
|
||||
class nsIDOMAttr;
|
||||
class nsIDOMEventListener;
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#define nsMathMLElement_h
|
||||
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/dom/ElementInlines.h"
|
||||
#include "nsMappedAttributeElement.h"
|
||||
#include "nsIDOMElement.h"
|
||||
#include "Link.h"
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#include "mozilla/dom/SpeechSynthesisBinding.h"
|
||||
#include "SpeechSynthesis.h"
|
||||
#include "nsSynthVoiceRegistry.h"
|
||||
#include "nsIDocument.h"
|
||||
|
||||
#undef LOG
|
||||
#ifdef PR_LOGGING
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#include "nsStyleAnimation.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
#include "nsIDOMElement.h"
|
||||
#include "nsIDocument.h"
|
||||
|
||||
using namespace mozilla::dom;
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#include "mozilla/dom/Element.h"
|
||||
#include "nsDebug.h"
|
||||
#include "nsStyleUtil.h"
|
||||
#include "nsIDocument.h"
|
||||
|
||||
using namespace mozilla::dom;
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
#include "nsCycleCollectionParticipant.h"
|
||||
#include "nsError.h"
|
||||
#include "mozilla/dom/DOMRect.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
#include "mozilla/dom/ElementInlines.h"
|
||||
#include "nsISupportsImpl.h"
|
||||
#include "nsStyledElement.h"
|
||||
#include "nsSVGClass.h"
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
#include "nsXMLElement.h"
|
||||
#include "mozilla/dom/ElementBinding.h"
|
||||
#include "mozilla/dom/ElementInlines.h"
|
||||
#include "nsContentUtils.h" // nsAutoScriptBlocker
|
||||
|
||||
using namespace mozilla::dom;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "nsIDOMElement.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
#include "mozilla/dom/ElementInlines.h"
|
||||
#include "mozilla/dom/DOMRect.h"
|
||||
|
||||
class nsXMLElement : public mozilla::dom::Element,
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include "nsXBLService.h"
|
||||
#include "nsIScriptSecurityManager.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "nsIDocument.h"
|
||||
|
||||
using namespace mozilla;
|
||||
using namespace mozilla::dom;
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
#include "nsIFrameLoader.h"
|
||||
#include "nsFrameLoader.h"
|
||||
#include "mozilla/dom/DOMRect.h"
|
||||
#include "mozilla/dom/ElementInlines.h"
|
||||
|
||||
class nsIDocument;
|
||||
class nsString;
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#include "nsIWeakReferenceUtils.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
#include "nsIInterfaceRequestor.h"
|
||||
#include "nsILoadContext.h"
|
||||
|
||||
class mozIApplication;
|
||||
|
||||
|
||||
@@ -13,7 +13,8 @@
|
||||
#include "nsComponentManagerUtils.h"
|
||||
#include "nsIDocShellTreeItem.h"
|
||||
#include "nsIBaseWindow.h"
|
||||
|
||||
#include "nsIDocument.h"
|
||||
|
||||
//---------------------------------------------------
|
||||
//-- nsPrintObject Class Impl
|
||||
//---------------------------------------------------
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
#include "nsEventDispatcher.h"
|
||||
#include "nsLayoutUtils.h"
|
||||
#include "nsIFrame.h"
|
||||
#include "nsIDocument.h"
|
||||
#include <math.h>
|
||||
|
||||
using namespace mozilla;
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
#include "nsRuleData.h"
|
||||
#include "nsStyleSet.h"
|
||||
#include "nsStyleContext.h"
|
||||
#include "nsIDocument.h"
|
||||
|
||||
namespace css = mozilla::css;
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#endif
|
||||
#include "nsCSSRuleProcessor.h"
|
||||
#include "nsDeviceContext.h"
|
||||
#include "nsIDocument.h"
|
||||
|
||||
using namespace mozilla;
|
||||
|
||||
|
||||
@@ -41,6 +41,7 @@
|
||||
#include "nsPrintfCString.h"
|
||||
#include "nsRenderingContext.h"
|
||||
#include "nsStyleUtil.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "prtime.h"
|
||||
|
||||
#if defined(_MSC_VER) || defined(__MINGW32__)
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include "nsRuleWalker.h"
|
||||
#include "nsNthIndexCache.h"
|
||||
#include "nsILoadContext.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "mozilla/AutoRestore.h"
|
||||
#include "mozilla/BloomFilter.h"
|
||||
#include "mozilla/GuardObjects.h"
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
#include "mozilla/Likely.h"
|
||||
#include "gfxMatrix.h"
|
||||
#include "gfxQuaternion.h"
|
||||
#include "nsIDocument.h"
|
||||
|
||||
using namespace mozilla;
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
#include "nsStringStream.h"
|
||||
#include "mozilla/ipc/URIUtils.h"
|
||||
#include "nsNetUtil.h"
|
||||
#include "nsIDocument.h"
|
||||
|
||||
#include "mozilla/unused.h"
|
||||
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
#include "nsIDOMDocument.h"
|
||||
#include "nsIScriptObjectPrincipal.h"
|
||||
#include "nsIURI.h"
|
||||
#include "nsIDocument.h"
|
||||
#if defined(XP_MACOSX)
|
||||
#include "nsThreadUtils.h"
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user