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

<dialog> centered alignment text is very opaque #5178

Closed
smfr opened this issue Dec 22, 2019 · 5 comments
Closed

<dialog> centered alignment text is very opaque #5178

smfr opened this issue Dec 22, 2019 · 5 comments
Labels
clarification Standard could be clearer integration Better coordination across standards needed topic: dialog The <dialog> element topic: rendering

Comments

@smfr
Copy link

smfr commented Dec 22, 2019

No normal human can understand this paragraph (which is also a single sentence):

When an element subject is placed in centered alignment mode, and when it is in that mode and has new rendering boxes created, the user agent must set up the element such that its static position of the edge that corresponds to subject's parent's block-start edge, for the purposes of calculating the used value of the appropriate box offset property ('top', 'right', 'bottom', or 'left'), is the value that would place the element's margin edge on the side that corresponds to subject's parent's block-start side as far from the same-side edge of the viewport as the element's opposing side margin edge from that same-side edge of the viewport, if the element's dimension ('width' or 'height') in subject's parent's block flow direction is less than the same-axis dimension of the viewport, and otherwise is the value that would place the element's margin edge on the side that corresponds to subject's parent's block-start side at the same-side edge of the viewport.

at https://html.spec.whatwg.org/multipage/interactive-elements.html#centered-alignment

I think it's saying that centering is like auto margins, but it's very hard to tell.

@smfr
Copy link
Author

smfr commented Jan 2, 2020

I filed issue 4645 in CSS to discuss the problem that this isn't implementable as some UA stylesheet rules.

@annevk annevk added clarification Standard could be clearer topic: rendering integration Better coordination across standards needed labels Jan 13, 2020
@annevk
Copy link
Member

annevk commented Jan 13, 2020

Thanks @smfr! I think ideally @whatwg/css takes care of providing primitives for this in CSS as you suggest and then we make dialog use those.

@fantasai
Copy link
Contributor

Conclusion from the CSSWG issue:

  • The dialog is assigned to the "top layer" (which probably should be defined in css-position-3 once it's rewritten, but is currently defined in Fullscreen).
  • DOM snapshots the top/bottom of the viewport as inset property values when the dialog is opened, and rewrites those values if the viewport is resized.
  • The dialog is also assigned align-self: safe center; this takes care of the centering within the viewport.

I think the one question I can think of wrt CSS interaction is where the inset values are injected, if it's at the preshint level or into the style attribute or something else. Depends on what's reasonably implementable and what's reasonably Web-compatible...

@smfr
Copy link
Author

smfr commented Apr 23, 2020

  • The dialog is assigned to the "top layer" (which probably should be defined in css-position-3 once it's rewritten, but is currently defined in Fullscreen).

Is css-postion-3 going to describe stacking order (supersede CSS 2.2 Appendix E)? Because I think the top layer stuff is more about z-ordering than positioning.

@annevk
Copy link
Member

annevk commented Apr 24, 2020

@fantasai was this discussed with implementers? I would imagine them to use some kind of special inset value instead. Reacting to a resize seems like it would be too late.

Would the element always have align-self: safe center unless overridden?

@annevk annevk added the topic: dialog The <dialog> element label May 29, 2020
@domenic domenic closed this as completed in 979af15 Nov 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clarification Standard could be clearer integration Better coordination across standards needed topic: dialog The <dialog> element topic: rendering
Development

No branches or pull requests

3 participants