Closed Bug 811701 Opened 12 years ago Closed 11 years ago

Move innerHTML/outerHTML/insertAdjacentHTML from HTMLElement to Element

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla20

People

(Reporter: peterv, Assigned: peterv)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

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.
Attached patch v1Splinter Review
Assignee: nobody → peterv
Status: NEW → ASSIGNED
Attachment #695360 - Flags: review?(bzbarsky)
Blocks: 824301
> 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 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.
Cameron, is that per spec or in our impl?  In our impl, I'd believe that.  I should add an xhtml test...
OK.  So per spec in the test I pushed the todo_is should be isnot() or should be is() with the namespace as HTML?
(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.
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: domparsing
Attachment #695360 - Flags: review?(bzbarsky) → review+
Flags: in-testsuite+
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
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla20
I have the same problem as Jim's in comment 14 after installing the latest hourly with this fix.
See bug 824301.  You're just seeing more of that bug.
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>
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?
var y=d.getFullYear();
I had my bug daisy-chained to yours because "it's a duplicate". when (?) it's not.
> 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?
Depends on: 858850
Depends on: 870709
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: