Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[css-ui-4] Define how to compute the kind of widget to use for an element #6537

Closed
wants to merge 14 commits into from

Conversation

howard-e
Copy link
Contributor

@howard-e howard-e commented Aug 23, 2021

[css-ui-4] Define how to compute the kind of widget to use for an element. Relevant to #3526 (comment).

Tests:

…isable native appearance and how to compute the kind of widget for a given element
@zcorpan zcorpan self-requested a review August 23, 2021 15:32
Copy link
Member

@zcorpan zcorpan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice @howard-e! Some comments mostly on cross-references and dfns

css-ui-4/Overview.bs Outdated Show resolved Hide resolved
css-ui-4/Overview.bs Outdated Show resolved Hide resolved
css-ui-4/Overview.bs Outdated Show resolved Hide resolved
css-ui-4/Overview.bs Outdated Show resolved Hide resolved
css-ui-4/Overview.bs Outdated Show resolved Hide resolved
css-ui-4/Overview.bs Outdated Show resolved Hide resolved
css-ui-4/Overview.bs Outdated Show resolved Hide resolved
css-ui-4/Overview.bs Outdated Show resolved Hide resolved
@frivoal
Copy link
Collaborator

frivoal commented Aug 24, 2021

Edit: moved this text to be a comment in the issue rather than on the PR, since my question is about the approach rather than the details. #3526 (comment)

@zcorpan
Copy link
Member

zcorpan commented Aug 24, 2021

@frivoal that happens so rarely that I think it's a non-problem. The property behaves differently for different kinds of widgets, how would you define it without listing them?

css-ui-4/Overview.bs Outdated Show resolved Hide resolved
css-ui-4/Overview.bs Outdated Show resolved Hide resolved
css-ui-4/Overview.bs Outdated Show resolved Hide resolved
@zcorpan
Copy link
Member

zcorpan commented Aug 24, 2021

The content now looks good to me! 👍

Reading the generated spec and the surrounding context, I'm not sure the placement is ideal. I think it makes more sense to introduce a new section, before "Effects of appearance on Decorative Aspects of Elements", called something like "Computing the kind of widget".

Copy link
Member

@zcorpan zcorpan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@zcorpan zcorpan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It turns we have missed to specify steps for "radio" and "checkbox". I think they should be similar to progress-bar/meter, i.e. authorProps doesn't result in 'none' appearance.

Also "listbox" (<select multiple>), which I think should be like button

Since menulist-button depends on computedAppearance, but menulist does not, menulist-button needs to be checked first.
@zcorpan
Copy link
Member

zcorpan commented Sep 9, 2021

whatwg/html#7004 hooks into this from HTML

@zcorpan
Copy link
Member

zcorpan commented Sep 10, 2021

@zcorpan
Copy link
Member

zcorpan commented Sep 30, 2021

In https://bugzilla.mozilla.org/show_bug.cgi?id=1730147#c5 @emilio wrote

For meter, Chromium has the same rendering between the two, while WebKit and Gecko have different rendering. But for progress all browsers seem to agree to have different appearances (the second being like appearance: none).

I think ~all browsers agree on disabling native styling when backgrounds/borders are specified on ~all html-exposed widgets except checkboxes and radios. So I'm not sure why meter would be different, so I think Gecko/WebKit behavior is slightly better.

When I worked on this originally, browsers were less consistent, and the appearance: none rendering for progress and meter in some browsers was no style and render the children (like a span). There were objections to that behavior, and it has now changed in browsers. But it seems the new normal is to do the fallback thing for progress and meter. See #356

moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Oct 3, 2021
…ents in non-HTML namespace, a=testonly

Automatic update from web-platform-tests
[css-ui] Test 'appearance: auto' on elements in non-HTML namespace

See w3c/csswg-drafts#6537 and whatwg/html#7004

--

wpt-commits: ec305acf8ade06f8e9c05c75133aed4426c52b62
wpt-pr: 30539
jamienicol pushed a commit to jamienicol/gecko that referenced this pull request Oct 4, 2021
…ents in non-HTML namespace, a=testonly

Automatic update from web-platform-tests
[css-ui] Test 'appearance: auto' on elements in non-HTML namespace

See w3c/csswg-drafts#6537 and whatwg/html#7004

--

wpt-commits: ec305acf8ade06f8e9c05c75133aed4426c52b62
wpt-pr: 30539
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Oct 4, 2021
…ents in non-HTML namespace, a=testonly

Automatic update from web-platform-tests
[css-ui] Test 'appearance: auto' on elements in non-HTML namespace

See w3c/csswg-drafts#6537 and whatwg/html#7004

--

wpt-commits: ec305acf8ade06f8e9c05c75133aed4426c52b62
wpt-pr: 30539
jamienicol pushed a commit to jamienicol/gecko that referenced this pull request Oct 6, 2021
…ents in non-HTML namespace, a=testonly

Automatic update from web-platform-tests
[css-ui] Test 'appearance: auto' on elements in non-HTML namespace

See w3c/csswg-drafts#6537 and whatwg/html#7004

--

