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

[NOT READY FOR COMMIT] Initial draft: HTMLPermissionElement definition. #31

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

Conversation

otherdaniel
Copy link
Collaborator

@otherdaniel otherdaniel commented Aug 7, 2024

<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.

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