mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1223523. The named getter on document should not return images with an empty name. r=peterv
This commit is contained in:
parent
3aeb07f68e
commit
90b1f50abc
@ -960,10 +960,16 @@ public:
|
||||
static inline bool
|
||||
ShouldExposeIdAsHTMLDocumentProperty(Element* aElement)
|
||||
{
|
||||
return aElement->IsAnyOfHTMLElements(nsGkAtoms::img,
|
||||
nsGkAtoms::applet,
|
||||
nsGkAtoms::embed,
|
||||
nsGkAtoms::object);
|
||||
if (aElement->IsAnyOfHTMLElements(nsGkAtoms::applet,
|
||||
nsGkAtoms::embed,
|
||||
nsGkAtoms::object)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Per spec, <img> is exposed by id only if it also has a nonempty
|
||||
// name (which doesn't have to match the id or anything).
|
||||
// HasName() is true precisely when name is nonempty.
|
||||
return aElement->IsHTMLElement(nsGkAtoms::img) && aElement->HasName();
|
||||
}
|
||||
|
||||
static bool
|
||||
|
@ -1,5 +1,3 @@
|
||||
{
|
||||
"If there are two imgs, a collection should be returned. (name)": true,
|
||||
"If there is one img, it should not be returned (id)": true,
|
||||
"If there are two imgs, nothing should be returned. (id)": true
|
||||
"If there are two imgs, a collection should be returned. (name)": true
|
||||
}
|
||||
|
@ -63,9 +63,7 @@ test(function() {
|
||||
assert_equals(img2.id, "test4");
|
||||
|
||||
assert_false("test4" in document, '"test4" in document should be false');
|
||||
var collection = document.test4;
|
||||
assert_class_string(collection, "HTMLCollection", "collection should be an HTMLCollection");
|
||||
assert_array_equals(collection, [img1, img2]);
|
||||
assert_equals(document.test4, undefined);
|
||||
}, "If there are two imgs, nothing should be returned. (id)");
|
||||
|
||||
test(function() {
|
||||
|
@ -2,10 +2,3 @@
|
||||
type: testharness
|
||||
[If there are two imgs, a collection should be returned. (name)]
|
||||
expected: FAIL
|
||||
|
||||
[If there is one img, it should not be returned (id)]
|
||||
expected: FAIL
|
||||
|
||||
[If there are two imgs, nothing should be returned. (id)]
|
||||
expected: FAIL
|
||||
|
||||
|
@ -15,7 +15,7 @@
|
||||
<img id=test3>
|
||||
|
||||
<img id=test4>
|
||||
<img id=test4>
|
||||
<img id=test4 name="">
|
||||
|
||||
<img name=test5>
|
||||
<img id=test5>
|
||||
|
Loading…
Reference in New Issue
Block a user