Bug 1467790 - Inline nsINode::IsEditable, r=masayuki
This commit is contained in:
@@ -166,6 +166,20 @@ nsINode::NodeOrAncestorHasDirAuto() const
|
|||||||
return AncestorHasDirAuto() || (IsElement() && AsElement()->HasDirAuto());
|
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
|
inline bool
|
||||||
nsIContent::IsActiveChildrenElement() const
|
nsIContent::IsActiveChildrenElement() const
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -201,20 +201,6 @@ nsINode::CreateSlots()
|
|||||||
return new nsSlots();
|
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*
|
nsIContent*
|
||||||
nsINode::GetTextEditorRootContent(TextEditor** aTextEditor)
|
nsINode::GetTextEditorRootContent(TextEditor** aTextEditor)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1249,7 +1249,7 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsEditable() const;
|
inline bool IsEditable() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if |this| or any of its ancestors is native anonymous.
|
* Returns true if |this| or any of its ancestors is native anonymous.
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
#include "nsContentUtils.h"
|
#include "nsContentUtils.h"
|
||||||
#include "nsGkAtoms.h"
|
#include "nsGkAtoms.h"
|
||||||
#include "nsSVGString.h"
|
#include "nsSVGString.h"
|
||||||
|
#include "nsIContentInlines.h"
|
||||||
#include "nsIURI.h"
|
#include "nsIURI.h"
|
||||||
|
|
||||||
NS_IMPL_NS_NEW_NAMESPACED_SVG_ELEMENT(A)
|
NS_IMPL_NS_NEW_NAMESPACED_SVG_ELEMENT(A)
|
||||||
|
|||||||
@@ -71,7 +71,7 @@
|
|||||||
#include "nsGenericHTMLElement.h" // for nsGenericHTMLElement
|
#include "nsGenericHTMLElement.h" // for nsGenericHTMLElement
|
||||||
#include "nsGkAtoms.h" // for nsGkAtoms, nsGkAtoms::dir
|
#include "nsGkAtoms.h" // for nsGkAtoms, nsGkAtoms::dir
|
||||||
#include "nsIAbsorbingTransaction.h" // for nsIAbsorbingTransaction
|
#include "nsIAbsorbingTransaction.h" // for nsIAbsorbingTransaction
|
||||||
#include "nsAtom.h" // for nsAtom
|
#include "nsAtom.h" // for nsAtom
|
||||||
#include "nsIContent.h" // for nsIContent
|
#include "nsIContent.h" // for nsIContent
|
||||||
#include "nsIDocument.h" // for nsIDocument
|
#include "nsIDocument.h" // for nsIDocument
|
||||||
#include "nsIDOMEventListener.h" // for nsIDOMEventListener
|
#include "nsIDOMEventListener.h" // for nsIDOMEventListener
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
#include "nsCycleCollectionParticipant.h"
|
#include "nsCycleCollectionParticipant.h"
|
||||||
#include "nsGkAtoms.h"
|
#include "nsGkAtoms.h"
|
||||||
#include "nsIDocument.h" // for nsIDocument
|
#include "nsIDocument.h" // for nsIDocument
|
||||||
|
#include "nsIContentInlines.h" // for nsINode::IsEditable()
|
||||||
#include "nsIEditor.h" // for nsIEditor, etc.
|
#include "nsIEditor.h" // for nsIEditor, etc.
|
||||||
#include "nsIObserver.h" // for NS_DECL_NSIOBSERVER, etc.
|
#include "nsIObserver.h" // for NS_DECL_NSIOBSERVER, etc.
|
||||||
#include "nsIPlaintextEditor.h" // for nsIPlaintextEditor, etc.
|
#include "nsIPlaintextEditor.h" // for nsIPlaintextEditor, etc.
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
#include "nsDebug.h"
|
#include "nsDebug.h"
|
||||||
#include "nsError.h"
|
#include "nsError.h"
|
||||||
#include "nsIContent.h"
|
#include "nsIContent.h"
|
||||||
|
#include "nsIContentInlines.h"
|
||||||
#include "nsISupportsImpl.h"
|
#include "nsISupportsImpl.h"
|
||||||
#include "nsRange.h"
|
#include "nsRange.h"
|
||||||
#include "nsString.h"
|
#include "nsString.h"
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
#include "mozilla/dom/TabParent.h" // for TabParent
|
#include "mozilla/dom/TabParent.h" // for TabParent
|
||||||
#include "mozilla/EventDispatcher.h" // for EventDispatcher
|
#include "mozilla/EventDispatcher.h" // for EventDispatcher
|
||||||
#include "mozilla/layout/RenderFrameParent.h" // For RenderFrameParent
|
#include "mozilla/layout/RenderFrameParent.h" // For RenderFrameParent
|
||||||
|
#include "nsIContentInlines.h" // for nsINode::IsEditable()
|
||||||
#include "nsIPresShell.h" // for nsIPresShell
|
#include "nsIPresShell.h" // for nsIPresShell
|
||||||
#include "nsLayoutUtils.h" // for nsLayoutUtils
|
#include "nsLayoutUtils.h" // for nsLayoutUtils
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user