Note: There are a few cases of duplicates in user autocompletion which are being worked on.

Implement insertAdjacentHTML

RESOLVED FIXED in mozilla8

Status

()

Core
DOM
RESOLVED FIXED
7 years ago
5 years ago

People

(Reporter: sicking, Assigned: hsivonen)

Tracking

(Depends on: 1 bug, Blocks: 1 bug, {dev-doc-complete, html5})

Trunk
mozilla8
dev-doc-complete, html5
Points:
---
Dependency tree / graph
Bug Flags:
in-testsuite ?

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [wanted2.1?][inbound], URL)

Attachments

(5 attachments, 2 obsolete attachments)

It's now part of HTML5, and might be help us get people off of doing

foo.innerHTML += "...";

http://dev.w3.org/html5/spec/Overview.html#insertadjacenthtml

It's too late for FF4, but there's no reason not to do it ASAP after.

Ms2ger expressed some interest in doing it (or rather, didn't violently oppose it when I suggested it)

Updated

7 years ago
Keywords: html5
OS: Mac OS X → All
Hardware: x86 → All
Version: unspecified → Trunk

Updated

7 years ago
Whiteboard: [wanted2.1?]
Looking at this per discussion with bz.
Assignee: nobody → hsivonen
Status: NEW → ASSIGNED
Created attachment 523282 [details] [diff] [review]
Implement insertAdjacentHTML
Created attachment 523283 [details] [diff] [review]
Tests for insertAdjacentHTML
Depends on: 563322
Attachment #523282 - Flags: review?(bzbarsky)
Attachment #523283 - Flags: review?(bzbarsky)
Need to revise the patch to take into account http://www.w3.org/Bugs/Public/show_bug.cgi?id=12434

The current patch behaves like IE on the non-optimized code path and per current spec on the optimized code path, so the patch is buggy either way.
Created attachment 524157 [details] [diff] [review]
Implement insertAdjacentHTML, v2
Attachment #523282 - Attachment is obsolete: true
Attachment #523282 - Flags: review?(bzbarsky)
Attachment #524157 - Flags: review?(bzbarsky)
Created attachment 524158 [details] [diff] [review]
Tests for insertAdjacentHTML, v2
Attachment #523283 - Attachment is obsolete: true
Attachment #524158 - Flags: review?(bzbarsky)
Attachment #523283 - Flags: review?(bzbarsky)
Created attachment 524159 [details] [diff] [review]
Implemention difference from v1
Created attachment 524160 [details] [diff] [review]
Test difference from v1

Comment 9

6 years ago
Comment on attachment 524157 [details] [diff] [review]
Implement insertAdjacentHTML, v2

Please fix the checkin comment's try stuff before pushing.

>+    // HTML5 parser has notified, but not fired mutation events.

This is duplicating code in SetInnerHTML.  Can we factor it out into a helper instead?

You need to rev the nsIDOMNSHTMLElement.idl iid.

I assume the createContextualFragment call will need to be merged with the patch for bug 596182?

r=me with those nits addressed.  Sorry for the lag here....
Attachment #524157 - Flags: review?(bzbarsky) → review+

Comment 10

6 years ago
Comment on attachment 524158 [details] [diff] [review]
Tests for insertAdjacentHTML, v2

r=me
Attachment #524158 - Flags: review?(bzbarsky) → review+
Any chance this can make FF6? Branching is in a week.
(In reply to comment #11)
> Any chance this can make FF6? Branching is in a week.

Unlikely. :-(

This depends on stuff that happens to depend on the patch for bug 482909. In retrospect, it would have been a better idea to write the patches in a different order to avoid depending on bug 482909, but if I tried to reorder them now, I'd end up invalidating a bunch of reviews I've already obtained. Also, I'm generally hesitant to reorder the patches in haste at this point.

Also, even if bug 482909 got review before the branching, it would be at least against the spirit of the new rules to dump the queue on central right before a release train leaves.
Landed in inbound:
http://hg.mozilla.org/integration/mozilla-inbound/rev/047bd50613ab
http://hg.mozilla.org/integration/mozilla-inbound/rev/7e84bd591246
Flags: in-testsuite?
Whiteboard: [wanted2.1?] → [wanted2.1?][inbound]
Target Milestone: --- → mozilla8
...and backed out the test. Bug 650493 had landed in the meantime and had changed the exact mutation events that fire. The mutation event expectations is the test case weren't based on a spec but based on what the Gecko behavior was when I wrote the test.
Depends on: 675621
http://hg.mozilla.org/mozilla-central/rev/047bd50613ab

leaving open since the tests have to be relanded yet
Keywords: dev-doc-needed
Depends on: 676808
Created attachment 551019 [details] [diff] [review]
Disable the part of the tests that needs bug 676808 to be fixed

This patch applies over attachment 524158 [details] [diff] [review]. This patch comments out the part of the tests that fails until bug 676808 is fixed. I suggest relanding the tests plus this patch.
Attachment #551019 - Flags: review?(bzbarsky)
Comment on attachment 551019 [details] [diff] [review]
Disable the part of the tests that needs bug 676808 to be fixed

Moving review request to optimize timezone situation.
Attachment #551019 - Flags: review?(bzbarsky) → review?(Olli.Pettay)

Updated

6 years ago
Attachment #551019 - Flags: review?(Olli.Pettay) → review+
Thanks. Pushed:
http://hg.mozilla.org/integration/mozilla-inbound/rev/d900907a1038
http://hg.mozilla.org/integration/mozilla-inbound/rev/fc40a7ae42ca
http://hg.mozilla.org/mozilla-central/rev/d900907a1038
http://hg.mozilla.org/mozilla-central/rev/fc40a7ae42ca

looks like work here has finished, resolving.
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED

Updated

6 years ago
Keywords: dev-doc-needed → dev-doc-complete

Updated

6 years ago
Depends on: 681052

Comment 20

6 years ago
Just for reference:
The spec has moved from HTML5 to DOM Parsing:
http://html5.org/specs/dom-parsing.html#insertadjacenthtml()

See http://www.w3.org/Bugs/Public/show_bug.cgi?id=11204

https://developer.mozilla.org/en/DOM/element.insertAdjacentHTML already links to the new location.
Blocks: 816409
You need to log in before you can comment on or make changes to this bug.