Bug 838518 part 1. Fix treewalker callers per the API change that was made. r=smaug
authorBoris Zbarsky <bzbarsky@mit.edu>
Wed, 06 Feb 2013 14:22:33 +0000
changeset 130894 e1e47cdd7b68dee9aa6b75a5d228b4af4cf895ae
parent 130893 bebb0d153de08847eec323969cc9181a811c48b8
child 130895 adcbf76cd5860c8c360978a39a1c1c5f4ca048c0
push id2323
push userbbajaj@mozilla.com
push dateMon, 01 Apr 2013 19:47:02 +0000
treeherdermozilla-beta@7712be144d91 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs838518
milestone21.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 838518 part 1. Fix treewalker callers per the API change that was made. r=smaug
accessible/src/generic/Accessible.cpp
accessible/tests/mochitest/name/markup.js
browser/base/content/pageinfo/pageInfo.js
browser/devtools/markupview/MarkupView.jsm
browser/devtools/shared/DOMHelpers.jsm
content/base/crashtests/205225-1.html
content/base/test/chrome/test_bug635835.xul
content/base/test/file_bug416317.xhtml
content/base/test/test_bug338541.xhtml
content/base/test/test_bug378969.html
content/base/test/test_bug559526.html
content/base/test/test_bug625722.html
content/base/test/test_bug628938.html
content/base/test/test_elementTraversal.html
content/base/test/test_treewalker_nextsibling.xml
content/events/test/test_bug650493.html
content/test/unit/test_isequalnode.js
content/test/unit/test_range.js
content/test/unit/test_treewalker.js
dom/imptests/failures/webapps/DOMCore/tests/approved/test_interfaces.html.json
dom/imptests/webapps/DOMCore/tests/approved/test_interfaces.html
dom/tests/mochitest/bugs/test_bug393974.html
embedding/components/webbrowserpersist/src/nsWebBrowserPersist.cpp
js/xpconnect/tests/mochitest/test_bug505915.html
parser/htmlparser/tests/mochitest/parser_datreader.js
toolkit/components/viewsource/content/viewSource.js
toolkit/content/widgets/button.xml
toolkit/content/widgets/radio.xml
toolkit/content/widgets/text.xml
--- a/accessible/src/generic/Accessible.cpp
+++ b/accessible/src/generic/Accessible.cpp
@@ -3075,17 +3075,17 @@ Accessible::GetFirstAvailableAccessible(
   nsCOMPtr<nsIDOMDocument> domDoc = do_QueryInterface(aStartNode->OwnerDoc());
   NS_ENSURE_TRUE(domDoc, nullptr);
 
   nsCOMPtr<nsIDOMNode> currentNode = do_QueryInterface(aStartNode);
   nsCOMPtr<nsIDOMNode> rootNode = do_QueryInterface(GetNode());
   nsCOMPtr<nsIDOMTreeWalker> walker;
   domDoc->CreateTreeWalker(rootNode,
                            nsIDOMNodeFilter::SHOW_ELEMENT | nsIDOMNodeFilter::SHOW_TEXT,
-                           nullptr, false, getter_AddRefs(walker));
+                           nullptr, 1, getter_AddRefs(walker));
   NS_ENSURE_TRUE(walker, nullptr);
 
   walker->SetCurrentNode(currentNode);
   while (true) {
     walker->NextNode(getter_AddRefs(currentNode));
     if (!currentNode)
       return nullptr;
 
--- a/accessible/tests/mochitest/name/markup.js
+++ b/accessible/tests/mochitest/name/markup.js
@@ -266,17 +266,17 @@ function testNameForElmRule(aElm, aRule)
 
       mLocalName: tagname,
       mAttrName: attrname,
       mAttrValue: aElm.getAttribute("id")
     };
 
     var treeWalker = document.createTreeWalker(document.body,
                                                NodeFilter.SHOW_ELEMENT,
-                                               filter, false);
+                                               filter);
     labelElm = treeWalker.nextNode();
 
   } else {
     // if attrname is empty then look for the element in subtree.
     labelElm = aElm.getElementsByTagName(tagname)[0];
     if (!labelElm)
       labelElm = aElm.getElementsByTagName("html:" + tagname)[0];
   }
--- a/browser/base/content/pageinfo/pageInfo.js
+++ b/browser/base/content/pageinfo/pageInfo.js
@@ -570,17 +570,17 @@ function goThroughFrames(aDocument, aWin
   }
 }
 
 function processFrames()
 {
   if (gFrameList.length) {
     var doc = gFrameList[0];
     onProcessFrame.forEach(function(func) { func(doc); });
-    var iterator = doc.createTreeWalker(doc, NodeFilter.SHOW_ELEMENT, grabAll, true);
+    var iterator = doc.createTreeWalker(doc, NodeFilter.SHOW_ELEMENT, grabAll);
     gFrameList.shift();
     setTimeout(doGrab, 10, iterator);
     onFinished.push(selectImage);
   }
   else
     onFinished.forEach(function(func) { func(); });
 }
 
