innerHTML and residual-style parsing interact in unexpected ways

RESOLVED DUPLICATE of bug 381808

Status

()

Core
DOM
RESOLVED DUPLICATE of bug 381808
10 years ago
10 years ago

People

(Reporter: Andrew Neretin, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

10 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.9) Gecko/2008052906 Firefox/3.0
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.9) Gecko/2008052906 Firefox/3.0

If you have div element inside <em> tag, and then placing it's content into a javascript variable and then place it back from variable into the div, content looks like <em>content</em>.
More details in the code listing

Reproducible: Always

Steps to Reproduce:
1.
<em>
    <div id='some_div'>test</div>
</em>
2. javascript code:
alert(document.getElementById('some_div').innerHTML);   //returns 'test'
var str = document.getElementById('some_div').innerHTML;	alert(str);			//returns 'test'
document.getElementById('some_div').innerHTML = str;
alert(document.getElementById('some_div').innerHTML); //returns '<em>test</em>

Actual Results:  
some_div.innerHTML = "<em>test</em>";

Expected Results:  
some_div.innerHTML = "test";

Updated

10 years ago
Component: General → DOM
Product: Firefox → Core
QA Contact: general → general
Summary: Content of the div is placed into <em> tag → innerHTML and residual-style parsing interact in unexpected ways

Updated

10 years ago
Status: UNCONFIRMED → RESOLVED
Last Resolved: 10 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 381808
You need to log in before you can comment on or make changes to this bug.