Skip to content

[css-display] What are "form controls"? #1024

Closed

Description

@bzbarsky

#540 introduced language like this:

This value has no effect on replaced elements and form controls; it computes to inline exactly as if the UA style sheet had specified display: inline !important on such elements.

The term "form controls" is not defined, so I have no idea how to go about implementing this.

@fantasai @zcorpan @MatsPalmgren

Activity

  1. bzbarsky commented on Feb 10, 2017

    @bzbarsky
    Author

    More generally, though, I think this approach is not great: it inhibits sharing and caching of computed style data in nasty ways, because now you have to worry about which exact elements are being styled, not just the styles themselves, to determine whether you get the same computed styles given identical specified style inputs.

  2. emilio commented on Feb 10, 2017

    @emilio
    Collaborator

    I believe it makes sense to just ignore display: contents and make it act as an inline, just as svg { display: flex } is treated as block-like, even though it computes to flex.

  3. MatsPalmgren commented on Feb 14, 2017

    @MatsPalmgren

    This is what the CSSWG actually decided:

    RESOLVED: display:contents behaves as display:inline for all replaced elements and all form controls
    https://lists.w3.org/Archives/Public/www-style/2017Feb/0062.html

    @fantasai It seems to me that the spec change doesn't correspond to what was actually decided. ("behaves as" does not mean "computes to")

  4. SelenIT commented on Feb 15, 2017

    @SelenIT
    Collaborator

    Shouldn't the term 'replaced elements' be clarified, too? The "Rendering" section of HTML spec clearly places "Form controls" into "Non-replaced elements" list. Also, according to the current definition from CSS2.1+

    An element whose content is outside the scope of the CSS formatting model

    the button element, for example, doesn't fit to the replaced element definition, since its content is the regular HTML DOM subtree, styled with normal CSS by the CSS formatting rules. Moreover, form controls internally presented as UA Shadow DOM components styled with UA built-in styles still belong to the CSS formatting model, and therefore don't completely match the definition of 'replaced elements'.

    Doesn't the CSS definition of "replaced elements" need to be updated?

  5. zcorpan commented on Feb 15, 2017

    @zcorpan
    Contributor

    Nothing claims that button is a replaced element, and it isn't one. I think HTML says already which are replaced elements. So is there a problem?

  6. SelenIT commented on Feb 15, 2017

    @SelenIT
    Collaborator

    Until HTML clarified their definintion, there was some ambiguity that allowed to treat button as a replaced element.

  7. astearns commented on Mar 8, 2017

    @astearns
    Member

    Will defer to the whatwg/html issue on this, and have our specs reference their solution

  8. fantasai commented on Mar 9, 2017

    @fantasai
    Collaborator

    (And in the meantime have a handwavy definition pointing vaguely at it. ;)

  9. fantasai commented on Mar 9, 2017

    @fantasai
    Collaborator

    Okay, pushed changes. The handwavy definition is “replaced elements, form controls (i.e. user interface elements whose element type can accept and/or submit user data, such as <input> and <button>), and (obviously) empty elements”. We'll add a link to HTML once we have a target.

    Let me know if there's any problem with the changes. Closing until then. :)

  10. fantasai commented on Mar 9, 2017

    @fantasai
    Collaborator

    Actually, the definition of submittable element is better than that parenthetical, so using that for now.

  11. bzbarsky commented on Mar 9, 2017

    @bzbarsky
    Author

    @fantasai What about #1024 (comment) ? Is that being tracked somewhere?

  12. fantasai commented on Mar 9, 2017

    @fantasai
    Collaborator
  13. bzbarsky commented on Mar 9, 2017

    @bzbarsky
    Author

    Ah, great, thank you.

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