--- a/browser/devtools/markupview/MarkupView.jsm
+++ b/browser/devtools/markupview/MarkupView.jsm
@@ -116,18 +116,17 @@ MarkupView.prototype = {
     let walker = this.doc.createTreeWalker(
       aStart || this._elt,
       Ci.nsIDOMNodeFilter.SHOW_ELEMENT,
       function(aElement) {
         if (aElement.container && aElement.container.visible) {
           return Ci.nsIDOMNodeFilter.FILTER_ACCEPT;
         }
         return Ci.nsIDOMNodeFilter.FILTER_SKIP;
-      },
-      false
+      }
     );
     walker.currentNode = this._selectedContainer.elt;
     return walker;
   },
 
   /**
    * Key handling.
    */
@@ -1311,34 +1310,33 @@ ElementEditor.prototype = {
 
 RootContainer.prototype = {
   hasChildren: true,
   expanded: true,
   update: function RC_update() {}
 };
 
 function documentWalker(node) {
-  return new DocumentWalker(node, Ci.nsIDOMNodeFilter.SHOW_ALL, whitespaceTextFilter, false);
+  return new DocumentWalker(node, Ci.nsIDOMNodeFilter.SHOW_ALL, whitespaceTextFilter);
 }
 
 function nodeDocument(node) {
   return node.ownerDocument || (node.nodeType == Ci.nsIDOMNode.DOCUMENT_NODE ? node : null);
 }
 
 /**
  * Similar to a TreeWalker, except will dig in to iframes and it doesn't
  * implement the good methods like previousNode and nextNode.
  *
  * See TreeWalker documentation for explanations of the methods.
  */
-function DocumentWalker(aNode, aShow, aFilter, aExpandEntityReferences)
+function DocumentWalker(aNode, aShow, aFilter)
 {
   let doc = nodeDocument(aNode);
-  this.walker = doc.createTreeWalker(nodeDocument(aNode),
-    aShow, aFilter, aExpandEntityReferences);
+  this.walker = doc.createTreeWalker(nodeDocument(aNode), aShow, aFilter);
   this.walker.currentNode = aNode;
   this.filter = aFilter;
 }
 
 DocumentWalker.prototype = {
   get node() this.walker.node,
   get whatToShow() this.walker.whatToShow,
   get expandEntityReferences() this.walker.expandEntityReferences,
--- a/browser/devtools/shared/DOMHelpers.jsm
+++ b/browser/devtools/shared/DOMHelpers.jsm
@@ -91,17 +91,17 @@ DOMHelpers.prototype = {
 
     return null;  // we have no children worth showing.
   },
 
   getFirstChild: function Helpers_getFirstChild(node)
   {
     let SHOW_ALL = Components.interfaces.nsIDOMNodeFilter.SHOW_ALL;
     this.treeWalker = node.ownerDocument.createTreeWalker(node,
-      SHOW_ALL, null, false);
+      SHOW_ALL, null);
     return this.treeWalker.firstChild();
   },
 
   getNextSibling: function Helpers_getNextSibling(node)
   {
     let next = this.treeWalker.nextSibling();
 
     if (!next)
--- a/content/base/crashtests/205225-1.html
+++ b/content/base/crashtests/205225-1.html
@@ -1,9 +1,9 @@
 <html>
 <head>
 <script type="text/javascript">
-document.createTreeWalker(null, NodeFilter.SHOW_ALL, null, false);
+document.createTreeWalker(null, NodeFilter.SHOW_ALL, null);
 </script>
 </head>
 <body>
 </body>
 </html>
--- a/content/base/test/chrome/test_bug635835.xul
+++ b/content/base/test/chrome/test_bug635835.xul
@@ -17,17 +17,17 @@ https://bugzilla.mozilla.org/show_bug.cg
   </body>
 
   <!-- test code goes here -->
   <script type="application/javascript"><![CDATA[
 SimpleTest.waitForExplicitFinish();
 const SHOW_ALL = Components.interfaces.nsIDOMNodeFilter.SHOW_ALL;
 
 addLoadEvent(function() {
-  var walker = document.createTreeWalker(document, SHOW_ALL, null, true);
+  var walker = document.createTreeWalker(document, SHOW_ALL, null);
   try {
     walker.currentNode = {};
     walker.nextNode();
   }
   catch (e) {
     // do nothing - this is a crash test
   }
   ok(true, "Crash test passed");
--- a/content/base/test/file_bug416317.xhtml
+++ b/content/base/test/file_bug416317.xhtml
@@ -452,17 +452,17 @@
             var pass = !expect && e.name == "SyntaxError" && e.code == DOMException.SYNTAX_ERR || false;
             assert(pass, type + ".querySelector: " + query);
           }
         }
       }
     }
 
     function check( type, root, expect, fragment ){
-      var walker = document.createTreeWalker( root, NodeFilter.SHOW_ELEMENT, { acceptNode: function(){ return 1; } }, false );
+      var walker = document.createTreeWalker( root, NodeFilter.SHOW_ELEMENT, { acceptNode: function(){ return 1; } } );
 
       while ( walker.nextNode() ) {
         var div = walker.currentNode;
         if ( (div.getAttribute("class") || "").toString().indexOf("unitTest") > -1 &&
             (!fragment || div.getAttribute("id") !== "nofragment") ) {
           // If we're display:none, we need to toggle that when doing computed
           //  style.
           var needToggle =
--- a/content/base/test/test_bug338541.xhtml
+++ b/content/base/test/test_bug338541.xhtml
@@ -16,17 +16,17 @@ https://bugzilla.mozilla.org/show_bug.cg
 /** Test for Bug 338541 **/
 function getName(aNode, f)
 {
   return (aNode ? aNode.nodeName : "(null)");
 }
 
 function walkDOM()
 {
-  var walker = document.createTreeWalker($('content'), NodeFilter.SHOW_ELEMENT, null, true);
+  var walker = document.createTreeWalker($('content'), NodeFilter.SHOW_ELEMENT, null);
   var output = "";
   while (walker.nextNode())
   {
     output += getName(walker.currentNode) + "\n";
   }
   output += "Final currentNode: " + getName(walker.currentNode);
   is(output, "foo\nbar\nhtml:b\nqux\nbaz\nFinal currentNode: baz","treewalker returns correct nodeName");
   SimpleTest.finish();
--- a/content/base/test/test_bug378969.html
+++ b/content/base/test/test_bug378969.html
@@ -23,17 +23,17 @@ function do_test()
 {
   var XHTMLDocString = '<html xmlns="http://www.w3.org/1999/xhtml">';
   XHTMLDocString += '<body><input/>input</body></html>';
 
   var doc = new DOMParser().parseFromString(XHTMLDocString, "application/xml");
 
   var body = doc.getElementsByTagName("body")[0];
   var filter = NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_TEXT;
-  var walker = doc.createTreeWalker(body, filter, null, false);
+  var walker = doc.createTreeWalker(body, filter, null);
   walker.currentNode = body.firstChild;
   walker.nextNode();
 
   ok("A" == "A", "A is A");
 
   SimpleTest.finish();
 }
 
--- a/content/base/test/test_bug559526.html
+++ b/content/base/test/test_bug559526.html
@@ -60,35 +60,32 @@ function filter(node) {
   );
   while (it.nextNode());
 })();
 
 (function testTreeWalker() {
   it = document.createTreeWalker(
     document.getElementById("nodes"),
     NodeFilter.SHOW_ELEMENT,
-    filter,
-    false
+    filter
   );
   while(it.nextNode());
 
   it = document.createTreeWalker(
     document.getElementById("nodes"),
     NodeFilter.SHOW_ELEMENT,
-    filter,
-    false
+    filter
   );
   it.firstChild();
   while(it.nextSibling());
 
   it = document.createTreeWalker(
     document.getElementById("nodes"),
     NodeFilter.SHOW_ELEMENT,
-    filter,
-    false
+    filter
   );
   it.lastChild();
   while(it.previousSibling());
 })();
 
 is(testCount, 4, "Should have tests 3 filter calls!");
 
 </script>
--- a/content/base/test/test_bug625722.html
+++ b/content/base/test/test_bug625722.html
@@ -22,17 +22,17 @@ https://bugzilla.mozilla.org/show_bug.cg
 function testNodeFilter(n) {
   if (n.id == 'A' || n.id == 'A1')
     return NodeFilter.FILTER_SKIP;
   return NodeFilter.FILTER_ACCEPT;
 }
 
 tw = document.createTreeWalker(document.getElementById("root"),
                                NodeFilter.SHOW_ELEMENT,
-                               testNodeFilter, false);
+                               testNodeFilter);
 
 node = tw.firstChild();
 is(node.id, 'B', "First accepted child of root not B");
 
 
 </script>
 </pre>
 </body>
--- a/content/base/test/test_bug628938.html
+++ b/content/base/test/test_bug628938.html
@@ -82,17 +82,17 @@ function regularWalk()
     [ false, "\n  " ],
     [ true, "SPAN" ],
     [ false, "\n  " ],
     [ true, "DIV" ],
     [ false, "foobar" ],
     [ false, "\n" ],
   ];
   var walker = document.createTreeWalker(document.getElementById('content'),
-                                         NodeFilter.SHOW_ALL, null, true);
+                                         NodeFilter.SHOW_ALL, null);
 
   walkTree(walker);
 
   gIdx = 0;
 }
 
 function noWhiteSpaceWalk()
 {
@@ -120,17 +120,17 @@ function noWhiteSpaceWalk()
                                          NodeFilter.SHOW_ALL,
                                          {
                                            acceptNode : function(node) {
                                              if (node.nodeType == Node.TEXT_NODE &&
                                                  !(/[^\t\n\r ]/.test(node.nodeValue)))
                                                return NodeFilter.FILTER_REJECT;
                                              return NodeFilter.FILTER_ACCEPT;
                                            }
-                                         }, true);
+                                         });
 
   walkTree(walker);
 
   gIdx = 0;
 }
 
 function onlyElementsWalk()
 {
@@ -143,17 +143,17 @@ function onlyElementsWalk()
     [ true, "SPAN" ],
     [ true, "DIV" ],
     [ true, "SPAN" ],
     [ true, "DIV" ],
     [ true, "SPAN" ],
     [ true, "DIV" ],
   ];
   var walker = document.createTreeWalker(document.getElementById('content'),
-                                         NodeFilter.SHOW_ELEMENT, null, true);
+                                         NodeFilter.SHOW_ELEMENT, null);
 
   walkTree(walker);
 
   gIdx = 0;
 }
 
 function onlyDivSubTreeWalk()
 {
@@ -182,17 +182,17 @@ function onlyDivSubTreeWalk()
 
                                              while (node) {
                                                if (node.nodeName == "DIV")
                                                  return NodeFilter.FILTER_ACCEPT;
                                                node = node.parentNode;
                                              }
                                              return NodeFilter.FILTER_SKIP;
                                            }
