Permalink
Browse files

Use node constants

  • Loading branch information...
1 parent 66f5c0c commit 354a0bf722a4879e72782f00f72dbe3f72f5e95d @sroussey sroussey committed Aug 14, 2012
Showing with 4 additions and 5 deletions.
  1. +1 −3 extension/content/firebug/chrome/reps.js
  2. +3 −2 extension/content/firebug/console/commandLine.js
@@ -701,7 +701,6 @@ FirebugReps.Arr = domplate(Firebug.Rep,
},
// http://code.google.com/p/fbug/issues/detail?id=874
- // BEGIN Yahoo BSD Source (modified here) YAHOO.lang.isArray, YUI 2.2.2 June 2007
isArray: function(obj, win)
{
win = win || window;
@@ -746,8 +745,7 @@ FirebugReps.Arr = domplate(Firebug.Rep,
return false;
},
- // END Yahoo BSD SOURCE See license below.
-
+
getTitle: function(object, context)
{
return "[" + object.length + "]";
@@ -1052,7 +1052,7 @@ function FirebugCommandLineAPI(context)
this.$ = function(selector, start) // returns unwrapped elements from the page
{
var result;
- if (start && start.querySelector && (start.nodeType == 1 || start.nodeType == 9 || start.nodeType == 11))
+ if (start && start.querySelector && (start.nodeType == Node.ELEMENT_NODE || start.nodeType == Node.DOCUMENT_NODE || start.nodeType == Node.DOCUMENT_FRAGMENT_NODE))
result = start.querySelector(selector);
else
{
@@ -1062,6 +1062,7 @@ function FirebugCommandLineAPI(context)
result = Wrapper.unwrapObject(context.baseWindow.document).querySelector("#" + selector);
if (result != null)
{
+ // This should be removed in the next minor (non-bugfix) version
Firebug.Console.log("The console function $() has changed from $=getElementById(id) to $=querySelector(selector). You might try $(\"#" + selector + "\")", context, "warn");
result = null;
}
@@ -1073,7 +1074,7 @@ function FirebugCommandLineAPI(context)
this.$$ = function(selector, start) // returns unwrapped elements from the page
{
var result;
- if (start && start.querySelectorAll && (start.nodeType == 1 || start.nodeType == 9 || start.nodeType == 11))
+ if (start && start.querySelectorAll && (start.nodeType == Node.ELEMENT_NODE || start.nodeType == Node.DOCUMENT_NODE || start.nodeType == Node.DOCUMENT_FRAGMENT_NODE))
result = start.querySelectorAll(selector);
else
result = Wrapper.unwrapObject(context.baseWindow.document).querySelectorAll(selector);

0 comments on commit 354a0bf

Please sign in to comment.