Skip to content

[css-shapes-1] Unclear on "margin-box" dimensions when box model is over-constrained #3275

Closed
@faceless2

Description

@faceless2

The "margin-box" in question is the one defined in css-shapes-1 relating to basic shapes. In this example:

<body style="width: 1000px">
 <div style="width:100px; margin-left: 100px; margin-right: 100px; clip-path: ellipse()"></div>
</body>

There seems to be a presumption in the spec, in Firefox's implementation and the web-platform-test clip-path-polygon-008.html that the ellipse is calculated against a width of 300px.

"All the lengths expressed in percentages are resolved from the used dimensions of the reference box.", but CSS 2.1 10.3.3 indicates that the used value of margin-right in the above example is 800px: the values are overconstrained so the computed value for margin-right is ignored.

If the two margin values above are changed to auto, then the used values are (1000px-100px) / 2 = 450px each. This matches the behaviour of Firefox, which is the only browser I have here that supports this syntax.

So one of two things has to give:

  1. Is the intention more like "... percentages are resolved from not-quite-used dimensions of the reference box; these are identical to the used dimensions in the way that percentages and "auto" values are resolved, but any additional constraints on used values described in CSS2.1 section 10 are not applied"? If so then the spec needs updating to reflect this, and I have a feeling this area might be more complex than it appears.

  2. The specified behaviour is correct, in which case the testcase and implementation(s) need updating. If that's the decision I'm happy to update the testcase.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions