diff --git a/extensions/inspector/resources/content/Flasher.js b/extensions/inspector/resources/content/Flasher.js
index 32278992045..43dacec5a44 100644
--- a/extensions/inspector/resources/content/Flasher.js
+++ b/extensions/inspector/resources/content/Flasher.js
@@ -89,7 +89,7 @@ Flasher.prototype =
get element() { return this.mElement; },
set element(val)
{
- if (val && val.nodeType == 1) {
+ if (val && val.nodeType == Node.ELEMENT_NODE) {
this.mElement = val;
if ("scrollIntoView" in val) {
val.scrollIntoView(false);
diff --git a/extensions/inspector/resources/content/browserOverlay.xul b/extensions/inspector/resources/content/browserOverlay.xul
index ca14ad2de6d..4ce6a9aa59e 100644
--- a/extensions/inspector/resources/content/browserOverlay.xul
+++ b/extensions/inspector/resources/content/browserOverlay.xul
@@ -41,7 +41,7 @@
function inspectorGetContextNode()
{
var n = document.popupNode;
- while (n && n.nodeType != 1)
+ while (n && n.nodeType != Node.ELEMENT_NODE)
n = n.parentNode;
return n;
diff --git a/extensions/inspector/resources/content/inspector.js b/extensions/inspector/resources/content/inspector.js
index e1c9f75d905..8b7ac1899ee 100644
--- a/extensions/inspector/resources/content/inspector.js
+++ b/extensions/inspector/resources/content/inspector.js
@@ -124,9 +124,9 @@ InspectorApp.prototype =
this.mObjectPanel = this.mPanelSet.getPanel(1);
if (this.mInitTarget) {
- if (this.mInitTarget.nodeType == 9)
+ if (this.mInitTarget.nodeType == Node.DOCUMENT_NODE)
this.setTargetDocument(this.mInitTarget);
- else if (this.mInitTarget.nodeType == 1) {
+ else if (this.mInitTarget.nodeType == Node.ELEMENT_NODE) {
this.setTargetDocument(this.mInitTarget.ownerDocument);
this.mDocPanel.params = this.mInitTarget;
}
diff --git a/extensions/inspector/resources/content/res/viewer-registry.rdf b/extensions/inspector/resources/content/res/viewer-registry.rdf
index 206fb5dcd0c..9b1be880c45 100644
--- a/extensions/inspector/resources/content/res/viewer-registry.rdf
+++ b/extensions/inspector/resources/content/res/viewer-registry.rdf
@@ -20,7 +20,7 @@
+ ins:filter="return doesQI(object, 'nsIDOMNode') && object.nodeType != Node.DOCUMENT_NODE;"/>
\n";
}
- } else if (aNode.nodeType == 3) {
+ } else if (aNode.nodeType == Node.TEXT_NODE) {
s += aNode.nodeValue;
- } else if (aNode.nodeType == 8) {
+ } else if (aNode.nodeType == Node.COMMENT_NODE) {
s += line + "\n";
}
@@ -655,7 +655,8 @@ DOMViewer.prototype =
{
// make sure we only try to flash element nodes, and don't
// flash the documentElement (it's too darn big!)
- if (aElement.nodeType == 1 && aElement != aElement.ownerDocument.documentElement) {
+ if (aElement.nodeType == Node.ELEMENT_NODE &&
+ aElement != aElement.ownerDocument.documentElement) {
var flasher = this.flasher;
if (flasher.flashing)
diff --git a/extensions/inspector/resources/content/viewers/domNode/domNode.js b/extensions/inspector/resources/content/viewers/domNode/domNode.js
index 3916dca07b4..d671f85552c 100644
--- a/extensions/inspector/resources/content/viewers/domNode/domNode.js
+++ b/extensions/inspector/resources/content/viewers/domNode/domNode.js
@@ -111,7 +111,7 @@ DOMNodeViewer.prototype =
this.mSubject = aObject;
var deck = document.getElementById("dkContent");
- if (aObject.nodeType == 1) {
+ if (aObject.nodeType == Node.ELEMENT_NODE) {
deck.setAttribute("selectedIndex", 0);
this.setTextValue("nodeName", aObject.nodeName);
diff --git a/extensions/inspector/resources/content/viewers/xblBindings/xblBindings.js b/extensions/inspector/resources/content/viewers/xblBindings/xblBindings.js
index 19791c3a7bc..0b7f37c3695 100644
--- a/extensions/inspector/resources/content/viewers/xblBindings/xblBindings.js
+++ b/extensions/inspector/resources/content/viewers/xblBindings/xblBindings.js
@@ -490,7 +490,7 @@ function ResourceTreeView(aBinding)
if (res && res.length) {
var kids = res[0].childNodes;
for (var i = 0; i < kids.length; ++i)
- if (kids[i].nodeType == 1)
+ if (kids[i].nodeType == Node.ELEMENT_NODE)
list.push(kids[i]);
}
@@ -519,4 +519,4 @@ function(aRow, aColId)
function gDocLoadListener()
{
viewer.doDisplayBinding();
-}
\ No newline at end of file
+}