You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[motion] CSS and SVG box correspondence seems overly-simplistic #66
For SVG elements without associated CSS layout box, the used value for content-box, padding-box, border-box and margin-box is fill-box.
For elements with associated CSS layout box, the used value for fill-box, stroke-box and view-box is border-box.
The Paint module uses a bit more sophistication in its box mappings: content-box | padding-box -> fill-box and border-box -> stroke-box. (The mapping in the other direction relates to text bounds, which is maybe not appropriate here.) At the very least, these two modules should be consistent in how they map the SVG and CSS terms where possible.
I've copied out the definitions into the css-box-3 module, since that seems like a useful place to centralize these definitions: https://drafts.csswg.org/css-box-3/
My proposal is that we adopt these definitions in css-box-3 and rebase all the other specs' -box property value definitions over it, then push the spec to CR (dropping margin-trim if necessary).
[See also https://github.com/w3c/csswg-drafts/issues/4662 ; I've left the coordinate aspect of the view-box definition out until that's resolved.]
I agree that it makes sense to define these in a single place & the box model spec makes as much sense as any.
With respect to the definition text:
The phrases “SVG context” and “CSS context” should be defined.
It's important to note that some elements (<svg> and <foreignObject>) can have both SVG and CSS contexts associated with them, for the internal vs external layout systems. So the fallbacks should be worded as “if this element doesn't have a [CSS|SVG] layout context, use this fallback”.
Activity
dbaron commentedon Apr 21, 2017
This should maybe be a duplicate of w3c/csswg-drafts#857.
fantasai commentedon Jul 2, 2018
Resolved in w3c/csswg-drafts#857 (comment)
[css-box-3] Define all the box keywords in the box spec. Relates to w…
fantasai commentedon Jan 10, 2020
I've copied out the definitions into the css-box-3 module, since that seems like a useful place to centralize these definitions: https://drafts.csswg.org/css-box-3/
My proposal is that we adopt these definitions in css-box-3 and rebase all the other specs' -box property value definitions over it, then push the spec to CR (dropping
margin-trimif necessary).[See also https://github.com/w3c/csswg-drafts/issues/4662 ; I've left the coordinate aspect of the
view-boxdefinition out until that's resolved.]AmeliaBR commentedon Mar 4, 2020
I agree that it makes sense to define these in a single place & the box model spec makes as much sense as any.
With respect to the definition text:
The phrases “SVG context” and “CSS context” should be defined.
It's important to note that some elements (
<svg>and<foreignObject>) can have both SVG and CSS contexts associated with them, for the internal vs external layout systems. So the fallbacks should be worded as “if this element doesn't have a [CSS|SVG] layout context, use this fallback”.fantasai commentedon Mar 5, 2020
Resolved in https://lists.w3.org/Archives/Public/www-style/2020Feb/0011.html
tabatkins commentedon May 20, 2021
Partially fixed in b0cc95a
[motion-1] Remove lingering excess definition of coord-box keyword ma…
[motion-1] Remove lingering excess definition of coord-box keyword ma…