Bug 1467790 - Inline nsINode::IsEditable, r=masayuki
authorOlli Pettay <Olli.Pettay@helsinki.fi>
Fri, 08 Jun 2018 15:57:13 -0400
changeset 478756 da935e9b476d83b3652ee3425aa94a28d02397f1
parent 478755 9d70adc79bc1dd06e46fb36320f233f370d80666
child 478757 37faedd4429185358558a9f1aa046e1110ec3522
push id1757
push userffxbld-merge
push dateFri, 24 Aug 2018 17:02:43 +0000
treeherdermozilla-release@736023aebdb1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmasayuki
bugs1467790
milestone62.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1467790 - Inline nsINode::IsEditable, r=masayuki
dom/base/nsIContentInlines.h
dom/base/nsINode.cpp
dom/base/nsINode.h
dom/svg/SVGAElement.cpp
editor/libeditor/EditorBase.cpp
editor/libeditor/EditorBase.h
editor/libeditor/WSRunObject.cpp
gfx/layers/apz/src/FocusTarget.cpp
--- a/dom/base/nsIContentInlines.h
+++ b/dom/base/nsIContentInlines.h
@@ -162,16 +162,30 @@ nsINode::GetFlattenedTreeParentNodeForSt
 
 inline bool
 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
 {
   if (!mNodeInfo->Equals(nsGkAtoms::children, kNameSpaceID_XBL)) {
     return false;
   }
 
   nsIContent* bindingParent = GetBindingParent();
   if (!bindingParent) {
--- a/dom/base/nsINode.cpp
+++ b/dom/base/nsINode.cpp
@@ -196,30 +196,16 @@ nsINode::UnsetProperty(nsAtom* aProperty
 }
 
 nsINode::nsSlots*
 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)
 {
   if (aTextEditor) {
     *aTextEditor = nullptr;
   }
   for (nsINode* node = this; node; node = node->GetParentNode()) {
     if (!node->IsElement() ||
--- a/dom/base/nsINode.h
+++ b/dom/base/nsINode.h
@@ -1244,17 +1244,17 @@ public:
     if (aEditable) {
       SetFlags(NODE_IS_EDITABLE);
     }
     else {
       UnsetFlags(NODE_IS_EDITABLE);
     }
   }
 
-  bool IsEditable() const;
+  inline bool IsEditable() const;
 
   /**
    * Returns true if |this| or any of its ancestors is native anonymous.
    */
   bool IsInNativeAnonymousSubtree() const
   {
 #ifdef DEBUG
     if (HasFlag(NODE_IS_IN_NATIVE_ANONYMOUS_SUBTREE)) {
--- a/dom/svg/SVGAElement.cpp
+++ b/dom/svg/SVGAElement.cpp
@@ -9,16 +9,17 @@
 #include "mozilla/Attributes.h"
 #include "mozilla/EventDispatcher.h"
 #include "mozilla/EventStates.h"
 #include "mozilla/dom/SVGAElementBinding.h"
 #include "nsCOMPtr.h"
 #include "nsContentUtils.h"
 #include "nsGkAtoms.h"
 #include "nsSVGString.h"
+#include "nsIContentInlines.h"
 #include "nsIURI.h"
 
 NS_IMPL_NS_NEW_NAMESPACED_SVG_ELEMENT(A)
 
 namespace mozilla {
 namespace dom {
 
 JSObject*
--- a/editor/libeditor/EditorBase.cpp
+++ b/editor/libeditor/EditorBase.cpp
@@ -66,17 +66,17 @@
 #include "nsDOMString.h"                // for DOMStringIsNull
 #include "nsDebug.h"                    // for NS_ENSURE_TRUE, etc.
 #include "nsError.h"                    // for NS_OK, etc.
 #include "nsFocusManager.h"             // for nsFocusManager
 #include "nsFrameSelection.h"           // for nsFrameSelection
 #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
 #include "nsIDocumentStateListener.h"   // for nsIDocumentStateListener
 #include "nsIEditActionListener.h"      // for nsIEditActionListener
 #include "nsIEditorObserver.h"          // for nsIEditorObserver
 #include "nsIEditorSpellCheck.h"        // for nsIEditorSpellCheck
 #include "nsIFrame.h"                   // for nsIFrame
--- a/editor/libeditor/EditorBase.h
+++ b/editor/libeditor/EditorBase.h
@@ -17,16 +17,17 @@
 #include "mozilla/TransactionManager.h" // for TransactionManager
 #include "mozilla/WeakPtr.h"            // for WeakPtr
 #include "mozilla/dom/Selection.h"
 #include "mozilla/dom/Text.h"
 #include "nsCOMPtr.h"                   // for already_AddRefed, nsCOMPtr
 #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.
 #include "nsISelectionController.h"     // for nsISelectionController constants
 #include "nsISelectionListener.h"       // for nsISelectionListener
 #include "nsISupportsImpl.h"            // for EditorBase::Release, etc.
 #include "nsIWeakReferenceUtils.h"      // for nsWeakPtr
 #include "nsLiteralString.h"            // for NS_LITERAL_STRING
--- a/editor/libeditor/WSRunObject.cpp
+++ b/editor/libeditor/WSRunObject.cpp
@@ -17,16 +17,17 @@
 #include "mozilla/SelectionState.h"
 
 #include "nsAString.h"
 #include "nsCRT.h"
 #include "nsContentUtils.h"
 #include "nsDebug.h"
 #include "nsError.h"
 #include "nsIContent.h"
+#include "nsIContentInlines.h"
 #include "nsISupportsImpl.h"
 #include "nsRange.h"
 #include "nsString.h"
 #include "nsTextFragment.h"
 
 namespace mozilla {
 
 using namespace dom;
--- a/gfx/layers/apz/src/FocusTarget.cpp
+++ b/gfx/layers/apz/src/FocusTarget.cpp
@@ -5,16 +5,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/layers/FocusTarget.h"
 
 #include "mozilla/dom/EventTarget.h" // for EventTarget
 #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
 
 #define ENABLE_FT_LOGGING 0
 // #define ENABLE_FT_LOGGING 1
 
 #if ENABLE_FT_LOGGING
 #  define FT_LOG(FMT, ...) printf_stderr("FT (%s): " FMT, \