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] Provide hooks for HTML to define rendering for widgets #7224

Merged
merged 1 commit into from
Apr 20, 2022

Conversation

frivoal
Copy link
Collaborator

@frivoal frivoal commented Apr 18, 2022

@fantasai and I gave a stab at the refactoring of #6537 we had been talking about in #3526. Goal: avoid having to talk about specific HTML elements in the CSS spec, and in particular, avoid having to have long lists of types of widgets.

Doing that was undesirable because:

  • CSS, at least in theory, is not limited to HTML.
  • The descriptions of each types of widgets were stubs “a button is a widget which must have the native appearance of a button”, while the HTML spec held the actual descriptions of the rendering of various elements in its Rendering chapter.
  • This created a bunch of unnecessary indirections between the two specs, making both of them longer and harder to read than necessary.

The resulting spec is much more straightforward and much shorter, so we think this is a better approach.
This PR is the CSS part of this refactor. For the HTML part of the refactor, look here: https://github.com/frivoal/html/pull/new/appearance-compute-widget-3-updated-take-2 (Note: this is not yet submitted as a PR, pending CSSWG review). The HTML part is complete in the sense that it works with the CSS part, but like the original PR from @zcorpan, lacks details about the rendering of each type of widgets. I'd expect the HTML folks to keep iterating from there.

@zcorpan
Copy link
Member

zcorpan commented Apr 20, 2022

Thank you! This indeed seems like a nicer solution. I see that <input type=search> with appearance: textfield and <select>'s devolved state being menulist-button are handled in https://github.com/frivoal/html/pull/new/appearance-compute-widget-3-updated-take-2 , so that's good.

From a first read, it looks equivalent except:

@css-meeting-bot
Copy link
Member

The CSS Working Group just discussed HTML widget rendering PRs, and agreed to the following:

  • RESOLVED: Acccept Florian's pr (7224) and submit the corresponding one to HTML.
The full IRC log of that discussion <TabAtkins> Topic: HTML widget rendering PRs
<TabAtkins> github: https://github.com//pull/7224
<TabAtkins> florian: A while back, zcorpan made a PR against CSS UI and HTML to link the specs together better, and give HTML a way to define how appearance:none works for the different widgets
<TabAtkins> florian: The two specs shared an algo for exactly how the appearance disabled, etc
<TabAtkins> florian: Normatively it was fine, but editorially I thought the css/html split wasn't ideal. The CSS spec ended up defining a button, slider, dropdown, etc, but in a very lightweight way.
<TabAtkins> florian: Then there was back-and-forth bouncing for the dfns.
<TabAtkins> florian: This new PR reorganzies the concept, putting the hTML-specific stuff into HTML and defining some concepts in CSS that HTML can rely on
<TabAtkins> florian: Luckily zcorpan likes the rebalancing.
<astearns> q+
<TabAtkins> florian: And for clarity I did this with fantasai so that makes three of us that like it
<TabAtkins> Rossen_: Just reitering, looks like zcorpan likes the approach, and it's equivlaent except transform-origin
<astearns> q-
<TabAtkins> florian: Right, forgot that normative difference. We have a separate issue for that question.
<TabAtkins> Rossen_: Second question is about revert-level vs revert, he was wondering if this was meant to be revert-layer
<TabAtkins> florian: defer to fantasai
<TabAtkins> fantasai: Yes, of course
<Rossen_> q?
<TabAtkins> florian: So proposed resolution is, after correcting the revert-level mistake, accept the PR and submit the corresponding HTML half as well
<TabAtkins> Rossen_: Comments or objections?
<TabAtkins> RESOLVED: Acccept Florian's pr (7224) and submit the corresponding one to HTML.

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 Author

frivoal commented Apr 20, 2022

From a first read, it looks equivalent except:

Correct. Let's get to the bottom of that difference in that issue.

  • revert-level is handled the same as revert. Is this intended to be revert-layer?

Oops. Nice catch, thank you. Fixed.

Comment on lines +2210 to +2213
if all the declarations of the [=Author Origin=] and [=Animation Origin=]
pertaining to such a [=widget=] are cascaded
and a [=cascaded value=] exists--
and is not ''revert'' or ''revert-layer''--
Copy link
Contributor

Choose a reason for hiding this comment

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

What about

@layer {
  .widget { border-left-style: solid }
}
@layer {
  .widget { border-left-style: revert-layer }
}

The cascaded value is revert-layer, but the native appearance should be disabled anyways since the specified value will be border-left-style: solid.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

filed as #7252

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>
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants