[css-shapes] Calculation of corner radii by margin-box and border-radius · Issue #675 · w3c/csswg-drafts (original) (raw)
Navigation Menu
- Explore
- Pricing
Provide feedback
Saved searches
Use saved searches to filter your results more quickly
Description
When implementing shape-outside
in Firefox in Bug 1309467, I found the calculation of corner radii by margin-box and border-radius might need more clarification. Quote from the spec:
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.
- Suppose
ratio < 1
andmargin > 0
. Why do we need to adjust margin bymargin * (1 + (ratio-1)^3)
which makes the margin even smaller? It seemsborder-radius + margin
is fine. - 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 is10 + (-5) * (1 + (-3)^3) = 140
. So it seems the spec needs some clarification whenmargin < 0
. Again simpleborder-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.