Move innerHTML/outerHTML/insertAdjacentHTML from HTMLElement to Element

RESOLVED FIXED in mozilla20

Status

()

Core
DOM
RESOLVED FIXED
5 years ago
4 years ago

People

(Reporter: peterv, Assigned: peterv)

Tracking

(Blocks: 1 bug)

Trunk
mozilla20
Points:
---
Dependency tree / graph
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

5 years ago
See http://domparsing.spec.whatwg.org/#extensions-to-the-element-interface

Updated

5 years ago
Duplicate of this bug: 611885

Updated

5 years ago
Duplicate of this bug: 824114
Ms2ger has already duped bug 824114, but as an FYI, doing something like according to the domparsing spec:

  var gElement = ...;
  gElement.innerHTML = "<path d=''/>";

will "just work", in that it looks at the default namespace declaration on the <g> element and will place the <path> element in the SVG namespace.
(Assignee)

Comment 4

5 years ago
Created attachment 695360 [details] [diff] [review]
v1
Assignee: nobody → peterv
Status: NEW → ASSIGNED
(Assignee)

Updated

5 years ago
Attachment #695360 - Flags: review?(bzbarsky)

Updated

5 years ago
Blocks: 824301

Comment 5

5 years ago
> will "just work", in that it looks at the default namespace declaration on the <g>
> element 

This patch doesn't do that, afaict.  We need a followup bug on it or we need to reopen the bugs marked as duplicates of this one.

Comment 6

5 years ago
Comment on attachment 695360 [details] [diff] [review]
v1

r=me.

I pushed to try: https://tbpl.mozilla.org/?tree=Try&rev=dcdacd679e49

There will be some known M2 orange from the Document webidl bits, sadly, but apart from that should be useful.
(In reply to Boris Zbarsky (:bz) from comment #5)
> This patch doesn't do that, afaict.  We need a followup bug on it or we need
> to reopen the bugs marked as duplicates of this one.

I think I am half mistaken -- innerHTML on an element in an HTML document won't correct parse SVG elements like that, but will on one in an XML document.

Comment 8

5 years ago
Cameron, is that per spec or in our impl?  In our impl, I'd believe that.  I should add an xhtml test...
That is per spec, looking at http://www.whatwg.org/specs/web-apps/current-work/multipage/the-end.html#html-fragment-parsing-algorithm for HTML documents and http://www.whatwg.org/specs/web-apps/current-work/multipage/the-xhtml-syntax.html#xml-fragment-parsing-algorithm for XML documents (which the DOM Parsing spec references).

Comment 10

5 years ago
OK.  So per spec in the test I pushed the todo_is should be isnot() or should be is() with the namespace as HTML?

Comment 11

5 years ago
(Note that a test using XHTML passes with those todo_is converted to is().)
(In reply to Boris Zbarsky (:bz) from comment #10)
> OK.  So per spec in the test I pushed the todo_is should be isnot() or
> should be is() with the namespace as HTML?

I believe so.

Though I think it would actually be useful to allow innerHTML to start off in foreign content mode when assigning to an SVG- or MathML-namespaced element.
Blocks: 816409

Comment 13

5 years ago
Alright.

There's one orange on the try push: test_bug744830.html.  That's happening because that test does:

  t.innerHTML = null;
  t.appendChild(document.createElement("textarea"));
  t.firstChild.appendChild(document.createTextNode("\nhello"));

and this patch lost the [TreatNullAs=EmptyString].  I filed https://www.w3.org/Bugs/Public/show_bug.cgi?id=20499 on adding that to the spec.
No longer blocks: 816409

Updated

5 years ago
Attachment #695360 - Flags: review?(bzbarsky) → review+

Updated

5 years ago
Flags: in-testsuite+

Updated

5 years ago
Blocks: 816409
Just tested an m-i build with this patch cset:
http://hg.mozilla.org/integration/mozilla-inbound/rev/5d900d13b2cf

CNN will now load, but not fully.  I have spinning markers on 
Featured TV box on right side
Markets box below that on right side
and Weather information is missing totally.

Several js errors in the Error console:
Error: TypeError: o.style is undefined
Source file: http://cdn.optimizely.com/js/131788053.js
Line: 48

4 of these:
Error: TypeError: document.getElementById(...).style is undefined
Source file: http://z.cdn.turner.com/cnn/tmpl_asset/static/www_homepage/1899/js/hplib-min.js
Line: 23

Error: TypeError: d.style is undefined
Source file: http://z.cdn.turner.com/cnn/.e/js/libs/jquery-1.7.2.min.js
Line: 2

Error: TypeError: $(...).select is not a function
Source file: http://z.cdn.turner.com/cnn/tmpl_asset/static/www_homepage/1899/js/hplib-min.js
Line: 26

Error: TypeError: $(...).update is not a function
Source file: http://z.cdn.turner.com/cnn/tmpl_asset/static/www_global/796/js/globallib-min.js
Line: 2

Sorry I know nothing about webpage layout, js , etc...
None of the errors I posted above appear in a build prior to the landing of bug 824301
https://hg.mozilla.org/mozilla-central/rev/5d900d13b2cf
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla20

Comment 17

5 years ago
I have the same problem as Jim's in comment 14 after installing the latest hourly with this fix.

Comment 18

5 years ago
See bug 824301.  You're just seeing more of that bug.

Comment 19

4 years ago
I am unable in 20.0 to render msup properly. I am also unable to do the following:
<p><math>
<mn id="y2">4357</mn>
</math></p>    
<script>
var d=new Date();
var y=d.getFullYear();
var yad=y+'AD';
document.getElementById('y2',yad);
</script>

Comment 20

4 years ago
forgot to give sample page. the first part of the page contains an image which contains the math. the lower duplicate is mathml rendered by whatever browser.
http://Jesusnjim.com/studies/personal/noahs-ark-speciation.html
>	var ycur=d.getFullYear();
>	var ycurAD=y+'AD';
Obviously the code is wrong. (y is not defined anywhere.)
And why do you think it is related with this bug?

Comment 22

4 years ago
var y=d.getFullYear();

Comment 23

4 years ago
I had my bug daisy-chained to yours because "it's a duplicate". when (?) it's not.

Comment 24

4 years ago
> I had my bug daisy-chained to yours because "it's a duplicate". 

Your bug being presumably bug 742143?

The testcase in that bug is fixed (by this bug).  Comment 19 has nothing to do with that testcase, or with this bug; it's about the fact that the "id" attribute is not special for all elements, which is bug 741295.  If you're seeing some other, unrelated, problem with msup, please do file a bug on it with clear steps to reproduce, ok?

Updated

4 years ago
Depends on: 858850

Updated

4 years ago
Depends on: 870709
You need to log in before you can comment on or make changes to this bug.