🌐 US-Proxy
class="logged-out env-production page-responsive" style="word-wrap: break-word;" >
Skip to content

[motion] CSS and SVG box correspondence seems overly-simplistic #66

Closed

Description

@fantasai

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.

Activity

  1. dbaron commented on Apr 21, 2017

    @dbaron
    Member

    This should maybe be a duplicate of w3c/csswg-drafts#857.

  2. fantasai commented on Jul 2, 2018

    @fantasai
    ContributorAuthor
  3. fantasai commented on Jan 10, 2020

    @fantasai
    ContributorAuthor

    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.]

  4. AmeliaBR commented on Mar 4, 2020

    @AmeliaBR

    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”.

  5. fantasai commented on Mar 5, 2020

    @fantasai
    ContributorAuthor
  6. tabatkins commented on May 20, 2021

    @tabatkins
    Member

    Partially fixed in b0cc95a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions