[Webkit-unassigned] [Bug 13343] getComputedStyle returns wrong value for margin-right

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Sep 18 01:05:56 PDT 2008


https://bugs.webkit.org/show_bug.cgi?id=13343





------- Comment #10 from sjoerd at backbase.com  2008-09-18 01:05 PDT -------
Created an attachment (id=23523)
 --> (https://bugs.webkit.org/attachment.cgi?id=23523&action=view)
Improved testcase

I think the behavior in Safari is incorrect according to: 
http://www.w3.org/TR/CSS21/box.html#propdef-margin-right.

It says the computed value of margin-right / left is the percentage as
specified or the absolute length.  So when i specify the margin, it should
return that margin, the initial value (according to the specs) of the margin is
0. So by default it should return 0.

I think the behavior in Safari is correct according to: 
http://www.w3.org/TR/CSS21/visudet.html#blockwidth

"If 'width' is not 'auto' and 'border-left-width' + 'padding-left' + 'width' +
'padding-right' + 'border-right-width' + scrollbar width (if any) (plus any of
'margin-left' or 'margin-right' that are not 'auto') is larger than the width
of the containing block, then any 'auto' values for 'margin-left' or
'margin-right' are, for the following rules, treated as zero.

If all of the above have a computed value other than 'auto', the values are
said to be "over-constrained" and one of the used values will have to be
different from its computed value. If the 'direction' property of the
containing block has the value 'ltr', the specified value of 'margin-right' is
ignored and the value is calculated so as to make the equality true. If the
value of 'direction' is 'rtl', this happens to 'margin-left' instead. "


-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the webkit-unassigned mailing list