root/trunk/LayoutTests/fast/dom/HTMLDocument/document-special-properties-expected.txt

Revision 19979, 3.2 KB (checked in by andersca, 3 years ago)

LayoutTests:

Reviewed by Maciej.

< rdar://problem/5035045>
REGRESSION: WebKit browser doesn't display image at  http://www.metoffice.gov.uk/weather/satellite/index.html


Add some tests where image elements have id _and_ name elements.


  • fast/dom/HTMLDocument/document-special-properties-expected.txt:
  • fast/dom/HTMLDocument/document-special-properties.html:

WebCore:

Reviewed by Maciej.

< rdar://problem/5035045>
REGRESSION: WebKit browser doesn't display image at  http://www.metoffice.gov.uk/weather/satellite/index.html


It turns out WinIE does allow you to access images by their id as special document properties. However, this is only
allowed when the element also has a name attribute. The value of the name attribute is ignored and can even be empty!


  • bindings/js/kjs_html.cpp: (KJS::JSHTMLDocument::namedItemGetter): Return jsUndefined() if the collection is empty.


  • html/HTMLImageElement.cpp: (WebCore::HTMLImageElement::parseMappedAttribute): (WebCore::HTMLImageElement::insertedIntoDocument): (WebCore::HTMLImageElement::removedFromDocument):
  • html/HTMLImageElement.h: Add the id attribute value to the extra named item map.


  • html/HTMLNameCollection.cpp: (WebCore::HTMLNameCollection::traverseNextItem): Check for images with name attributes that match, as well as elements with id attributes that match where the element also has a name attribute.
  • Property svn:eol-style set to native
Line 
1This test covers the various ways of accessing DOM elements through the document object by name, id or index, directly as properties of the document object. This lookup is supposed to include applet, embed, form, image, object and iframe by name, but only applet and object by id. It should give the element itself in the case of a single match, or an HTMLCollection in the case of multiple matches; except that when exactly one item that is an iframe matches, it will give the window object for that iframe.
2
3Our results match IE.
4
5Results:
6
7Nonexistent image name: undefined
8Image by name (unique): single IMG(name)
9Image by name (multiple): collection(2) IMG(name) IMG(name)
10Image by id (unique): undefined
11Image by id (multiple): undefined
12Image by id/name mixed: collection(2) IMG(name) IMG(name)
13Image by id, name present (unique): single IMG(id,name)
14Image by id, empty name present (unique): single IMG(id)
15Image by id, name present (multiple): collection(2) IMG(id,name) IMG(id,name)
16Image by name, id present (unique): single IMG(id,name)
17
18Nonexistent form name: undefined
19Form by name (unique): single FORM(name)
20Form by name (multiple): collection(2) FORM(name) FORM(name)
21Form by id (unique): undefined
22Form by id (multiple): undefined
23Form by id/name mixed: collection(2) FORM(name) FORM(name)
24
25Nonexistent applet name: undefined
26Applet by name (unique): single APPLET(name)
27Applet by name (multiple): collection(2) APPLET(name) APPLET(name)
28Applet by id (unique): single APPLET(id)
29Applet by id (multiple): collection(2) APPLET(id) APPLET(id)
30Applet by id/name mixed: collection(4) APPLET(id) APPLET(name) APPLET(name) APPLET(id)
31
32Nonexistent object name: undefined
33Object by name (unique): single OBJECT(name)
34Object by name (multiple): collection(2) OBJECT(name) OBJECT(name)
35Object by id (unique): single OBJECT(id)
36Object by id (multiple): collection(2) OBJECT(id) OBJECT(id)
37Object by id/name mixed: collection(4) OBJECT(id) OBJECT(name) OBJECT(name) OBJECT(id)
38
39Nonexistent embed name: undefined
40Embed by name (unique): single EMBED(name)
41Embed by name (multiple): collection(2) EMBED(name) EMBED(name)
42Embed by id (unique): undefined
43Embed by id (multiple): undefined
44Embed by id/name mixed: collection(2) EMBED(name) EMBED(name)
45
46Nonexistent iframe name: undefined
47Iframe by name (unique): single WINDOW
48Iframe by name (multiple): collection(2) IFRAME(name) IFRAME(name)
49Iframe by id (unique): undefined
50Iframe by id (multiple): undefined
51Iframe by id/name mixed: collection(2) IFRAME(name) IFRAME(name)
52
53Nonexistent span name: undefined
54Span by name (unique): undefined
55Span by name (multiple): undefined
56Span by id (unique): undefined
57Span by id (multiple): undefined
58Span by id/name mixed: undefined
59
60Mixed by id: collection(2) APPLET(id) OBJECT(id)
61Mixed by name: collection(6) IMG(name) FORM(name) APPLET(name) EMBED(name) OBJECT(name) IFRAME(name)
62Mixed by id (no iframe): collection(2) APPLET(id) OBJECT(id)
63Mixed by name (no iframe): collection(5) IMG(name) FORM(name) APPLET(name) EMBED(name) OBJECT(name)
64
65Numeric 0: undefined
66Numeric 12: undefined
67Numeric 13: undefined
68
69Conflicting image: single IMG(name)
70Conflicting image (custom property): single IMG(name)
71Conflicting iframe: single WINDOW
72
Note: See TracBrowser for help on using the browser.