wpt-commits: ec305acf8ade06f8e9c05c75133aed4426c52b62
wpt-pr: 30539
@w3c w3c deleted a comment from css-meeting-bot Jan 19, 2022
@css-meeting-bot
Copy link
Member

The CSS Working Group just discussed Kind of widget for an element.

The full IRC log of that discussion <emilio> topic: Kind of widget for an element
<emilio> github: https://github.com//pull/6537
<emilio> florian: haven't looked into this recently
<emilio> astearns: I think we should accept the edits and file issues if there are remaining problems
<emilio> fantasai: I'd like that to be conditional on florian's approval
<emilio> florian: Can we defer this to next week? Need to check changes were made
<emilio> Rossen_: yeah, that's fine, don't want to get that landed and then review it

@frivoal
Copy link
Collaborator

frivoal commented Jan 26, 2022

Please see the comment I left in the issue that is PR addresses: #3526 (comment) and #3526 (comment)

@w3c w3c deleted a comment from css-meeting-bot Jan 26, 2022
@css-meeting-bot
Copy link
Member

The CSS Working Group just discussed [css-ui-4] Define how to compute the kind of widget to use for an element.

The full IRC log of that discussion <emeyer> Topic: [css-ui-4] Define how to compute the kind of widget to use for an element
<emeyer> github: https://github.com//pull/6537
<emeyer> florian: I reviewed this a while back. No issue with the specifics; issue with the overall approach.
<emeyer> …Overall, I think it’s odd to have a CSS spec define every type of HTML widget.
<emeyer> …The definition of a text field is “a one-line input that looks like a text field”. That’s almost tautological.
<emeyer> …Definitions of inputs should be over in the HTML spec. I think we should define widgets that define like foo, those that act like blah.
<emeyer> …If we think this is the right approach, the text content is fine. But I don’t think this is the right approach.
<emeyer> zcorpan: I co-authored this. I hear two things. One: the algorithm should refactor so it doesn’t repeat. Two: the definitions are vague.
<emeyer> …If the WG thinks descriptions of rendering should be in HTML, that’s fine with me.
<emeyer> florian: The way they look is tied to how they behave and what they do. All these are sort of kind of replaced elements, but they seem outside of the scope of what CSS controls, in terms of both appearance anad behavior.
<emeyer> …If we want to specify their appearance in detail and think the specifics of that should be in CSS, I see why you want it here.
<emeyer> …Do we expect that this would define how things would look in not-HTML languages? That seems odd.
<emeyer> zcorpan: For the applicability of other languages, I see that as hypothetical.
<emeyer> florian: You can style plain XML with CSS.
<emeyer> zcorpan: I don’t see why someone would want to invent a new language that recycles stuff from HTML.
<emeyer> florian: I stand by my original position, but I feel less strongly about it.
<emeyer> …This seems like it touches on OpenUI and what they plan to do.
<emeyer> astearns: Any other opinions?
<emeyer> …Florian and Simon, do you think we can resolve on this today, or should we pull in others?
<emeyer> florian: I think refactoring is good, we can at least do that. We should also talk with Greg [Whitworth].
<bkardell_> there is open agenda space in the openui call - suggest you add it?
<emeyer> zcorpan: I don’t think it’s super urgent at this point.
<emeyer> florian: This has helped me progress. We’ll get back to this later?
<bkardell_> there is a call tomorrow
<emeyer> astearns: We’ll take this back to the PR and the issue and see what we can do there.

@astearns astearns removed the Agenda+ label Jan 26, 2022
@zcorpan
Copy link
Member

zcorpan commented Feb 3, 2022

Open UI discussed this today: https://www.w3.org/2022/02/03-openui-minutes.html

RESOLUTION: For elements without a concept of native appearance, we should use appearance: none.

@zcorpan
Copy link
Member

zcorpan commented Feb 3, 2022

@frivoal can you clarify how you envisioned the algorithm would be refactored? Since there's no connection between the term "can be a button" and "kind of widget/button", we'd need to specify that mapping somehow.

@zcorpan
Copy link
Member

zcorpan commented Mar 30, 2022

This change, which was implemented and shipped in Chromium and Gecko in 2020, not landing in the spec yet is now blocking implementation in WebKit and thus blocking interoperability improvements. See web-platform-tests/wpt#33401

@frivoal 's request to refactor is an editorial change, and so I'd like to push back on that at this point. We can track it in an issue.

Can we merge?

@zcorpan zcorpan added the Agenda+ label Apr 5, 2022
@zcorpan
Copy link
Member

zcorpan commented Apr 8, 2022

The corresponding PR for HTML whatwg/html#7004 has been reviewed and is ready to merge when this PR is merged.

@css-meeting-bot
Copy link
Member

The CSS Working Group just discussed Compute the widget for an element.

