Bug 1260651 part.7 Rename nsBoolDomIterFunctor to mozilla::BoolDomIterFunctor r=mccr8 draft
authorMasayuki Nakano <masayuki@d-toybox.com>
Thu, 23 Jun 2016 17:39:47 +0900
changeset 385697 a8981068b80d55f7fabfc13b89defbd00e909680
parent 385696 44e6ff51818b440ed26c47b8d9e04ee0fecc52a3
child 385698 146923a0c7f8ef1ccd32727c924963d83066efc2
push id22582
push usermasayuki@d-toybox.com
push dateSat, 09 Jul 2016 03:13:39 +0000
reviewersmccr8
bugs1260651
milestone50.0a1
Bug 1260651 part.7 Rename nsBoolDomIterFunctor to mozilla::BoolDomIterFunctor r=mccr8 MozReview-Commit-ID: EFQMDbDMLmT
editor/libeditor/EditorUtils.cpp
editor/libeditor/EditorUtils.h
editor/libeditor/nsHTMLEditRules.cpp
--- a/editor/libeditor/EditorUtils.cpp
+++ b/editor/libeditor/EditorUtils.cpp
@@ -89,17 +89,17 @@ DOMIterator::DOMIterator(MOZ_GUARD_OBJEC
   MOZ_GUARD_OBJECT_NOTIFIER_INIT;
 }
 
 DOMIterator::~DOMIterator()
 {
 }
 
 void
-DOMIterator::AppendList(const nsBoolDomIterFunctor& functor,
+DOMIterator::AppendList(const BoolDomIterFunctor& functor,
                         nsTArray<OwningNonNull<nsINode>>& arrayOfNodes) const
 {
   // Iterate through dom and build list
   for (; !mIter->IsDone(); mIter->Next()) {
     nsCOMPtr<nsINode> node = mIter->GetCurrentNode();
 
     if (functor(node)) {
       arrayOfNodes.AppendElement(*node);
--- a/editor/libeditor/EditorUtils.h
+++ b/editor/libeditor/EditorUtils.h
@@ -188,53 +188,53 @@ class MOZ_RAII nsAutoUpdateViewBatch
   nsEditor *mEd;
   MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
 };
 
 /******************************************************************************
  * some helper classes for iterating the dom tree
  *****************************************************************************/
 
-class nsBoolDomIterFunctor
+namespace mozilla {
+
+class BoolDomIterFunctor
 {
-  public:
-    virtual bool operator()(nsINode* aNode) const = 0;
+public:
+  virtual bool operator()(nsINode* aNode) const = 0;
 };
 
-namespace mozilla {
-
 class MOZ_RAII DOMIterator
 {
 public:
   explicit DOMIterator(MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM);
 
   explicit DOMIterator(nsINode& aNode MOZ_GUARD_OBJECT_NOTIFIER_PARAM);
   virtual ~DOMIterator();
 
   nsresult Init(nsRange& aRange);
 
   void AppendList(
-         const nsBoolDomIterFunctor& functor,
+         const BoolDomIterFunctor& functor,
          nsTArray<mozilla::OwningNonNull<nsINode>>& arrayOfNodes) const;
 
 protected:
   nsCOMPtr<nsIContentIterator> mIter;
   MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
 };
 
 class MOZ_RAII DOMSubtreeIterator final : public DOMIterator
 {
 public:
   explicit DOMSubtreeIterator(MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM);
   virtual ~DOMSubtreeIterator();
 
   nsresult Init(nsRange& aRange);
 };
 
-class TrivialFunctor final : public nsBoolDomIterFunctor
+class TrivialFunctor final : public BoolDomIterFunctor
 {
 public:
   // Used to build list of all nodes iterator covers
   virtual bool operator()(nsINode* aNode) const
   {
     return true;
   }
 };
--- a/editor/libeditor/nsHTMLEditRules.cpp
+++ b/editor/libeditor/nsHTMLEditRules.cpp
@@ -102,41 +102,41 @@ IsStyleCachePreservingAction(EditAction 
          action == EditAction::align ||
          action == EditAction::makeBasicBlock ||
          action == EditAction::removeList ||
          action == EditAction::makeDefListItem ||
          action == EditAction::insertElement ||
          action == EditAction::insertQuotation;
 }
 
-class nsTableCellAndListItemFunctor : public nsBoolDomIterFunctor
+class nsTableCellAndListItemFunctor : public mozilla::BoolDomIterFunctor
 {
   public:
     // Used to build list of all li's, td's & th's iterator covers
     virtual bool operator()(nsINode* aNode) const
     {
       if (nsHTMLEditUtils::IsTableCell(aNode)) return true;
       if (nsHTMLEditUtils::IsListItem(aNode)) return true;
       return false;
     }
 };
 
-class nsBRNodeFunctor : public nsBoolDomIterFunctor
+class nsBRNodeFunctor : public mozilla::BoolDomIterFunctor
 {
   public:
     virtual bool operator()(nsINode* aNode) const
     {
       if (aNode->IsHTMLElement(nsGkAtoms::br)) {
         return true;
       }
       return false;
     }
 };
 
-class nsEmptyEditableFunctor : public nsBoolDomIterFunctor
+class nsEmptyEditableFunctor : public mozilla::BoolDomIterFunctor
 {
   public:
     explicit nsEmptyEditableFunctor(nsHTMLEditor* editor) : mHTMLEditor(editor) {}
     virtual bool operator()(nsINode* aNode) const
     {
       if (mHTMLEditor->IsEditable(aNode) &&
           (nsHTMLEditUtils::IsListItem(aNode) ||
            nsHTMLEditUtils::IsTableCellOrCaption(*aNode))) {
@@ -147,17 +147,17 @@ class nsEmptyEditableFunctor : public ns
           return true;
       }
       return false;
     }
   protected:
     nsHTMLEditor* mHTMLEditor;
 };
 
-class nsEditableTextFunctor : public nsBoolDomIterFunctor
+class nsEditableTextFunctor : public mozilla::BoolDomIterFunctor
 {
   public:
     explicit nsEditableTextFunctor(nsHTMLEditor* editor) : mHTMLEditor(editor) {}
     virtual bool operator()(nsINode* aNode) const
     {
       if (nsEditor::IsTextNode(aNode) && mHTMLEditor->IsEditable(aNode))
       {
         return true;
@@ -5526,17 +5526,17 @@ nsHTMLEditRules::PromoteRange(nsRange& a
   }
 
   DebugOnly<nsresult> res = aRange.SetStart(opStartNode, opStartOffset);
   MOZ_ASSERT(NS_SUCCEEDED(res));
   res = aRange.SetEnd(opEndNode, opEndOffset);
   MOZ_ASSERT(NS_SUCCEEDED(res));
 }
 
-class nsUniqueFunctor : public nsBoolDomIterFunctor
+class nsUniqueFunctor : public mozilla::BoolDomIterFunctor
 {
 public:
   explicit nsUniqueFunctor(nsTArray<OwningNonNull<nsINode>> &aArray) : mArray(aArray)
   {
   }
   // used to build list of all nodes iterator covers
   virtual bool operator()(nsINode* aNode) const
   {