Bug 9354 - [JustNeedsTest] Dynamically added elements should take priority in getElementById (???)
Summary: [JustNeedsTest] Dynamically added elements should take priority in getElement...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Nobody
URL: http://tijej.dyndns.org/WebKitBug/ind...
Keywords: HasReduction
Depends on:
Blocks:
 
Reported: 2006-06-08 00:36 PDT by Jérome Foucher
Modified: 2010-10-08 15:20 PDT (History)
5 users (show)

See Also:


Attachments
PHP files (3.16 KB, application/octet-stream)
2006-06-08 00:39 PDT, Jérome Foucher
no flags Details
test case (1.07 KB, text/html)
2006-07-28 04:03 PDT, Alexey Proskuryakov
no flags Details
Patch (2.59 KB, patch)
2010-10-08 14:45 PDT, Adam Barth
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jérome Foucher 2006-06-08 00:36:58 PDT
My page has a first popup that is filled with the contents of a table stored in a mySQL database.
It lets you select a department.

Using Ajax, when the user selected a department, I then show a second popup that lists all the laboratories inside the selected department.

This second popup also uses Ajax to show a third popup that lists all the employees of the selected laboratory.

The first connection popup1->popup2 works nicely.
However, the second connection popup2->popup3 does not work. WebKit does not seem to "see" the onchange action of the newly created popup2.

Note that this works correctly on FireFox and Camino.

http://tijej.dyndns.org/WebKitBug/index.php is a simple showcase of the problem
Comment 1 Jérome Foucher 2006-06-08 00:39:21 PDT
Created attachment 8767 [details]
PHP files
Comment 2 Alexey Proskuryakov 2006-07-28 04:03:47 PDT
Created attachment 9736 [details]
test case
Comment 3 Alexey Proskuryakov 2006-07-28 04:18:16 PDT
The problem here is that multiple elements get the same "labo" id, which of course causes problems with getElementById().

It might be desirable for WebKit to better match Firefox in this case, though. Could defining error handling in case of duplicate ids be in scope of HTML5?
Comment 4 Adam Barth 2010-10-08 13:58:20 PDT
Looks like Firefox matchs us on this test case now.  We should probably keep our current behavior and land a test.
Comment 5 Adam Barth 2010-10-08 14:45:25 PDT
Created attachment 70293 [details]
Patch
Comment 6 WebKit Commit Bot 2010-10-08 15:20:02 PDT
Comment on attachment 70293 [details]
Patch

Clearing flags on attachment: 70293

Committed r69425: <http://trac.webkit.org/changeset/69425>
Comment 7 WebKit Commit Bot 2010-10-08 15:20:08 PDT
All reviewed patches have been landed.  Closing bug.