Bug 5449 - OBJECT should be accessible by id/name as document property only if its only children are PARAMs
Summary: OBJECT should be accessible by id/name as document property only if its only ...
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Dave Hyatt
Depends on:
Reported: 2005-10-21 02:15 PDT by mitz
Modified: 2005-10-25 01:47 PDT (History)
0 users

See Also:

testcase (2.79 KB, text/html)
2005-10-21 02:20 PDT, mitz
no flags Details
Approximate IE's behavior (6.29 KB, patch)
2005-10-21 02:22 PDT, mitz
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description mitz 2005-10-21 02:15:10 PDT
(Separated from bug 5432)
Object elements with a name or id are accessible as special properties of the document object (document
['objectname'] or document['objectid']). To better match IE's behavior, an object element should be a 
document property only when it has no children other than param elements.
Comment 1 mitz 2005-10-21 02:20:06 PDT
Created attachment 4434 [details]
Comment 2 mitz 2005-10-21 02:22:19 PDT
Created attachment 4435 [details]
Approximate IE's behavior

IE doesn't allow HTML comments inside the object and this patch allows them
(since they're not in the DOM tree).
Comment 3 Darin Adler 2005-10-22 08:48:54 PDT
Comment on attachment 4435 [details]
Approximate IE's behavior

Looks good. I'd like to see one comment in
HTMLObjectElementImpl::updateDocNamedItem() saying that the rule is "<object>
elements with no children other than <param> elements and whitespace can be
found by name in a document, and other <object> elements cannot"

But the code looks perfect to me.
Comment 4 David Harrison 2005-10-24 14:42:45 PDT
Committed.  Added test as fast/js/object-by-name-or-id.html