Bug 18175 - document.defaultView.getComputedStyle(el, '').left returns empty "auto". Always.
Summary: document.defaultView.getComputedStyle(el, '').left returns empty "auto". Alw...
Status: RESOLVED CONFIGURATION CHANGED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 525.x (Safari 3.1)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-03-27 23:22 PDT by Garrett Smith
Modified: 2022-07-25 17:54 PDT (History)
6 users (show)

See Also:


Attachments
testcase showing problem (774 bytes, text/html)
2008-03-27 23:24 PDT, Garrett Smith
no flags Details
position: relative, left is still auto (765 bytes, text/html)
2008-03-28 23:01 PDT, Garrett Smith
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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!