Bug 25130

Summary: onclick not fired for an element copied with cloneContents() or cloneNode()
Product: WebKit Reporter: Mnafred Staudinger <manfred.staudinger@gmail.com>
Component: XML DOMAssignee: Alexey Proskuryakov <ap@webkit.org>
Status: RESOLVED FIXED    
Severity: Normal CC: abarth@webkit.org, ap@webkit.org, dbates@webkit.org, gessos.paul@yahoo.gr, ggaren@apple.com, pfeldman@chromium.org, sam@webkit.org
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
URL: http://documenta.rudolphina.org/temp/Ind_Pers_de.html
Attachments:
Description Flags
test case
none
proposed fix
none
now with Windows build fix sam: review+

Description From 2009-04-10 02:36:59 PST
If you click on the "Q" label (an anchor), the onclick="toggleInto(event, 'Index_Q_div')" starts a javascript to retrieve a list of names and insert them into the document. On each name there is again an onclick="toggleInto(event, 'uniqueId')" specified, but now the javascript does _not_ get control and the content gets displayed on a separate page. It works as expected in Firefox 3.0.8 and Opera 9.64.
------- Comment #1 From 2009-04-10 09:24:46 PST -------
Created an attachment (id=29391) [details]
test case
------- Comment #2 From 2009-04-10 09:25:13 PST -------
See also: bug 23318.
------- Comment #3 From 2009-09-22 09:44:31 PST -------
*** Bug 29533 has been marked as a duplicate of this bug. ***
------- Comment #4 From 2009-09-24 16:36:09 PST -------
Created an attachment (id=40092) [details]
proposed fix
------- Comment #5 From 2009-09-24 16:38:43 PST -------
CC'ing Adam, since this slightly touches XSSAuditor, and could be security sensitive in general.
------- Comment #6 From 2009-09-24 16:48:51 PST -------
This patch appears to largely undo a recent patch by Sam.  Maybe I'm confusing two things.
------- Comment #7 From 2009-09-24 17:56:41 PST -------
(In reply to comment #6)
> This patch appears to largely undo a recent patch by Sam.  Maybe I'm confusing
> two things.

This isn't actually touching the same code, I added global objects to some other callback objects, but it is a very similar case.  I need to think about when/if passing the scriptExecutionContext() won't work where storing a globalObject would.
------- Comment #8 From 2009-09-25 13:15:39 PST -------
(In reply to comment #7)
> (In reply to comment #6)
> > This patch appears to largely undo a recent patch by Sam.  Maybe I'm confusing
> > two things.
> 
> This isn't actually touching the same code, I added global objects to some
> other callback objects, but it is a very similar case.  I need to think about
> when/if passing the scriptExecutionContext() won't work where storing a
> globalObject would.

After thinking this over, I think this is the right direction to go and we should convert our other callback objects to use the same technique. r=me as well.
------- Comment #9 From 2009-09-25 13:45:17 PST -------
Committed revision 48767.
------- Comment #10 From 2009-09-25 17:22:58 PST -------
Fix reverted in r48778, because it broke Windows build, and we don't yet know how to fix it.
------- Comment #11 From 2009-09-26 01:33:37 PST -------
(From update of attachment 40092 [details])
Sad.  Marking r- since this was reverted.  Hopefully a fix can be found soon! :)
------- Comment #12 From 2009-09-27 02:45:54 PST -------
WebCore/ChangeLog has been corrupted while reverting. Restored.

Committing to http://svn.webkit.org/repository/webkit/trunk ...
    M    WebCore/ChangeLog
Committed r48800
------- Comment #13 From 2009-09-28 18:55:55 PST -------
Created an attachment (id=40278) [details]
now with Windows build fix
------- Comment #14 From 2009-09-29 11:05:32 PST -------
Committed revision 48884.
------- Comment #15 From 2009-09-29 11:40:08 PST -------
Build fix in r48887.