Closed
Bug 588990
Opened 14 years ago
Closed 13 years ago
Remove lazy hashing of names to avoid walking full DOM
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: sicking, Assigned: sicking)
References
Details
Attachments
(1 file, 1 obsolete file)
27.11 KB,
patch
|
bzbarsky
:
review+
|
Details | Diff | Splinter Review |
We currently don't store elements in the name table until someone has looked up a given name. However this means that once someone looks up a specific name for the first time, we can't check the hash for it, but have to walk the full DOM. It should be more efficient to simply hash all names as they come in. Patch coming up.
Comment 1•14 years ago
|
||
Jonas, did this patch ever happen?
Assignee | ||
Comment 2•14 years ago
|
||
This has been sitting in my tree for a while and should work. However it needs tests so not requesting review just yet.
Assignee: nobody → jonas
Assignee | ||
Comment 3•13 years ago
|
||
This'll do it. I found two other bugs while writing these tests: 1. Bug 307415 2. Bug 649415
Attachment #478826 -
Attachment is obsolete: true
Attachment #525441 -
Flags: review?(bzbarsky)
Comment 4•13 years ago
|
||
Comment on attachment 525441 [details] [diff] [review] Patch to fix r=me on the specialpowers patch, which I'm going to use in my patch in bug 650543. Also, could you please let extensions/spellcheck/hunspell/tests/suggestiontest/Makefile.orig remain in the tree? :-)
Comment 5•13 years ago
|
||
Landed the gc API: http://hg.mozilla.org/mozilla-central/rev/61ab7fa02e26
Comment 6•13 years ago
|
||
Why is nsHTMLDocument::ResolveName using PutEntry instead of GetEntry? This patch changes our behavior on this testcase: data:text/html,<img name="write"><script>alert(document.write)</script> but I _think_ it changes towards better compat with other browsers... Please check IE? Is there a point to populating the name map for non-HTML documents? If not, is it worth optimizing out the add/remove bits for non-HTML documents (I realize we want them for XHTML, so mIsRegularHTML is the wrong thing to check, but...)
Assignee | ||
Comment 7•13 years ago
|
||
(In reply to comment #6) > Why is nsHTMLDocument::ResolveName using PutEntry instead of GetEntry? When I made similar code refactoring for the id code I tried changing PutEntry to GetEntry. However that caused a measurable slowdown on the relevant Dromaeo tests. Apparently our hash table is faster when a lookup succeeds. > This patch changes our behavior on this testcase: > > data:text/html,<img name="write"><script>alert(document.write)</script> > > but I _think_ it changes towards better compat with other browsers... Please > check IE? I checked with other browsers and no others had the same behavior as us. IIRC this patch aligned us with everyone else, and definitely with IE. > Is there a point to populating the name map for non-HTML documents? If not, > is it worth optimizing out the add/remove bits for non-HTML documents (I > realize we want them for XHTML, so mIsRegularHTML is the wrong thing to > check, but...) We could, I don't feel strongly. It does seem somewhat unlikely that there will be significant amounts of named non-form-control HTML contents in non-HTML documents (note that no form controls show up in the CanHaveName list).
Comment 8•13 years ago
|
||
> However that caused a measurable slowdown on the relevant Dromaeo tests. See bug 572614 comment 2 and bug 572614 comment 3.
Assignee | ||
Comment 9•13 years ago
|
||
There you go :) I'll switch to GetEntry then :)
Comment 10•13 years ago
|
||
Comment on attachment 525441 [details] [diff] [review] Patch to fix OK, r=me with the change to GetEntry and corresponding comment adjustments.
Attachment #525441 -
Flags: review?(bzbarsky) → review+
Comment 11•13 years ago
|
||
Looks like you could have removed the NAME_NOT_VALID define?
Assignee | ||
Comment 12•13 years ago
|
||
Checked in. Thanks for the review! Of course, I forgot to remove the part of the patch that killed Makefile.orig, so I had to land a followup which added it back. http://hg.mozilla.org/mozilla-central/rev/ea254208e04c http://hg.mozilla.org/mozilla-central/rev/de123d952abd
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Updated•5 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•