W3C home > Mailing lists > Public > public-html@w3.org > April 2007

style.background rendering - browser inconsistency

From: David Dailey <david.dailey@sru.edu>
Date: Tue, 03 Apr 2007 11:53:30 -0400
Message-Id: <6.2.5.6.0.20070403114433.01e2c758@sru.edu>
To: public-html@w3.org

I'm not sure if this is an HTML problem or a CSS problem or an ECMA 
script problem, so am not sure if it belongs in this discussion or 
not.  I suppose it has to do with the orthogonality principle.

Consider the following:
<html>
<body 
onload="document.getElementById('R').innerHTML=document.getElementById('Q').style.background">
<div style="background:#afa" id="Q">Bonjour</div>
<div id="R"></div>
</body>
</html>

It doesn't matter if I use innerHTML or a DOM2 nodeValue approach -- 
alert() shows the same discrepancy.

The string returned by different browsers differs:
IE -- #afa
Firefox -- rgb(170, 255, 170) none repeat scroll 0% 0%
Opera -- #aaffaa

One can program around it, but it is a bit counterintuitive to me 
that one gets three different answers.

David Dailey 
Received on Tuesday, 3 April 2007 18:51:05 UTC

This archive was generated by hypermail 2.3.1 : Monday, 29 September 2014 09:38:42 UTC