Status: Unconfirmed
Owner: ----
Labels: Type-Bug Pri-2 OS-All Area-Misc

New issue 23816 by Nige.Animal: Computed style margins return incorrect  
values.
http://code.google.com/p/chromium/issues/detail?id=23816

Chrome Version       : 4.0.220.1
URLs (if applicable) :
Other browsers tested:
   Add OK or FAIL after other browsers where you have tested this issue:
      Safari 4: FAIL
   Firefox 3.x: OK
          IE 7: OK
          IE 8: OK

It's a Webkit problem I think. But it's been outstanding there for months  
at https://bugs.webkit.org/show_bug.cgi?id=24511

When an element is explicitly sized within another sized element, so that  
there
is empty space to its right, the *computed style* returned for the inner
element's margin-right value is the width of that empty space.

This is not correct. That's just empty space.

To illustrate, I have included a very simple  test page.

It uses the ExtJs library just as a vehicle to get the computed style. It  
has
an Element class which encapsulates a DOM element, and this offers a  
getMargins
method which requests the *computed* style for the element.

To run this example, download the ExtJs SDK. Drop this page into  
examples/<any
directory>

On Webkit based browsers, the red DIV reports its left+right margin total  
to be
300

On Firefox, it is correctly reported as zero.

<html>
<head>
<title>Margin bug</title>
<script type="text/javascript" src="../../adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="../../ext-all.js"></script>
<script type="text/javascript">
Ext.onReady(function() {
     var inner = Ext.get("inner");
     var m = inner.getMargins('lr');
     inner.update('My left+right margins are ' + m);
});
</script>
</head>
<body>
</body>
<div id="outer" style="height:300px;width:500px;border:1px solid black">
     <div id="inner" style="height:200px;width:200px;background-color:red">
     </div>
</div>
</html>

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

--~--~---------~--~----~------------~-------~--~----~
Automated mail from issue updates at http://crbug.com/
Subscription options: http://groups.google.com/group/chromium-bugs
-~----------~----~----~----~------~----~------~--~---

Reply via email to