[Webkit-unassigned] [Bug 161002] New: Nested calculations using intermediate CSS Custom Properties don't work
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Fri Aug 19 11:09:07 PDT 2016
https://bugs.webkit.org/show_bug.cgi?id=161002
Bug ID: 161002
Summary: Nested calculations using intermediate CSS Custom
Properties don't work
Classification: Unclassified
Product: WebKit
Version: Safari Technology Preview
Hardware: Macintosh
OS: OS X 10.11
Status: NEW
Severity: Normal
Priority: P2
Component: CSS
Assignee: webkit-unassigned at lists.webkit.org
Reporter: sgomes at google.com
As per example 9 in section 2.2 (Resolving Dependency Cycles) of the spec (https://drafts.csswg.org/css-variables/), it should be possible to have nested calculations:
one { --foo: 10px; }
two { --bar: calc(var(--foo) + 10px); }
three { --foo: calc(var(--bar) + 10px); }
This doesn't seem to work in Safari 9.1.2 or Safari Technology Preview.
Furthermore, it is stated: "Custom properties are left almost entirely unevaluated, except that they allow and evaluate the var() function in their value."
This implies that it should be possible to declare the intermediate calculations without calc() as well, as the value returned by var() would just be substituted into the new definition.
I have prepared a demo illustrating both ways of nesting calculations; one using calc() for the intermediate steps (as per the example above), and one using calc() for the final step only: http://codepen.io/anon/pen/bZJaVO
The expected result is that the third div in both groups is 30px wide.
Steps to reproduce:
1 - Load http://codepen.io/anon/pen/bZJaVO
2 - Observe third div in each group
Expected results: third div should be 30px wide.
Actual results: third div is 10px wide in Safari 9.1.2; third div fits to screen width in Safari Technology Preview.
Other browsers: The demo produces the expected result in both Chrome 53 and Firefox 48.
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20160819/9067655d/attachment.html>
More information about the webkit-unassigned
mailing list