Status

()

P5
critical
RESOLVED DUPLICATE of bug 788444
6 years ago
6 years ago

People

(Reporter: srvskprakash, Unassigned)

Tracking

15 Branch
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

6 years ago
User Agent: Mozilla/5.0 (Windows NT 6.1; rv:14.0) Gecko/20100101 Firefox/14.0.1
Build ID: 20120713134347

Steps to reproduce:

when trying to parse xml data content using innerHTML, I am getting a parse error.
I am using DomParser and parseFromString to do it.
I am having the following content in my XML
<test><val attr="<popo>" /></test>


Actual results:

in firefox 15 innerHTML is generated as
<test><val attr="<popo>" /></test>
But in the older versions it is
<test><val attr="&lt;popo&lt;" /></test>

hence getting the parse error.


Expected results:

it should be same as the older version.

Any solution for this is greatly appreciated. Application is in production now and many customers are being affected. Need to provide a quicker solution. Is there anything that can be done in FF ?
(Reporter)

Updated

6 years ago
Severity: normal → critical
Component: Untriaged → Webapp Runtime
OS: Windows 7 → Linux
Priority: -- → P5
Version: 14 Branch → 15 Branch

Updated

6 years ago
Blocks: 744830

Comment 1

6 years ago
maybe dup Bug 788444
(Reporter)

Comment 2

6 years ago
can i know the difference of implementation of innerHTML in previous versions of firefox and firefox 15, and how can that be handled.

Comment 3

6 years ago
(In reply to Alice0775 White from comment #1)
> maybe dup Bug 788444

Even I am facing the same issue...
I have a page in my application that is loaded with XML data. I am also using innerHTML and parsing it using DomParser.
I have a part of content where i am loading different operators < > = etc. my content will be like <operator value="<" name="LESS THAN" >, I am getting a parse error "not well-formed" in this line.
I dint face the issue in previous versions,why am i facing this in FF15? as mentioned in the description in older versions it is generating as <operator value="&lt;" name="LESS THAN" >

I would like to know whether there is any change change in innerHTML implementation in FF15? if so what is it? Will that be fixed? Is it a bug with FF or it should be handled in the application? If we have to fix in application level we need to provide the reason as to why innerHTML is behaving differently. 

I dont find any answers for my questions in the duplicated bug?Can any1 answer my question?
Status: UNCONFIRMED → RESOLVED
Last Resolved: 6 years ago
Component: Webapp Runtime → Serializers
OS: Linux → All
Product: Firefox → Core
Hardware: x86 → All
Resolution: --- → DUPLICATE
Duplicate of bug: 788444
The answers to the questions from comment 3 are in fact in the duplicated bug.  The new behavior is what the spec calls for, and other browsers already have it.  So any application that doesn't handle it is already broken in other browsers.

That bug report also discusses why the behavior changed and so forth.

Comment 6

6 years ago
Can you please relate the answers here, because I am really confused with the long discussion that went on in the other bug.]?

(In reply to Boris Zbarsky (:bz) from comment #5)
> The answers to the questions from comment 3 are in fact in the duplicated
> bug.  The new behavior is what the spec calls for, and other browsers
> already have it.  So any application that doesn't handle it is already
> broken in other browsers.
> 
> That bug report also discusses why the behavior changed and so forth.
> why am i facing this in FF15?

Because the behavior changed.

> whether there is any change change in innerHTML implementation in FF15?

Yes.

> if so what is it?

We now implement the algorithm at http://www.whatwg.org/specs/web-apps/current-work/multipage/the-end.html#html-fragment-serialization-algorithm for innerHTML, as required by http://domparsing.spec.whatwg.org/#innerhtml

> Is it a bug with FF or it should be handled in the application?

It needs to be fixed in the application.  Getting .innerHTML on an HTML element in a non-XML document does not produce well-formed XML.  It never has, actually; it only worked in a very narrow set of cases.

If you want to produce well-formed XML, use XMLSerializer.

Comment 8

6 years ago
Thanks a lot Boris, this helped me...


(In reply to Boris Zbarsky (:bz) from comment #7)
> > why am i facing this in FF15?
> 
> Because the behavior changed.
> 
> > whether there is any change change in innerHTML implementation in FF15?
> 
> Yes.
> 
> > if so what is it?
> 
> We now implement the algorithm at
> http://www.whatwg.org/specs/web-apps/current-work/multipage/the-end.
> html#html-fragment-serialization-algorithm for innerHTML, as required by
> http://domparsing.spec.whatwg.org/#innerhtml
> 
> > Is it a bug with FF or it should be handled in the application?
> 
> It needs to be fixed in the application.  Getting .innerHTML on an HTML
> element in a non-XML document does not produce well-formed XML.  It never
> has, actually; it only worked in a very narrow set of cases.
> 
> If you want to produce well-formed XML, use XMLSerializer.
You need to log in before you can comment on or make changes to this bug.