Open
Bug 500612
Opened 15 years ago
Updated 2 years ago
Scripts should run upon </script> even if script parent has been removed from the tree
Categories
(Core :: DOM: HTML Parser, defect)
Tracking
()
ASSIGNED
People
(Reporter: hsivonen, Assigned: hsivonen)
References
Details
(Keywords: html5)
Attachments
(1 file)
783 bytes,
patch
|
Details | Diff | Splinter Review |
From bug 487949: > >+ nsCOMPtr<nsIScriptElement> sele = do_QueryInterface(mScriptElement); > >+ > >+ // Notify our document that we're loading this script. > >+ nsCOMPtr<nsIHTMLDocument> htmlDocument = do_QueryInterface(mDocument); > >+ NS_ASSERTION(htmlDocument, "Document didn't QI into HTML document."); > >+ htmlDocument->ScriptLoading(sele); > >+ > >+ // Copied from nsXMLContentSink > >+ > >+ // Now tell the script that it's ready to go. This may execute the script > >+ // or return NS_ERROR_HTMLPARSER_BLOCK. Or neither if the script doesn't > >+ // need executing. > >+ nsresult rv = mScriptElement->DoneAddingChildren(PR_TRUE); > > So per current HTML spec this doesn't do exactly the right thing. If a parent > of the script element has been removed from the document, the script won't > execute here. However the HTML spec says it should. There was a recent thread > about this on the HTML list.
Assignee | ||
Comment 1•15 years ago
|
||
Patch not tested yet.
Assignee: nobody → hsivonen
Status: NEW → ASSIGNED
Assignee | ||
Comment 2•15 years ago
|
||
The patch fails Mochitest. I suppose it needs to be conditional on html5.enable.
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•