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

Clarify off-scope theme color #879

Conversation

christianliebel
Copy link
Member

@christianliebel christianliebel commented May 27, 2020

Closes #755

This change (choose one):

  • Breaks existing normative behavior (please add label "breaking")
  • Adds new normative requirements
  • Adds new normative recommendations or optional items
  • Makes only editorial changes (only changes informative sections, or
    changes normative sections without changing behavior)
  • Is a "chore" (metadata, formatting, fixing warnings, etc).

Implementation commitment (delete if not making normative changes):

  • Safari (link to issue)
  • Chrome (link to issue)
  • Firefox (link to issue)
  • Edge (public signal)

Commit message:

Currently, the specification does not define which theme color should be applied to an application context when the user navigates off the scope. This change attempts to clarify the behavior.


Preview | Diff

index.html Outdated
that the user is navigating off scope.
that the user is navigating off scope. In addition, the user agent
SHOULD reset the <a>application context</a>'s <a>default theme
color</a> to its default value. The off-scope document may override
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is its default value defined? or are you referring to "a User Agent defined default value"?

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated. Thanks!

"theme-color".
the <a>theme color</a> for all browsing contexts <a data-lt=
"within-scope-manifest">within scope</a> to which the manifest is
<a>applied</a>. However, a document may override the <a>default theme
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should that be MAY @marcoscaceres ?

Copy link
Collaborator

Choose a reason for hiding this comment

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

As I wrote on the other review comment: you can't use the word "may" without it being in all-caps, making it a normative requirement. And you can't impose a normative requirement on the document; all requirements are imposed on the user agent.

(I know this is a problem with the existing text as well. We should fix it.)

Copy link
Collaborator

@mgiuca mgiuca left a comment

Choose a reason for hiding this comment

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

I don't think this is the right behaviour. (I will have to check later what the Chrome behaviour is, this is just my initial reaction.)

I think it's important to allow the application to theme its own window, even when navigating off scope. It's not a web browser window, it's an application window, so I wouldn't expect pages navigated within to override the theme of the application.

It looks like the current specification already kinda does this by allowing the document to override the theme color explicitly (I already think that's a problem, and I don't think Chrome at least follows it). This takes it further by saying the UA should reset to a default theme colour when off scope. I'd like to make a counter-proposal, which is that we recommend that the application theme colour is preserved when navigating off scope.

@@ -504,7 +504,12 @@ <h2>
at least its <a>origin</a>, including whether it is served over a
secure connection. This UI SHOULD differ from any UI used when the
[=Document/URL=] is <a>within scope</a>, in order to make it obvious
that the user is navigating off scope.
that the user is navigating off scope. In addition, the user agent
SHOULD reset the <a>application context</a>'s <a>default theme
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't like the term "reset" or "default theme color", since it implies making a permanent change to the default theme color itself. Rather, could it just say "SHOULD ignore the application's default theme color, instead using the theme color of the current document". (This could be more formal, but that's the idea.)

that the user is navigating off scope. In addition, the user agent
SHOULD reset the <a>application context</a>'s <a>default theme
color</a> to a user agent-defined default value. The off-scope document
may override that color through the inclusion of a valid [[HTML]]
Copy link
Collaborator

Choose a reason for hiding this comment

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

You can't use the word "may" without it being in all-caps, making it a normative requirement. And you can't impose a normative requirement on the document; all requirements are imposed on the user agent.

"The user agent MAY use the HTML meta element whose name attribute is "theme-color" of the off-scope document to theme the application context."

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.

What theme color should be used when a PWA window is out of scope?
4 participants