-                                         }, true);
+                                         });
 
   walkTree(walker);
 
   gIdx = 0;
 }
 
 function onlyDivDataWalk()
 {
@@ -215,17 +215,17 @@ function onlyDivDataWalk()
                                          {
                                            acceptNode : function(node) {
                                              if (node.nodeName == "DIV" ||
                                                  (node.parentNode &&
                                                   node.parentNode.nodeName == "DIV"))
                                                return NodeFilter.FILTER_ACCEPT;
                                              return NodeFilter.FILTER_SKIP;
                                            }
-                                         }, true);
+                                         });
 
   walkTree(walker);
 
   gIdx = 0;
 }
 
 regularWalk();
 noWhiteSpaceWalk();
--- a/content/base/test/test_elementTraversal.html
+++ b/content/base/test/test_elementTraversal.html
@@ -75,17 +75,17 @@ is(cc.length, 4, "wrong number of child 
 is(c.childElementCount, 4, "wrong number of child elements");
 
 contents.splice(2, 1);
 contents.splice(3, 1);
 testContent();
 
 tw = document.createTreeWalker(document.documentElement,
                                NodeFilter.SHOW_ELEMENT,
-                               null, false);
+                               null);
 e = document.documentElement;
 
 elemsTested = 0;
 done = false;
 while(!done) {
   is(tw.currentNode, e, "wrong element:" + tw.currentNode + " != " + e);
   elemsTested++;
   
--- a/content/base/test/test_treewalker_nextsibling.xml
+++ b/content/base/test/test_treewalker_nextsibling.xml
@@ -18,18 +18,17 @@ function setPass(aNode) {
 
 SimpleTest.waitForExplicitFinish();
 
 window.addEventListener("load", function() {
   const nsIDOMNodeFilter = SpecialPowers.Ci.nsIDOMNodeFilter;
   var walker = document.createTreeWalker(
     document,
     nsIDOMNodeFilter.SHOW_TEXT | nsIDOMNodeFilter.SHOW_DOCUMENT,
-    null,
-    true
+    null
   );
   setPass(walker.firstChild());
   while (walker.nextSibling()) {
     setPass(walker.currentNode);
   }
 
 /*
 From http://www.w3.org/TR/2000/REC-DOM-Level-2-Traversal-Range-20001113/traversal.html#Traversal-TreeWalker
@@ -38,17 +37,17 @@ is substantially different from the same
 document. Nodes that are siblings in the TreeWalker view may be children of
 different, widely separated nodes in the original view. For instance, consider a
 NodeFilter that skips all nodes except for Text nodes and the root node of a
 document. In the logical view that results, all text nodes will be siblings and
 appear as direct children of the root node, no matter how deeply nested the
 structure of the original document.
 */
 
-  walker2 = document.createTreeWalker(document, nsIDOMNodeFilter.SHOW_TEXT, null, true);
+  walker2 = document.createTreeWalker(document, nsIDOMNodeFilter.SHOW_TEXT, null);
   while (walker2.nextNode()) {
     var cNode = walker2.currentNode;
     ok(cNode.getUserData("pass"), "Every text node should appear: " + walker2.currentNode.nodeValue);
     walker.currentNode = cNode;
     var parent = walker.parentNode();
     is(parent, document, "parent of text node should be document");
 
     // Check nextSibling's previousSibling.
--- a/content/events/test/test_bug650493.html
+++ b/content/events/test/test_bug650493.html
@@ -13,17 +13,17 @@ https://bugzilla.mozilla.org/show_bug.cg
 <p id="display"></p>
 <div id="content" style="display: none">
   
 </div>
 <pre id="test">
 <script class="testbody" type="text/javascript">
 
 function getNodes() {
-  var walker = document.createTreeWalker($('content'), NodeFilter.SHOW_ALL, null, false);
+  var walker = document.createTreeWalker($('content'), NodeFilter.SHOW_ALL, null);
   var nodes = [];
   do {
     nodes.push(walker.currentNode);
   } while(walker.nextNode());
 
   return nodes;
 }
 
@@ -41,26 +41,26 @@ var mutateCount = 0;
 
 check();
 
 // Set up listeners
 root = $('content');
 root.addEventListener("DOMNodeInserted", function(e) {
   mutateCount++;
   is(e.isTrusted, true, "untrusted mutation event");
-  var w = document.createTreeWalker(e.target, NodeFilter.SHOW_ALL, null, false);
+  var w = document.createTreeWalker(e.target, NodeFilter.SHOW_ALL, null);
   do {
     is(nodes.indexOf(w.currentNode), -1, "already have inserted node (" + w.currentNode + ") when " + testName);
     nodes.push(w.currentNode);
   } while(w.nextNode());
 }, false);
 root.addEventListener("DOMNodeRemoved", function(e) {
   mutateCount++;
   is(e.isTrusted, true, "untrusted mutation event");
-  var w = document.createTreeWalker(e.target, NodeFilter.SHOW_ALL, null, false);
+  var w = document.createTreeWalker(e.target, NodeFilter.SHOW_ALL, null);
   do {
     var index = nodes.indexOf(w.currentNode);
     ok(index != -1, "missing removed node (" + w.currentNode + ") when " + testName);
     nodes.splice(index, 1);
   } while(w.nextNode());
 }, false);
 
 testName = "text-only innerHTML";
--- a/content/test/unit/test_isequalnode.js
+++ b/content/test/unit/test_isequalnode.js
@@ -369,20 +369,20 @@ function test_isEqualNode_null()
 }
 
 function test_isEqualNode_wholeDoc()
 {
   doc = ParseFile("isequalnode_data.xml");
   var doc2 = ParseFile("isequalnode_data.xml");
   var tw1 =
     doc.createTreeWalker(doc, Components.interfaces.nsIDOMNodeFilter.SHOW_ALL,
-                         null, false);
+                         null);
   var tw2 =
     doc2.createTreeWalker(doc2, Components.interfaces.nsIDOMNodeFilter.SHOW_ALL,
-                          null, false);
+                          null);
   do {
     check_eq_nodes(tw1.currentNode, tw2.currentNode);
     tw1.nextNode();
   } while(tw2.nextNode());
 }
 
 // UTILITY FUNCTIONS
 
--- a/content/test/unit/test_range.js
+++ b/content/test/unit/test_range.js
@@ -128,18 +128,17 @@ function evalXPathInDocumentFragment(aCo
       return C_i.nsIDOMNodeFilter.FILTER_ACCEPT;
     }
   };
 
   // Look for the node matching the step from the document fragment.
   var walker = aContextNode.ownerDocument.createTreeWalker(
                  aContextNode,
                  targetType,
-                 filter,
-                 true);
+                 filter);
   var targetNode = walker.nextNode();
   do_check_neq(targetNode, null);
 
   // Apply our remaining xpath to the found node.
   var expr = aContextNode.ownerDocument.createExpression(realPath, null);
   var result = expr.evaluate(targetNode, UNORDERED_TYPE, null);
   do_check_true(result instanceof C_i.nsIDOMXPathResult);
   return result.singleNodeValue;
