-
Notifications
You must be signed in to change notification settings - Fork 29
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
Adding User Preferences #57
base: gh-pages
Are you sure you want to change the base?
Changes from 1 commit
37cdf63
6b4b389
facdebe
e94d18d
0e12379
4cbfa14
87125c3
449b6d3
1cc9d12
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -495,6 +495,110 @@ <h2> | |
</p> | ||
</section> | ||
</section> | ||
<section> | ||
<h2> | ||
<code><dfn>user_preferences</dfn></code> member | ||
</h2> | ||
<p> | ||
The `user_preferences` member of the [=application manifest=] is an | ||
object that can be used to override values of manfiest members depending | ||
on which user preferences are set. It has the following members: | ||
</p> | ||
<ul> | ||
<li>[=user_preferences/color_scheme=] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've added it as a note for now - happy to instead add it to the list if you prefer. I guess it'll need its own section if I add it to the list. Would we just want There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I dig the note. |
||
</li> | ||
</ul> | ||
<p> | ||
The user agent SHOULD use the override values instead of the value of | ||
the corresponding member defined at the top level on the manifest. | ||
</p> | ||
<p> | ||
To <dfn>process the `user_preferences` member</dfn>, given | ||
[=ordered map=] |json:ordered_map|, [=ordered map=] |manifest:ordered map|, | ||
run the following during the [=application manifest/processing | ||
extension-point=] in [=processing a manifest=]: | ||
</p> | ||
<ol class="algorithm"> | ||
<li>If |json|["user_preferences"] does not [=map/exist=], return. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should happen in the main processing steps. |
||
</li> | ||
<li>If the type of |json|["user_preferences"] is not [=ordered map=], | ||
return. | ||
</li> | ||
<li>Set |manifest|["user_preferences"] to a new [=ordered map=]. | ||
</li> | ||
<li>[=Process the `color_scheme` member=] passing | ||
|json|["user_preferences"] and |manifest|["user_preferences"]. | ||
</li> | ||
</ol> | ||
<section> | ||
<h3> | ||
<code><dfn data-dfn-for="user_prefences">color_scheme</dfn></code> | ||
member | ||
</h3> | ||
<p> | ||
The [=user_prefences=] `color_scheme` member is an object that | ||
contains the overrides for color scheme preferences. It has the | ||
following members: | ||
</p> | ||
<p> | ||
The <code><dfn data-dfn-for="color_scheme">dark</dfn></code> member | ||
specifies the manifest overrides to use when the user prefers a | ||
dark theme. | ||
</p> | ||
<p> | ||
The <code><dfn data-dfn-for="color_scheme">light</dfn></code> member | ||
specifies the manifest overrides to use when the user prefers a | ||
light theme. | ||
</p> | ||
<p> | ||
To <dfn>process the `color_scheme` member</dfn>, given [=ordered map=] | ||
|json_user_preferences:ordered_map|, [=ordered map=] | ||
|manifest_user_preferences:ordered map|, run the following: | ||
</p> | ||
<ol class="algorithm"> | ||
<li>If |json_user_preferences|["color_scheme"] does not [=map/exist=], | ||
return. | ||
</li> | ||
<li>If the type of |json_user_preferences|["color_scheme"] is not | ||
[=ordered map=], return. | ||
</li> | ||
<li>Set |manifest_user_preferences|["color_scheme"] to a new | ||
[=ordered map=]. | ||
</li> | ||
<li>[=list/For each=] |member:string| of [=list=] « "dark", "light" »: | ||
<ol> | ||
<li>Let |overrides:ordered map| be the result of processing a | ||
manifest override object. | ||
</li> | ||
<li>Set |manifest_user_preferences|["color_scheme"][member] to | ||
|overrides|. | ||
</li> | ||
</ol> | ||
</li> | ||
</ol> | ||
</section> | ||
<section> | ||
<h3> | ||
Overridable properties | ||
</h3> | ||
<p> | ||
The proterties that user_preferences can override in the | ||
[=manfiest override obeject=] are: | ||
</p> | ||
<ul> | ||
<li>[=manifest/theme_color=] member. | ||
</li> | ||
<li>[=manifest/background_color=] member. | ||
</li> | ||
<li>[=Shortcut item's=] [=shortcut item/icons=] member. | ||
loubrett marked this conversation as resolved.
Show resolved
Hide resolved
|
||
</li> | ||
<li>[=Icons=] [=icons/src=] member. | ||
</li> | ||
<li>[=Icons=] [=icons/type=] member. | ||
</li> | ||
</ul> | ||
</section> | ||
</section> | ||
<section data-cite="image-resource"> | ||
<h2> | ||
Manifest override objects | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For:
We should check the language that CSS uses for this, as it's not clear what "user preferences" means.