[csswg-drafts] [css-shapes] Calculation of corner radii by margin-box and border-radius

aethanyc has just created a new issue for 
https://github.com/w3c/csswg-drafts:

== [css-shapes] Calculation of corner radii by margin-box and 
border-radius ==
When implementing `shape-outside` in Firefox in [Bug 
1309467](https://bugzilla.mozilla.org/show_bug.cgi?id=1309467), I 
found the calculation of corner radii by margin-box and border-radius 
might need more clarification. Quote from the 
[spec](https://drafts.csswg.org/css-shapes/#valdef-shape-box-margin-box):

> If the ratio of border-radius/margin is 1 or more, then the margin 
box corner radius is border-radius + margin. If the ratio of 
border-radius/margin is less than 1, then the margin box corner radius
 is border-radius + (margin * (1 + (ratio-1)^3)).

My questions mainly related to the `ratio < 1` case.
1) Suppose `ratio < 1` and `margin > 0`. Why do we need to adjust 
margin by `margin * (1 + (ratio-1)^3)` which makes the margin even 
smaller? It seems `border-radius + margin` is fine.
2) Suppose `margin < 0`, and we allow negative margin to reduce the 
final corner radii from border-radius. However based on the formula, 
it makes the final corner radii bigger! For example, suppose 
border-radius is 10px and margin is -5px, so the ratio is -2. The 
final corner radii is `10 + (-5) * (1 + (-3)^3) = 140`. So it seems 
the spec needs some clarification when `margin < 0`. Again simple 
`border-radius + margin` seems fine with negative margin. If we do 
allow negative margin, the spec should explicit say that the corner 
radii is the larger of 0 and the final result.

cc @astearns @dbaron 

Please view or discuss this issue at 
https://github.com/w3c/csswg-drafts/issues/675 using your GitHub 
account

Received on Thursday, 3 November 2016 08:31:05 UTC