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

Add presentation section. #37

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 41 additions & 2 deletions permission-element.bs
Original file line number Diff line number Diff line change
Expand Up @@ -583,8 +583,6 @@ To <dfn for="HTMLPermissionElement">recheck type permissibility</dfn> for a

# Rendering the <{permission}> Element # {#rendering}

## Presentation ## {#presentation}

The <{permission}> element is a [=non-devolvable widget=] and is chiefly
rendered like a <{button}>. The button label is largely expected to be
determined by the browser, rather than the page, and reflects the
Expand All @@ -595,6 +593,47 @@ constraints to prevent abuse (e.g. minimum and maximum sizes for fonts and
the label itself). The page can also select a locale for the text via the
<{html-global/lang}> attribute.

## Presentation ## {#presentation}

ISSUE: There isn't much precedence for describing the user agent UI in detail.
It may be better to leave more freedom to user agents.

The <{permission}> element contains browser-chosen content, text and maybe an
icon. Activating it will [=prompt the user to choose=].
This provides two bits of user interface that a user can interact with.
The [=user agent=] is largely free to determine these &mdash; rendering of the
<{permission}> element and the subsequent [=prompt the user to choose|permission
prompt=] &mdash; in whichever way it thinks best convey's the element's intent.


UI options for the <{permission}> element's presentation include:

* Name the [=powerful features=] listed in {{[[Types]]}}, in the language
indicated by the [=language=] of the element. Note that this would
always be the language indicated by the <{html-global/lang}> attribute,
if present.
* An icon indicating the [=powerful feature=] type or types.
* The current [=permission state=] of the [=powerful feature=] in questions.
For example, if the [=powerful feature|permission=] is already
{{PermissionState/granted}}, the <{permission}> element might be labeled
as "geolocation already in use".
* A modal [=prompt the user to choose|prompt=] with a "scrim".
(I.e., darkening out the page behind the prompt.)
This would normally quite disruptive. But here our goal is to ensure a
user means to make this choice.

[=User agents=] are encouraged to name or describe the [=powerful features=]
in a way that's consistent with similar usage in program or the platform it
is running on.

Very non-normative examples might be:

* `<permission lang="de" types="geolocation">`: "Standort verwenden".
* `<permission types="microphone">` (in an English language page): "Use microphone. &#x1f3a4;".
* Upon activiating `<permission types="microphone">`, when the corresponding
[=permission state=] is {{PermissionState/denied}}, modify the text to
"Continue blocking".

## Styling ## {#style}

A <{permission}> element constrains the styling that can be applied to it.
Expand Down