The default bug view has changed. See this FAQ.

Implement insertAdjacentHTML

RESOLVED FIXED in mozilla8

Status

()

Core
DOM
RESOLVED FIXED
6 years ago
4 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

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

Updated

6 years ago
Whiteboard: [wanted2.1?]
(Assignee)

Comment 1

6 years ago
Looking at this per discussion with bz.
Assignee: nobody → hsivonen
Status: NEW → ASSIGNED
(Assignee)

Comment 2

6 years ago
Created attachment 523282 [details] [diff] [review]
Implement insertAdjacentHTML
(Assignee)

Comment 3

6 years ago
Created attachment 523283 [details] [diff] [review]
Tests for insertAdjacentHTML
(Assignee)

Updated

6 years ago
Depends on: 563322
(Assignee)

Updated

6 years ago
Attachment #523282 - Flags: review?(bzbarsky)
(Assignee)

Updated

6 years ago
Attachment #523283 - Flags: review?(bzbarsky)
(Assignee)

Comment 4

6 years ago
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.
(Assignee)

Comment 5

6 years ago
Created attachment 524157 [details] [diff] [review]
Implement insertAdjacentHTML, v2
Attachment #523282 - Attachment is obsolete: true
Attachment #523282 - Flags: review?(bzbarsky)
(Assignee)

Updated

6 years ago
Attachment #524157 - Flags: review?(bzbarsky)
(Assignee)

Comment 6

6 years ago
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)
(Assignee)

Comment 7

6 years ago
Created attachment 524159 [details] [diff] [review]
Implemention difference from v1
(Assignee)

Comment 8

6 years ago
Created attachment 524160 [details] [diff] [review]
Test difference from v1
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 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.
(Assignee)

Comment 12

6 years ago
(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.
(Assignee)

Comment 13

6 years ago
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
(Assignee)

Comment 14

6 years ago
...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.
(Assignee)

Updated

6 years ago
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
(Assignee)

Updated

6 years ago
Depends on: 676808
(Assignee)

Comment 16

6 years ago
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)
(Assignee)

Comment 17

6 years ago
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)
Attachment #551019 - Flags: review?(Olli.Pettay) → review+
(Assignee)

Comment 18

6 years ago
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

5 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.