Open Bug 239152 Opened 21 years ago Updated 2 years ago

Make DoneCreatingElement more useful

Categories

(Core :: DOM: Core & HTML, defect)

defect

Tracking

()

People

(Reporter: sicking, Unassigned)

References

Details

jst and I got an idea talking on irc the other day. Right now we have a bunch of elements that needs special attention in the contentsink (and XSLT resulthandler). While some of it in there is due to sheer lazyness (like title-elements) on our side, others give us actual performance benefit (<style>) or genually needs it in the current implementation (<script>). The issue is that we don't want these elements to do anything, like parse contained text into script or css, until they are fully parsed. So the idea is to make it possible for elements to always rely on DoneCreatingElement being called after an it is fully parsed, including its childnodes. In order to do that we need to call that function in the contentsink, the xslt resulthandler and in nsDocument::CreateElement(NS). This way scripts and stylesheets can be treated like normal elements and internally they won't trigger any stylesheet/script loads until DoneCreatingElement is called.
Note we could also use this to get rid of some hacks in nsHTMLImageElement... (we don't want to start loading the image till we're in the DOM when being parsed, etc).
I'll take this. Fixing this will also allow us to remove DoneAddingChildren from various elements.
Assignee: general → bugmail
Blocks: 217715
In 217715 I have generalized the DoneAddingChildren() method by moving it to nsIContent and having it called for <select>, <applet>, <object> and <textarea>. It only gets called on elements created by the parser. (I rely on passing in a parameter to the constructor to tell these elements whether they're being created by the parser and so should expect a DoneAddingChildren().) I'm not sure how that affects what you want to do here.
Blocks: 213026, 312592
Summary: Make DoneCreatingElement more usefull → Make DoneCreatingElement more useful
No longer blocks: 312592
Depends on: 312592
QA Contact: ian → general
Jonas, are you still planning to do anything in this bug?
I think this is something that we should do, but I'm not planning on doing it.
Component: DOM → DOM: Core & HTML
Severity: normal → S3

The bug assignee is inactive on Bugzilla, so the assignee is being reset.

Assignee: jonas → nobody
You need to log in before you can comment on or make changes to this bug.