The full IRC log of that discussion <TabAtkins> Topic: Compute the widget for an element
<TabAtkins> github: https://github.com//pull/6537#issuecomment-1083049538
<TabAtkins> florian: We discussed this last time, and I think we agreed that doing an editorial refactor was desriable
<TabAtkins> florian: But the convo, largely by my fault, fell by the wayside and hasn't made progress
<TabAtkins> florian: So request is to merge now because I have no substantive disagreements, and track the editorial refactor separatey.
<TabAtkins> florian: Seems reasonable, only hesitant is the changes to address the editorial bit have to land in both HTML and CSS, and it seems easier to get them done before.
<TabAtkins> florian: So if considered reasonable I'd like to have one week to try and finish the changes, but if tha'ts too much I yield
<TabAtkins> astearns: otoh, we could just merge this, have you do the check, and if there's something you want addressed before HTML picks up the change you have a week to pick that up
<TabAtkins> florian: HTML is waiting for us, so once we merge they'll probably merge
<TabAtkins> astearns: Fair. Anyone prefer merging now rather than waiting one more week?
<TabAtkins> [silence]
<TabAtkins> astearns: Okay, you have a deadline.

frivoal added a commit to frivoal/html that referenced this pull request Apr 18, 2022
This is an editorial rewrite of the prior work by Bocoup (@zcorpan and
@howard-e):
* whatwg#7004
* w3c/csswg-drafts#6537

Co-authored-by: fantasai <fantasai.bugs@inkedblade.net>
Co-authored-by: Simon Pieters <zcorpan@gmail.com>
Co-authored-by: Howard Edwards <howarde.edwards@gmail.com>
frivoal added a commit to frivoal/csswg-drafts that referenced this pull request Apr 18, 2022
Relates to w3c#3526

This is part of an editorial rewrite of the prior work by Bocoup
(@zcorpan and @howard-e):
* whatwg/html#7004
* w3c#6537

Co-authored-by: fantasai <fantasai.bugs@inkedblade.net>
Co-authored-by: Simon Pieters <zcorpan@gmail.com>
Co-authored-by: Howard Edwards <howarde.edwards@gmail.com>
@frivoal
Copy link
Collaborator

frivoal commented Apr 18, 2022

Alternative refactored version posted here: #7224

frivoal added a commit to frivoal/csswg-drafts that referenced this pull request Apr 19, 2022
Relates to w3c#3526

This is part of an editorial rewrite of the prior work by Bocoup
(@zcorpan and @howard-e):
* whatwg/html#7004
* w3c#6537

Co-authored-by: fantasai <fantasai.bugs@inkedblade.net>
Co-authored-by: Simon Pieters <zcorpan@gmail.com>
Co-authored-by: Howard Edwards <howarde.edwards@gmail.com>
frivoal added a commit to frivoal/csswg-drafts that referenced this pull request Apr 20, 2022
Relates to w3c#3526

This is part of an editorial rewrite of the prior work by Bocoup
(@zcorpan and @howard-e):
* whatwg/html#7004
* w3c#6537

Co-authored-by: fantasai <fantasai.bugs@inkedblade.net>
Co-authored-by: Simon Pieters <zcorpan@gmail.com>
Co-authored-by: Howard Edwards <howarde.edwards@gmail.com>
frivoal added a commit that referenced this pull request Apr 20, 2022
)

Relates to #3526

This is part of an editorial rewrite of the prior work by Bocoup
(@zcorpan and @howard-e):
* whatwg/html#7004
* #6537

Co-authored-by: fantasai <fantasai.bugs@inkedblade.net>
Co-authored-by: Simon Pieters <zcorpan@gmail.com>
Co-authored-by: Howard Edwards <howarde.edwards@gmail.com>

Co-authored-by: fantasai <fantasai.bugs@inkedblade.net>
Co-authored-by: Simon Pieters <zcorpan@gmail.com>
Co-authored-by: Howard Edwards <howarde.edwards@gmail.com>
@frivoal frivoal added Closed as Retracted When the person who raised the issue thinks that there's no issue after all. and removed Agenda+ labels Apr 20, 2022
@frivoal
Copy link
Collaborator

frivoal commented Apr 20, 2022

Closing as retracted, since @zcorpan (and the WG) accepted #7224 as a preferable alternative.

@frivoal frivoal closed this Apr 20, 2022
domenic pushed a commit to whatwg/html that referenced this pull request Apr 25, 2022
Closes #7004 by superseding it. See also w3c/csswg-drafts#6537 and w3c/csswg-drafts#7224.

Co-authored-by: fantasai <fantasai.bugs@inkedblade.net>
Co-authored-by: Simon Pieters <zcorpan@gmail.com>
Co-authored-by: Howard Edwards <howarde.edwards@gmail.com>
mfreed7 pushed a commit to mfreed7/html that referenced this pull request Jun 3, 2022
Closes whatwg#7004 by superseding it. See also w3c/csswg-drafts#6537 and w3c/csswg-drafts#7224.

Co-authored-by: fantasai <fantasai.bugs@inkedblade.net>
Co-authored-by: Simon Pieters <zcorpan@gmail.com>
Co-authored-by: Howard Edwards <howarde.edwards@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Closed as Retracted When the person who raised the issue thinks that there's no issue after all.
Projects
No open projects
December 15 meeting
Can wait until 2022
January 19 meeting
Lingering Issues
Development

Successfully merging this pull request may close these issues.

None yet

5 participants