Skip to content

[css-scroll-snap-1] Unclear what mapping the 4-value longhands use #1050

Closed

Description

@plinss

scroll-padding and scroll-snap-margin shorthands are unclear as to which longhand properties are set (specifically physical or logical).

My guess is that the intent is the shorthand follows the standard TRBL pattern, and then physical sides are mapped to logical longhands based on writing mode, but this is not clear from reading the spec.

Activity

  1. changed the title [-][css-scroll-snap-1] [/-] [+][css-scroll-snap-1] Unclear what mapping the 4-value longhands use[/+] on May 15, 2017
  2. tabatkins commented on May 15, 2017

    @tabatkins
    Member

    We specify this:

    The <length> values give outsets (interpreted as for margin or border-image-outset).

  3. plinss commented on May 20, 2017

    @plinss
    MemberAuthor

    Sorry, this doesn't address my concern at all, first the link to 'border-image-outset' is completely irrelevant as it has neither physical or logical longhands, nor any way to set the values in logical directions (afaict). Second, the link to 'margin' in css2.1 has no reference to or mention of logical properties.

    The concern here came up during TAG review, scroll-snap specifies a shorthand, and both physical and logical longhands, but has absolutely no information that explains how the shorthand maps to the longhands, and the links given don't help. While I could make an educated guess, others couldn't. At the least, a brief sentence explaining that the shorthand sets all the longhands, in the manner described by css-logical §3.2 (or a better link) would be helpful. I get that this is probably obvious to the editors, but it's not obvious to a casual reader (which is the real issue).

  4. fantasai commented on Jun 19, 2017

    @fantasai
    Collaborator

    OK, I checked in some changes. @plinss could you review?

  5. plinss commented on Jun 19, 2017

    @plinss
    MemberAuthor

    It's an improvement (and I accept that you gave me exactly what I asked for), but I still think it could be better.

    1. the description of the scroll-snap-margin and scroll-snap-padding shorthands are referring to margin and padding respectively in CSS2.x, but neither margin nor padding in CSS2.x have any information about how the shorthands relate to the logical longhand properties
    2. I accept that css-logical does define how the margin and padding shorthands relate to the physical and logical properties, but since css-logical doesn't list the scroll-snap properties, then css-scroll-snap should define that interaction. (I do see the first paragraph of appendix A, but it leaves a bit to be inferred.)
    3. Appendix A goes on to describe the scroll-padding-* and scroll-snap-margin-* longhands as being longhands for scroll-padding and scroll-snap-margin, but has no description of the physical/logical split.
    4. There's no mention of the 'logical' keyword being valid in the values of scroll-padding or scroll-snap-margin (unless I missed it).

    Reading css-scroll-snap without having css-logical fully swapped in, can lead a reader to think that a declaration of scroll-padding: 1em will set both the physical and logical longhands, where my (current) understanding of css-logical is that it should only set the physical longhands and leave the logical longhands alone. (Where scroll-padding: logical 1em would set only the logical longhands.)

    Perhaps a paragraph in each of the physical and flow-realtive longhand descriptions in Appendix A stating that the physical longhands are only set by the shorthand when the 'logical' is not present and the flow-relative longhands are only set when the 'logical' keyword is present...

  6. reopened this on Jun 19, 2017
  7. fantasai commented on Jun 20, 2017

    @fantasai
    Collaborator

    The logical keyword is not currently valid in scroll-padding or scroll-snap-margin, because that part of css-logical is insufficiently stable (note the bright red issue!). Whether you treat the shorthand as setting all longhands or only the physical ones is actually irrelevant: both interpretations yield the same result. I'd be perfectly happy to say the shorthands only set the physical longhands, but then we may need to update the spec later if we decide otherwise for css-logical.

  8. plinss commented on Jun 20, 2017

    @plinss
    MemberAuthor

    Ok, so if css-logical isn't stable enough then I accept that it doesn't make sense to be overly specific in this spec. Perhaps an additional sentence in the beginning of Appendix A indicating that the mapping between the shorthand and longhand properties is also determined by css-logical? With that I'd be satisfied.

    (I'm also not sure that the shorthand setting all longhands vs just the physical/logical longhands is irrelevant, while the end result may not be observable in layout/scroll behavior, it will be observable in the CSSOM.)

  9. fantasai commented on Jun 21, 2017

    @fantasai
    Collaborator

    Ok, added 393d993
    Let me know if that looks okay!

  10. plinss commented on Jun 27, 2017

    @plinss
    MemberAuthor

    Works for me, thanks!

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