Closed Bug 282021 Opened 20 years ago Closed 20 years ago

Inconsistent behaviour when changing styles via javascript

Categories

(Core :: CSS Parsing and Computation, defect)

defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 228084

People

(Reporter: pop2.bugzilla, Assigned: dbaron)

Details

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.3) Gecko/20040910
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.3) Gecko/20040910

<html><head>
<style>
#id1 { color:red }
</style>
</head><body>
<div id="id1">foo</div>
<div id="id2" style="color:red">foo</div>
</body></html>

when you change document.getElementById('id2').style.color='green' then the html
source code changes too, i.e. document.body.innerHTML contains 'green' as style
for div#id2.

when changing win.document.styleSheets[0].cssRules[0].style.color='green' then
document.getElementsByTagName('head')[0].innerHTML isn't changed. 

So, either changing styles should change the html code or not. But now we have
two different behaviours.

Reproducible: Always

Steps to Reproduce:
You already filed this once.... Nothing's changed since then.

*** This bug has been marked as a duplicate of 228084 ***
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.