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

Connect HTML spec up to new CSS interactivity property #10956

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

mfreed7
Copy link
Contributor

@mfreed7 mfreed7 commented Jan 28, 2025

I was a bit unsure about a few parts of this PR, so help would be appreciated from the editors. The idea is:

  1. Remove duplication - allow the CSS spec to define the concept of "inert".
  2. Make the inert HTML attribute set interactivity:inert via a new UA stylesheet rule.
  3. Make modal dialogs non-inert via an interactivity:auto UA stylesheet rule.
  4. {later} A rule likely needs to be added for fullscreen elements also, setting :fullscreen {interactivity: auto}.

CSS spec is here: https://drafts.csswg.org/css-ui-4/#inertness


(See WHATWG Working Mode: Changes for more details.)


/indices.html ( diff )
/infrastructure.html ( diff )
/interaction.html ( diff )
/interactive-elements.html ( diff )
/rendering.html ( diff )

I was a bit unsure about a few parts of this PR, so help would be
appreciated from the editors. The idea is:
 1. Remove duplication - allow the CSS spec to define the *concept*
    of "inert".
 2. Make the `inert` HTML attribute set `interactivity:inert` via
    a new UA stylesheet rule.
 3. Make modal dialogs non-inert via an `interactivity:auto` UA
    stylesheet rule.
 {eventual step 4} A rule likely needs to be added for fullscreen
    elements also, setting `interactivity:auto`.
Copy link
Contributor Author

@mfreed7 mfreed7 left a comment

Choose a reason for hiding this comment

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

Thanks for the review!

@nt1m
Copy link
Member

nt1m commented Jan 30, 2025

I think blocked by a modal dialog should be defined in terms of interactivity (either set as a presentational hint on the root, or using an UA stylesheet rule), because otherwise dialog:modal { interactivity: auto } won't do anything (because auto is the default value. I don't think this is what the current HTML spec PR does.

@mfreed7
Copy link
Contributor Author

mfreed7 commented Jan 30, 2025

I think blocked by a modal dialog should be defined in terms of interactivity (either set as a presentational hint on the root, or using an UA stylesheet rule), because otherwise dialog:modal { interactivity: auto } won't do anything (because auto is the default value. I don't think this is what the current HTML spec PR does.

I added a Note about this. But I think the concept (agreed to over in CSSWG I believe) was that both specs can set something to be inert. The problem with defining modal dialog behavior in terms of CSS is that it allows author CSS to make parts of the page "un-inerted", which is undesirable. And it can't be set to interactivity:inert/auto !important to avoid that problem, because then that doesn't allow the author to "re-inert" the dialog itself.

@lilles
Copy link
Contributor

lilles commented Jan 30, 2025

I think blocked by a modal dialog should be defined in terms of interactivity (either set as a presentational hint on the root, or using an UA stylesheet rule), because otherwise dialog:modal { interactivity: auto } won't do anything (because auto is the default value. I don't think this is what the current HTML spec PR does.

I added a Note about this. But I think the concept (agreed to over in CSSWG I believe) was that both specs can set something to be inert. The problem with defining modal dialog behavior in terms of CSS is that it allows author CSS to make parts of the page "un-inerted", which is undesirable. And it can't be set to interactivity:inert/auto !important to avoid that problem, because then that doesn't allow the author to "re-inert" the dialog itself.

Another issue is that no one's been able to come up with UA styles that actually works with shadow DOM.

Copy link
Collaborator

@noamr noamr left a comment

Choose a reason for hiding this comment

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

I've stumbled upon this type of problem when implementing moveBefore things... Thanks for working on this! Added some non-authoritative nits

Copy link
Contributor Author

@mfreed7 mfreed7 left a comment

Choose a reason for hiding this comment

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

Thanks for the comments!

Copy link
Member

@domenic domenic left a comment

Choose a reason for hiding this comment

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

LGTM with nits. This turned out pretty nice; thanks for iterating!

Let me know when the checkboxes in the OP are filled out.

@domenic domenic added topic: style integration Better coordination across standards needed topic: dialog The <dialog> element labels Feb 21, 2025
@mfreed7
Copy link
Contributor Author

mfreed7 commented Feb 21, 2025

LGTM with nits. This turned out pretty nice; thanks for iterating!

Let me know when the checkboxes in the OP are filled out.

Thanks for the review!

  • At least two implementers are interested (and none opposed):

@annevk @emilio would you mind please providing support for landing this?

@mfreed7
Copy link
Contributor Author

mfreed7 commented Feb 21, 2025

@scottaohara @aleventhal does this need any change to the HTML AAM spec? This PR (to HTML) doesn't actually change the behavior of existing things like inert or modal dialogs. The CSSWG spec change (which already landed, here) might need something?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integration Better coordination across standards needed topic: dialog The <dialog> element topic: style
Development

Successfully merging this pull request may close these issues.

5 participants