Bug 134765
| Summary: | GetComputedStyle().top/left return null or auto when top/left use calc() | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Loïc Magne <l.magne> |
| Component: | CSS | Assignee: | 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
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 | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
David DeSandro
This issue is still present in Safari 10. See CodePen http://codepen.io/desandro/pen/jVNxOd/
Brent Fulgham
Safari, Chrome, and Firefox all agree on rendering for this test case. I don't believe there is any remaining compatibility issue.