Closed
Bug 675621
Opened 13 years ago
Closed 13 years ago
Useless assertion [@ nsContentUtils::MaybeFireNodeRemoved] when calling insertAdjacentHTML
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla8
People
(Reporter: hsivonen, Assigned: hsivonen)
References
Details
(Whiteboard: [inbound])
Attachments
(1 file, 1 obsolete file)
2.57 KB,
patch
|
smaug
:
review+
|
Details | Diff | Splinter Review |
Due to changes introduces in bug 650493, the step of inserting the DocumentFragment into the DOM in insertAdjacentHTML asserts about node removal mutation events: http://mxr.mozilla.org/mozilla-central/source/content/base/src/nsContentUtils.cpp#3314 The asserting method ends up returning early: http://mxr.mozilla.org/mozilla-central/source/content/base/src/nsContentUtils.cpp#3325 There's no harm, because the DocumentFragment comes fresh from parsing and cannot have had mutation listeners set on it. Therefore, it's OK to suppress the assertion.
Assignee | ||
Comment 1•13 years ago
|
||
Updated•13 years ago
|
Attachment #549785 -
Flags: review?(Olli.Pettay) → review+
Comment 2•13 years ago
|
||
Comment on attachment 549785 [details] [diff] [review] Suppress the assertion nsAutoScriptBlockerSuppressNodeRemoved should be after mozAutoDocUpdate, I think, so that script blockers are removed after removing nsAutoScriptBlockerSuppressNodeRemoved from stack. Make sure that you get DOMNodeRemoved events if you modify DOM in the DOMNodeInserted listeners.
Attachment #549785 -
Flags: review+ → review-
Another strategy here would be to just make the update batch span the parsing, then you can insert the fragment outside the batch without worrying about any scriptblockers causing assertions. Though I'm fine with the approach in the patch too, but please add a comment describing this alternative strategy as ideally nsAutoScriptBlockerSuppressNodeRemoved should never be needed.
Assignee | ||
Comment 4•13 years ago
|
||
Fix using the approach Jonas suggested.
Attachment #549785 -
Attachment is obsolete: true
Attachment #551014 -
Flags: review?(Olli.Pettay)
Updated•13 years ago
|
Attachment #551014 -
Flags: review?(Olli.Pettay) → review+
Assignee | ||
Comment 5•13 years ago
|
||
Thanks. Pushed: http://hg.mozilla.org/integration/mozilla-inbound/rev/3e9fb8cfe7fd
Flags: in-testsuite?
Whiteboard: [inbound]
Target Milestone: --- → mozilla8
Comment 6•13 years ago
|
||
http://hg.mozilla.org/mozilla-central/rev/3e9fb8cfe7fd
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•