Closed
Bug 514487
Opened 16 years ago
Closed 16 years ago
Cloning a document doesn't update the ID map
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: smaug, Assigned: smaug)
References
Details
Attachments
(3 files)
|
438 bytes,
text/html
|
Details | |
|
5.91 KB,
patch
|
bzbarsky
:
review+
|
Details | Diff | Splinter Review |
|
5.90 KB,
patch
|
Details | Diff | Splinter Review |
Because cloning doesn't notify, the ID map isn't updated in the cloned doc.
Only cloning of XML documents was supported earlier, and for those documents
this is regression from bug 344258 (if I read hg blame correctly).
Comment 2•16 years ago
|
||
Ah, hmm. So post-cloning you could walk the DOM and register all the IDs, I guess, right?
| Assignee | ||
Comment 3•16 years ago
|
||
Or update the ID map even when not notifying (have to check if that causes some problems).
Comment 4•16 years ago
|
||
Yes; unless you remove the updates on notification.
| Assignee | ||
Comment 5•16 years ago
|
||
(In reply to comment #4)
> Yes; unless you remove the updates on notification.
Ofc I'd remove the updates on notification in that case.
I was thinking if someone listening ID changes may do something evil.
They won't. In nsIDocument.h:
* This fires at difficult times. It is generally not safe to do anything
* which could modify the DOM in any way. Use
* nsContentUtils::AddScriptRunner.
| Assignee | ||
Comment 7•16 years ago
|
||
A bit ugly, but this way I don't have care about whether the element has been notified etc. and this shouldn't trigger bug 515080.
Attachment #399120 -
Flags: review?(bzbarsky)
Comment 8•16 years ago
|
||
Comment on attachment 399120 [details] [diff] [review]
patch
I suppose this is doable, though I wonder why you need the GetOwnerDoc() call. Take that out and r=me.
I don't know what bug 515080 has to do with this, though.
Attachment #399120 -
Flags: review?(bzbarsky) → review+
| Assignee | ||
Comment 9•16 years ago
|
||
(In reply to comment #8)
> I don't know what bug 515080 has to do with this, though.
Actually it doesn't have anymore.
No longer depends on: 515080
| Assignee | ||
Comment 10•16 years ago
|
||
| Assignee | ||
Updated•16 years ago
|
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•