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

Initial draft: HTMLPermissionElement definition. #31

Merged
merged 8 commits into from
Oct 14, 2024

Conversation

otherdaniel
Copy link
Collaborator

@otherdaniel otherdaniel commented Aug 7, 2024

Initial draft for HTMLPermissionElement.

  • Definition of the element.
  • Algorithms around activation + blocking behaviour.

Currently missing anything around styling, plus a whole lot of explanatory prose.


Preview | Diff

<dd>{{HTMLPermissionElement/invalidReason}} — Return a string representation of why the element currently cannot be activated.</dd>
<dd>{{HTMLPermissionElement/ondismiss}} — notifies when the user has dismissed the permission prompt.</dd>
<dd>{{HTMLPermissionElement/onresolve}} — notifies when a permission prompt has been answered by the user (positively or negatively).</dd>
<dd>{{HTMLPermissionElement/onvalidationstatuschange}} — notifies when the validation status changes.</dd>
Copy link
Collaborator

@andypaicu andypaicu Aug 21, 2024

Choose a reason for hiding this comment

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

The generic lang attribute (https://html.spec.whatwg.org/multipage/dom.html#attr-lang) has special significance for the permission element as it will dictate the actual text of the element. I'm not sure if this is to be added here or another section is more appropriate.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

lang is part of the global attributes; so I don't we can put them into the IDL bits. I think the solution is to just refer to it in algorithms, then.

Maybe we can add a note to make it more obvious.

ISSUE: Check attribute & event handler & invalid reason names against
current proposal(s).

ISSUE: The onvalidationstatuschange event has (Or should have) parameters
Copy link
Collaborator

@andypaicu andypaicu Aug 21, 2024

Choose a reason for hiding this comment

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

we were thinking that the attributes on the element are sufficient and the developer can use event.target.invalidReason directly. Is it common or good practice to add more info in the event itself (seems redundant to me but I'm uninformed)?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

"Common or good practice": No idea, honestly. I'll leave this as-is, for now.

permission-element.bs Outdated Show resolved Hide resolved
permission-element.bs Outdated Show resolved Hide resolved
permission-element.bs Outdated Show resolved Hide resolved
permission-element.bs Outdated Show resolved Hide resolved
permission-element.bs Outdated Show resolved Hide resolved
<div algorithm="HTMLPermissionElement/isValid">
HTMLPermissionElement |element|'s <dfn>isValid</dfn> getter steps are:

1. Return whether |element|'s [=HTMLPermissionElement/blocker=] is Nothing.
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this is not correct since the list can return expired blockers right?

Copy link
Collaborator Author

@otherdaniel otherdaniel Sep 10, 2024

Choose a reason for hiding this comment

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

I don't think I agree: The blocker algorithm checks for validity.

permission-element.bs Outdated Show resolved Hide resolved
permission-element.bs Outdated Show resolved Hide resolved
permission-element.bs Outdated Show resolved Hide resolved
Copy link
Collaborator

@andypaicu andypaicu left a comment

Choose a reason for hiding this comment

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

Had a first-pass, looks very good. Left some feedback on various points. Thank you.

@otherdaniel otherdaniel changed the title [NOT READY FOR COMMIT] Initial draft: HTMLPermissionElement definition. Initial draft: HTMLPermissionElement definition. Oct 14, 2024
@otherdaniel otherdaniel merged commit 1f241e6 into WICG:main Oct 14, 2024
2 checks passed
github-actions bot added a commit that referenced this pull request Oct 14, 2024
SHA: 1f241e6
Reason: push, by otherdaniel

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
github-actions bot added a commit to otherdaniel/PEPC that referenced this pull request Oct 14, 2024
SHA: 1f241e6
Reason: push, by otherdaniel

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants