Bug 134765

Summary: GetComputedStyle().top/left return null or auto when top/left use calc()
Product: WebKit Reporter: Loïc Magne <l.magne>
Component: CSSAssignee: Nobody <webkit-unassigned>
Status: RESOLVED CONFIGURATION CHANGED    
Severity: Normal CC: bfulgham, desandrocodes
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Mac (Intel)   
OS: All   

Loïc Magne
Reported 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)
Attachments
David DeSandro
Comment 1 2016-11-02 18:35:17 PDT
This issue is still present in Safari 10. See CodePen http://codepen.io/desandro/pen/jVNxOd/
Brent Fulgham
Comment 2 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.
Note You need to log in before you can comment on or make changes to this bug.