Bug 18175

Summary: document.defaultView.getComputedStyle(el, '').left returns empty "auto". Always.
Product: WebKit Reporter: Garrett Smith <xk1t>
Component: DOMAssignee: Nobody <webkit-unassigned>
Status: RESOLVED CONFIGURATION CHANGED    
Severity: Normal CC: ahmad.saleem792, ap, bfulgham, gavin.sharp, rniwa, webmaster
Priority: P2    
Version: 525.x (Safari 3.1)   
Hardware: PC   
OS: OS X 10.5   
Attachments:
Description Flags
testcase showing problem
none
position: relative, left is still auto none

Description Garrett Smith 2008-03-27 23:22:02 PDT
getComputedStyle returns wrong results for left and top.

The value returned is always 'auto'
Comment 1 Garrett Smith 2008-03-27 23:24:46 PDT
Created attachment 20149 [details]
testcase showing problem

Check the testcase to see the problem. 'left' and 'top' are 'auto', but should instead be 100px, 12px, respectively.

Aside from that, the value for margin is empty. The value should be either 1 or four values. This is not a spec, it's just what I say. 1 value or four values. That is easier for scripts to deal with value.split(' ");
Comment 2 Dave Hyatt 2008-03-28 11:59:49 PDT
The issue is that the div is not positioned.
Comment 3 Garrett Smith 2008-03-28 23:01:48 PDT
Created attachment 20185 [details]
position: relative, left is still auto

When the element has position: relative, the computed left value is 0, however, webkit will return 'auto'.

"If both 'left' and 'right' are 'auto' (their initial values), the computed values are '0' (i.e., the boxes stay in their original position)."
http://www.w3.org/TR/CSS21/visuren.html#relative-positioning
Comment 4 Ahmad Saleem 2022-07-25 16:59:36 PDT
I am unable to reproduce this bug in Safari 15.6 on macOS 12.5 and in both test cases, all browsers are giving same output:

Test Case 1 (testcase showing..) - 100px, 12px, 1px, 1px;

Test Case 2 (position..) - 0px, 0px, 1px, 1px;

Since all browsers are matching, can this be marked as "RESOLVED CONFIGURATION CHANGED" or as such. Thanks!