diff --git a/content/html/document/src/nsHTMLDocument.cpp b/content/html/document/src/nsHTMLDocument.cpp index 7da66fdafaa..d2d8bc9c78c 100644 --- a/content/html/document/src/nsHTMLDocument.cpp +++ b/content/html/document/src/nsHTMLDocument.cpp @@ -3158,12 +3158,19 @@ DocAllResultMatch(nsIContent* aContent, PRInt32 aNamespaceID, nsIAtom* aAtom, } nsIAtom* tag = elm->Tag(); - if (tag != nsGkAtoms::img && - tag != nsGkAtoms::form && + if (tag != nsGkAtoms::a && tag != nsGkAtoms::applet && - tag != nsGkAtoms::embed && + tag != nsGkAtoms::button && + tag != nsGkAtoms::embed && + tag != nsGkAtoms::form && + tag != nsGkAtoms::iframe && + tag != nsGkAtoms::img && + tag != nsGkAtoms::input && + tag != nsGkAtoms::map && + tag != nsGkAtoms::meta && tag != nsGkAtoms::object && - tag != nsGkAtoms::input) { + tag != nsGkAtoms::select && + tag != nsGkAtoms::textarea) { return PR_FALSE; } diff --git a/content/html/document/test/Makefile.in b/content/html/document/test/Makefile.in index b211ad4fbf8..35fd3946055 100644 --- a/content/html/document/test/Makefile.in +++ b/content/html/document/test/Makefile.in @@ -70,6 +70,7 @@ _TEST_FILES = test_bug1682.html \ test_bug404320.html \ test_form-parsing.html \ test_viewport.html \ + test_documentAll.html \ $(NULL) libs:: $(_TEST_FILES) diff --git a/content/html/document/test/test_documentAll.html b/content/html/document/test/test_documentAll.html new file mode 100644 index 00000000000..6e955888fc8 --- /dev/null +++ b/content/html/document/test/test_documentAll.html @@ -0,0 +1,155 @@ + + +
+ ++
+ ++ ++ + + diff --git a/dom/src/base/nsDOMClassInfo.cpp b/dom/src/base/nsDOMClassInfo.cpp index 02ac768cf42..9a36af70218 100644 --- a/dom/src/base/nsDOMClassInfo.cpp +++ b/dom/src/base/nsDOMClassInfo.cpp @@ -8172,6 +8172,8 @@ nsHTMLDocumentSH::DocumentAllGetProperty(JSContext *cx, JSObject *obj, } *vp = INT_TO_JSVAL(length); + + return JS_TRUE; } else if (id != sTags_id) { // For all other strings, look for an element by id or name. @@ -8185,7 +8187,7 @@ nsHTMLDocumentSH::DocumentAllGetProperty(JSContext *cx, JSObject *obj, return JS_FALSE; } } - } else if (JSVAL_TO_INT(id) >= 0) { + } else if (JSVAL_IS_INT(id) && JSVAL_TO_INT(id) >= 0) { // Map document.all[n] (where n is a number) to the n:th item in // the document.all node list.