167009 - We should be using the node type constants defined on Node instead of their numerical expression.

r=glazman rs=bzbarsky a=asa
This commit is contained in:
caillon%returnzero.com 2002-09-07 00:55:05 +00:00
Родитель d8353542f2
Коммит bc7c8c2816
8 изменённых файлов: 15 добавлений и 14 удалений

Просмотреть файл

@ -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);

Просмотреть файл

@ -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;

Просмотреть файл

@ -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;
}

Просмотреть файл

@ -20,7 +20,7 @@
<rdf:li><rdf:Description
ins:uid="domNode"
ins:description="DOM Node"
ins:filter="return doesQI(object, 'nsIDOMNode') &amp;&amp; object.nodeType != 9;"/>
ins:filter="return doesQI(object, 'nsIDOMNode') &amp;&amp; object.nodeType != Node.DOCUMENT_NODE;"/>
</rdf:li>
<rdf:li><rdf:Description

Просмотреть файл

@ -170,7 +170,7 @@ inSearchModule.prototype =
var col, data;
for (var i= 0; i < kids.length; ++i) {
col = kids[i];
if (col.nodeType == 1) { // ignore non-element nodes
if (col.nodeType == Node.ELEMENT_NODE) { // ignore non-element nodes
data = {
name: col.getAttribute("name"),
title: col.getAttribute("title"),
@ -427,7 +427,7 @@ inSearchModule.prototype =
installSearchReference: function(aItem)
{
if (aItem.nodeType == 1) {
if (aItem.nodeType == Node.ELEMENT_NODE) {
if (aItem.localName == "menuitem") {
aItem.search = this.mImpl;
for (var i = 0; i < aItem.childNodes.length; ++i)

Просмотреть файл

@ -348,7 +348,7 @@ DOMViewer.prototype =
indent += " ";
var line = indent;
if (aNode.nodeType == 1) {
if (aNode.nodeType == Node.ELEMENT_NODE) {
line += "<" + aNode.localName;
var attrIndent = "";
@ -375,9 +375,9 @@ DOMViewer.prototype =
s += this._toXML(aNode.childNodes[i], aLevel+1);
s += indent + "</" + aNode.localName + ">\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 + "<!--" + aNode.nodeValue + "-->\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)

Просмотреть файл

@ -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);

Просмотреть файл

@ -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();
}
}