Bug 49701 - external script runs more than once in a XML document when the script element is cloned
Summary: external script runs more than once in a XML document when the script element...
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Ryosuke Niwa
Keywords: EasyFix
Depends on:
Blocks: 49703
  Show dependency treegraph
Reported: 2010-11-17 17:24 PST by Ryosuke Niwa
Modified: 2010-11-23 16:00 PST (History)
8 users (show)

See Also:

Patch (3.86 KB, patch)
2010-11-17 17:47 PST, Ryosuke Niwa
abarth: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ryosuke Niwa 2010-11-17 17:24:43 PST
XMLDocumentParser::notifyFinished calls ScriptController::executeScript directly and fails to set isEvaluated flag to true.
We should call ScriptElement's executeScript instead.
Comment 1 Ryosuke Niwa 2010-11-17 17:47:39 PST
Created attachment 74185 [details]
Comment 2 Alexey Proskuryakov 2010-11-17 18:37:25 PST
I'm wondering what should happen to scripts inside SVG <use>.
Comment 3 Ryosuke Niwa 2010-11-17 18:39:32 PST
From the bug 49647:

(In reply to comment #2)
> > WebCore/dom/ScriptElement.h:90
> > +    bool m_isEvaluated; // HTML5: "already started"
> Better names for these data members, that would obviate the need for those HTML5 comments:
>     m_wasAlreadyStarted

This really annoyed me when I first looked at this code.  I'm glad I can finally correct this.
Comment 4 Ryosuke Niwa 2010-11-17 18:41:08 PST
oops wrong bug, please ignore my comment #3.
Comment 5 Ryosuke Niwa 2010-11-23 15:41:32 PST
Thanks for the review, Adam.  Will land.
Comment 6 Ryosuke Niwa 2010-11-23 16:00:03 PST
Committed r72638: <http://trac.webkit.org/changeset/72638>