Bug 134765 - GetComputedStyle().top/left return null or auto when top/left use calc()
Summary: GetComputedStyle().top/left return null or auto when top/left use calc()
Status: RESOLVED CONFIGURATION CHANGED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac (Intel) All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-07-09 07:00 PDT by Loïc Magne
Modified: 2022-07-13 17:23 PDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Loïc Magne 2014-07-09 07:00:47 PDT
Overview:
When the css attribute calc() is used on an element to calculate the left and top position, getComputedStyle(element).top and getComputedStyle(element).left return null or auto whereas the render is good.

Steps to reproduce:
Open attached HTML file.

Actual result:
On the "calculated result" section, 
  on Safari : 'top:null' and 'left:null'
  on android browser : 'top:auto' and 'left:auto'


Expected result:
On the "calculated result" section, we must see all the time 'top:40px' and 'left:60px'

Tested Platform:
Safari on IOS7, IOS8, Mac OS X 10.10 Yosemite preview 2 and preview 3
AppleWebKit 534.30 on androïd 4.2.2 (samsun galaxy 3)
Comment 1 David DeSandro 2016-11-02 18:35:17 PDT
This issue is still present in Safari 10. See CodePen http://codepen.io/desandro/pen/jVNxOd/
Comment 2 Brent Fulgham 2022-07-13 17:23:17 PDT
Safari, Chrome, and Firefox all agree on rendering for this test case. I don't believe there is any remaining compatibility issue.