diff --git a/dom/base/nsIContentInlines.h b/dom/base/nsIContentInlines.h index 6f98f3b31cab..9e123c3820d4 100644 --- a/dom/base/nsIContentInlines.h +++ b/dom/base/nsIContentInlines.h @@ -166,6 +166,20 @@ nsINode::NodeOrAncestorHasDirAuto() const return AncestorHasDirAuto() || (IsElement() && AsElement()->HasDirAuto()); } +inline bool +nsINode::IsEditable() const +{ + if (HasFlag(NODE_IS_EDITABLE)) { + // The node is in an editable contentEditable subtree. + return true; + } + + nsIDocument* doc = GetUncomposedDoc(); + + // Check if the node is in a document and the document is in designMode. + return doc && doc->HasFlag(NODE_IS_EDITABLE); +} + inline bool nsIContent::IsActiveChildrenElement() const { diff --git a/dom/base/nsINode.cpp b/dom/base/nsINode.cpp index e42d2da66dce..27d746bfec3d 100644 --- a/dom/base/nsINode.cpp +++ b/dom/base/nsINode.cpp @@ -201,20 +201,6 @@ nsINode::CreateSlots() return new nsSlots(); } -bool -nsINode::IsEditable() const -{ - if (HasFlag(NODE_IS_EDITABLE)) { - // The node is in an editable contentEditable subtree. - return true; - } - - nsIDocument *doc = GetUncomposedDoc(); - - // Check if the node is in a document and the document is in designMode. - return doc && doc->HasFlag(NODE_IS_EDITABLE); -} - nsIContent* nsINode::GetTextEditorRootContent(TextEditor** aTextEditor) { diff --git a/dom/base/nsINode.h b/dom/base/nsINode.h index 890d1674def9..e7fdc9e856f9 100644 --- a/dom/base/nsINode.h +++ b/dom/base/nsINode.h @@ -1249,7 +1249,7 @@ public: } } - bool IsEditable() const; + inline bool IsEditable() const; /** * Returns true if |this| or any of its ancestors is native anonymous. diff --git a/dom/svg/SVGAElement.cpp b/dom/svg/SVGAElement.cpp index ca2c0421b488..6eac22f08785 100644 --- a/dom/svg/SVGAElement.cpp +++ b/dom/svg/SVGAElement.cpp @@ -14,6 +14,7 @@ #include "nsContentUtils.h" #include "nsGkAtoms.h" #include "nsSVGString.h" +#include "nsIContentInlines.h" #include "nsIURI.h" NS_IMPL_NS_NEW_NAMESPACED_SVG_ELEMENT(A) diff --git a/editor/libeditor/EditorBase.cpp b/editor/libeditor/EditorBase.cpp index d063a2adc61f..b88a845f95db 100644 --- a/editor/libeditor/EditorBase.cpp +++ b/editor/libeditor/EditorBase.cpp @@ -71,7 +71,7 @@ #include "nsGenericHTMLElement.h" // for nsGenericHTMLElement #include "nsGkAtoms.h" // for nsGkAtoms, nsGkAtoms::dir #include "nsIAbsorbingTransaction.h" // for nsIAbsorbingTransaction -#include "nsAtom.h" // for nsAtom +#include "nsAtom.h" // for nsAtom #include "nsIContent.h" // for nsIContent #include "nsIDocument.h" // for nsIDocument #include "nsIDOMEventListener.h" // for nsIDOMEventListener diff --git a/editor/libeditor/EditorBase.h b/editor/libeditor/EditorBase.h index 727f2a6cb10e..109323e94462 100644 --- a/editor/libeditor/EditorBase.h +++ b/editor/libeditor/EditorBase.h @@ -22,6 +22,7 @@ #include "nsCycleCollectionParticipant.h" #include "nsGkAtoms.h" #include "nsIDocument.h" // for nsIDocument +#include "nsIContentInlines.h" // for nsINode::IsEditable() #include "nsIEditor.h" // for nsIEditor, etc. #include "nsIObserver.h" // for NS_DECL_NSIOBSERVER, etc. #include "nsIPlaintextEditor.h" // for nsIPlaintextEditor, etc. diff --git a/editor/libeditor/WSRunObject.cpp b/editor/libeditor/WSRunObject.cpp index f3703cb98b6a..69a8f35ccfc4 100644 --- a/editor/libeditor/WSRunObject.cpp +++ b/editor/libeditor/WSRunObject.cpp @@ -22,6 +22,7 @@ #include "nsDebug.h" #include "nsError.h" #include "nsIContent.h" +#include "nsIContentInlines.h" #include "nsISupportsImpl.h" #include "nsRange.h" #include "nsString.h" diff --git a/gfx/layers/apz/src/FocusTarget.cpp b/gfx/layers/apz/src/FocusTarget.cpp index 790781c39b90..b8b1fb56ef27 100644 --- a/gfx/layers/apz/src/FocusTarget.cpp +++ b/gfx/layers/apz/src/FocusTarget.cpp @@ -10,6 +10,7 @@ #include "mozilla/dom/TabParent.h" // for TabParent #include "mozilla/EventDispatcher.h" // for EventDispatcher #include "mozilla/layout/RenderFrameParent.h" // For RenderFrameParent +#include "nsIContentInlines.h" // for nsINode::IsEditable() #include "nsIPresShell.h" // for nsIPresShell #include "nsLayoutUtils.h" // for nsLayoutUtils