@@ -182,18 +181,17 @@ function getParsedDocument(aPath) {
   do_check_true(doc.documentElement.localName != "parsererror");
   do_check_true(doc instanceof C_i.nsIDOMXPathEvaluator);
   do_check_true(doc instanceof C_i.nsIDOMDocument);
 
   // Clean out whitespace.
   var walker = doc.createTreeWalker(doc,
                                     C_i.nsIDOMNodeFilter.SHOW_TEXT |
                                     C_i.nsIDOMNodeFilter.SHOW_CDATA_SECTION,
-                                    isWhitespace,
-                                    false);
+                                    isWhitespace);
   while (walker.nextNode()) {
     var parent = walker.currentNode.parentNode;
     parent.removeChild(walker.currentNode);
     walker.currentNode = parent;
   }
 
   // Clean out mandatory splits between nodes.
   var splits = doc.getElementsByTagName("split");
@@ -274,18 +272,17 @@ function run_extract_test() {
     } else {
       do_check_eq(extractFrag.firstChild, null);
     }
     do_check_true(baseFrag.isEqualNode(resultFrag));
 
     dump("Ensure the original nodes weren't extracted - test " + i + "\n\n");
     var walker = doc.createTreeWalker(baseFrag,
 				      C_i.nsIDOMNodeFilter.SHOW_ALL,
-				      null,
-				      false);
+				      null);
     var foundStart = false;
     var foundEnd = false;
     do {
       if (walker.currentNode == startContainer) {
         foundStart = true;
       }
 
       if (walker.currentNode == endContainer) {
@@ -308,18 +305,17 @@ function run_extract_test() {
     var startContainer = baseRange.startContainer;
     var endContainer = baseRange.endContainer;
     baseRange.deleteContents();
     do_check_true(baseFrag.isEqualNode(resultFrag));
 
     dump("Ensure the original nodes weren't deleted - test " + i + "\n\n");
     walker = doc.createTreeWalker(baseFrag,
                                   C_i.nsIDOMNodeFilter.SHOW_ALL,
-                                  null,
-                                  false);
+                                  null);
     foundStart = false;
     foundEnd = false;
     do {
       if (walker.currentNode == startContainer) {
         foundStart = true;
       }
 
       if (walker.currentNode == endContainer) {
--- a/content/test/unit/test_treewalker.js
+++ b/content/test/unit/test_treewalker.js
@@ -14,13 +14,13 @@ function test_treeWalker_currentNode()
 {
   var XHTMLDocString = '<html xmlns="http://www.w3.org/1999/xhtml">';
   XHTMLDocString += '<body><input/>input</body></html>';
 
   var doc = ParseXML(XHTMLDocString);
 
   var body = doc.getElementsByTagName("body")[0];
   var filter = I.nsIDOMNodeFilter.SHOW_ELEMENT | I.nsIDOMNodeFilter.SHOW_TEXT;
-  var walker = doc.createTreeWalker(body, filter, null, false);
+  var walker = doc.createTreeWalker(body, filter, null);
   walker.currentNode = body.firstChild;
   walker.nextNode();
 }
 
--- a/dom/imptests/failures/webapps/DOMCore/tests/approved/test_interfaces.html.json
+++ b/dom/imptests/failures/webapps/DOMCore/tests/approved/test_interfaces.html.json
@@ -142,17 +142,17 @@
   "Stringification of document.createNodeIterator(document.body, NodeFilter.SHOW_ALL, null, false)": "debug",
   "TreeWalker interface: existence and properties of interface object": true,
   "TreeWalker interface: existence and properties of interface prototype object": true,
   "TreeWalker interface: existence and properties of interface prototype object's \"constructor\" property": true,
   "TreeWalker interface: attribute root": true,
   "TreeWalker interface: attribute whatToShow": true,
   "TreeWalker interface: attribute filter": true,
   "TreeWalker interface: attribute currentNode": true,
-  "Stringification of document.createTreeWalker(document.body, NodeFilter.SHOW_ALL, null, false)": "debug",
+  "Stringification of document.createTreeWalker(document.body, NodeFilter.SHOW_ALL, null)": "debug",
   "NodeFilter interface: existence and properties of interface object": true,
   "NodeFilter interface: existence and properties of interface prototype object": true,
   "NodeFilter interface: existence and properties of interface prototype object's \"constructor\" property": true,
   "NodeFilter interface: constant FILTER_ACCEPT on interface prototype object": true,
   "NodeFilter interface: constant FILTER_REJECT on interface prototype object": true,
   "NodeFilter interface: constant FILTER_SKIP on interface prototype object": true,
   "NodeFilter interface: constant SHOW_ALL on interface prototype object": true,
   "NodeFilter interface: constant SHOW_ELEMENT on interface prototype object": true,
--- a/dom/imptests/webapps/DOMCore/tests/approved/test_interfaces.html
+++ b/dom/imptests/webapps/DOMCore/tests/approved/test_interfaces.html
@@ -505,15 +505,15 @@ idlArray.add_objects({
 	DocumentType: ['document.doctype'],
 	Element: ['element'],
 	Attr: ['document.querySelector("[id]").attributes[0]'],
 	Text: ['document.createTextNode("abc")'],
 	ProcessingInstruction: ['xmlDoc.createProcessingInstruction("abc", "def")'],
 	Comment: ['document.createComment("abc")'],
 	Range: ['document.createRange()', 'detachedRange'],
 	NodeIterator: ['document.createNodeIterator(document.body, NodeFilter.SHOW_ALL, null, false)'],
-	TreeWalker: ['document.createTreeWalker(document.body, NodeFilter.SHOW_ALL, null, false)'],
+	TreeWalker: ['document.createTreeWalker(document.body, NodeFilter.SHOW_ALL, null)'],
 	NodeList: ['document.querySelectorAll("script")'],
 	HTMLCollection: ['document.body.children'],
 	DOMTokenList: ['document.body.classList'],
 });
 idlArray.test();
 </script>
--- a/dom/tests/mochitest/bugs/test_bug393974.html
+++ b/dom/tests/mochitest/bugs/test_bug393974.html
@@ -27,18 +27,17 @@ function test()
                                      {
                                        // force the closure to contain the
                                        // global object, in case a future
                                        // optimization might minimize the
                                        // function's captured environment
                                        if ("foo" + window == "fooPIRATES!")
                                          return NodeFilter.FILTER_ACCEPT;
                                        return NodeFilter.FILTER_REJECT;
-                                     },
-                                     true);
+                                     });
 
   // That should have been enough to create a leak, but we should do at least
   // a couple tests while we're here so that this document doesn't show up as
   // having no tests pass *or* fail.
 
   ok(tw.firstChild() === null, "shouldn't be a first child");
   ok(tw.currentNode === document, "should be unchanged");
 
--- a/embedding/components/webbrowserpersist/src/nsWebBrowserPersist.cpp
+++ b/embedding/components/webbrowserpersist/src/nsWebBrowserPersist.cpp
@@ -1622,17 +1622,17 @@ nsresult nsWebBrowserPersist::SaveDocume
         mDocList.AppendElement(docData);
 
         // Walk the DOM gathering a list of externally referenced URIs in the uri map
         nsCOMPtr<nsIDOMTreeWalker> walker;
         rv = aDocument->CreateTreeWalker(docAsNode, 
             nsIDOMNodeFilter::SHOW_ELEMENT |
                 nsIDOMNodeFilter::SHOW_DOCUMENT |
                 nsIDOMNodeFilter::SHOW_PROCESSING_INSTRUCTION,
-            nullptr, true, getter_AddRefs(walker));
+            nullptr, 1, getter_AddRefs(walker));
         NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE);
 
         nsCOMPtr<nsIDOMNode> currentNode;
         walker->GetCurrentNode(getter_AddRefs(currentNode));
         while (currentNode)
         {
             OnWalkDOMNode(currentNode);
             walker->NextNode(getter_AddRefs(currentNode));
--- a/js/xpconnect/tests/mochitest/test_bug505915.html
+++ b/js/xpconnect/tests/mochitest/test_bug505915.html
@@ -18,17 +18,17 @@ https://bugzilla.mozilla.org/show_bug.cg
 <script type="application/javascript;version=1.7">
 
 /** Test for Bug 505915 **/
 window.addEventListener("message", function () { gen.next() }, false);
 
 function go() {
     var ifr = $('ifr');
     try {
-        document.createTreeWalker(ifr.contentDocument, 0, null, false);
+        document.createTreeWalker(ifr.contentDocument, 0, null);
         ok(false, "should have thrown a security exception");
     } catch (e) {
         ok(/NS_ERROR_XPC_SECURITY_MANAGER_VETO/.test(e) ||
            /TypeError: Value does not implement interface Node/.test(e),
            "threw a security exception or binding exception instead of an " +
            "invalid child exception");
     }
 
--- a/parser/htmlparser/tests/mochitest/parser_datreader.js
+++ b/parser/htmlparser/tests/mochitest/parser_datreader.js
@@ -95,31 +95,31 @@ function test_parser(testlist) {
 
 /**
  * Transforms a DOM document to a string matching the format in 
  * the test cases.
  *
  * @param the DOM document
  */
 function docToTestOutput(doc) {
-  var walker = doc.createTreeWalker(doc, NodeFilter.SHOW_ALL, null, true);
+  var walker = doc.createTreeWalker(doc, NodeFilter.SHOW_ALL, null);
   return addLevels(walker, "", "| ").slice(0,-1); // remove the last newline
 }
 
 /**
  * Transforms the descendants of an element to a string matching the format
  * in the test cases.
  *
  * @param an element
  */
 function fragmentToTestOutput(elt) {
   var walker = elt.ownerDocument.createTreeWalker(elt, NodeFilter.SHOW_ALL, 
     function (node) { return elt == node ? 
                         NodeFilter.FILTER_SKIP : 
-                        NodeFilter.FILTER_ACCEPT; }, true);
+                        NodeFilter.FILTER_ACCEPT; });
   return addLevels(walker, "", "| ").slice(0,-1); // remove the last newline
 }
 
 function addLevels(walker, buf, indent) {
   if(walker.firstChild()) {
     do {
       buf += indent;
       switch (walker.currentNode.nodeType) {
--- a/toolkit/components/viewsource/content/viewSource.js
+++ b/toolkit/components/viewsource/content/viewSource.js
@@ -541,17 +541,17 @@ function findLocation(pre, line, node, o
   // id attributes in the format <pre id="line123">, meaning that
   // the first line in the pre element is number 123.
   // However, in the plain text case, there is only one <pre> without an id,
   // so assume line 1.
   var curLine = pre.id ? parseInt(pre.id.substring(4)) : 1;
 
   // Walk through each of the text nodes and count newlines.
   var treewalker = window.content.document
-      .createTreeWalker(pre, NodeFilter.SHOW_TEXT, null, false);
+      .createTreeWalker(pre, NodeFilter.SHOW_TEXT, null);
 
   // The column number of the first character in the current text node.
   var firstCol = 1;
 
   var found = false;
   for (var textNode = treewalker.firstChild();
        textNode && !found;
        textNode = treewalker.nextNode()) {
--- a/toolkit/content/widgets/button.xml
+++ b/toolkit/content/widgets/button.xml
@@ -108,17 +108,17 @@
 
       <method name="fireAccessKeyButton">
         <parameter name="aSubtree"/>
         <parameter name="aAccessKeyLower"/>
         <body>
         <![CDATA[
           var iterator = aSubtree.ownerDocument.createTreeWalker(aSubtree, 
                                                                  NodeFilter.SHOW_ELEMENT, 
-                                                                 this.filterButtons, false);
+                                                                 this.filterButtons);
           while (iterator.nextNode()) {
             var test = iterator.currentNode;
             if (test.accessKey.toLowerCase() == aAccessKeyLower && 
                 !test.disabled && !test.collapsed && !test.hidden) {
               test.focus();
               test.click();
               return true;
             }
--- a/toolkit/content/widgets/radio.xml
+++ b/toolkit/content/widgets/radio.xml
@@ -255,18 +255,17 @@
           if (this.hasChildNodes()) {
             // Don't store the collected child nodes immediately,
             // collecting the child nodes could trigger constructors
             // which would blow away our list.
 
             const nsIDOMNodeFilter = Components.interfaces.nsIDOMNodeFilter;
             var iterator = doc.createTreeWalker(this,
                                                 nsIDOMNodeFilter.SHOW_ELEMENT,
-                                                this._filterRadioGroup,
-                                                true);
+                                                this._filterRadioGroup);
             while (iterator.nextNode())
               radioChildren.push(iterator.currentNode);
             return this._radioChildren = radioChildren;
           }
 
           // We don't have child nodes.
           const XUL_NS = "http://www.mozilla.org/keymaster/"
                        + "gatekeeper/there.is.only.xul";
--- a/toolkit/content/widgets/text.xml
+++ b/toolkit/content/widgets/text.xml
@@ -184,18 +184,17 @@
 
       <method name="wrapChar">
         <parameter name="element"/>
         <parameter name="index"/>
         <body>
           <![CDATA[
              var treeWalker = document.createTreeWalker(this,
                                                         NodeFilter.SHOW_TEXT,
-                                                        null,
-                                                        true);
+                                                        null);
              var node = treeWalker.nextNode();
              while (index >= node.length) {
                index -= node.length;
                node = treeWalker.nextNode();
              }
              if (index) {
                node = node.splitText(index);
              }