-
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
Manifest-icon-like metadata artworks. #129
Conversation
Make the artwork spec more like WebApp manifest icons, which has `src`, `type` and `sizes` fields. Fixes w3c#58
@@ -1123,15 +1136,21 @@ interface MediaMetadata { | |||
readonly attribute DOMString title; | |||
readonly attribute DOMString artist; | |||
readonly attribute DOMString album; | |||
readonly attribute sequence<MediaArtwork> artworks; |
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.
I think we should use FrozenArray here while things are readonly
(I don't think it should be readonly
but that's orthogonal ;)).
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.
Done.
@@ -1136,20 +1136,20 @@ interface MediaMetadata { | |||
readonly attribute DOMString title; | |||
readonly attribute DOMString artist; | |||
readonly attribute DOMString album; | |||
readonly attribute sequence<MediaArtwork> artworks; | |||
readonly attribute FrozenArray<MediaArtwork> artworks; |
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.
artwork
is a mass noun so it does not need to be pluralized.
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.
Done.
With Eric comment applied this lgtm. |
It doesn't look like one can do anything with a Assuming there's still the ambition of having this for notifications as well, where can the shared bits be put so that both specs can use them? |
What I'm getting at here is that maybe it would be nice if |
Also CC @doomdavve |
I don't think using dictionaries this way would be legal. To quote WebIDL: "Dictionaries must not be used as the type of an attribute, constant or exception field." |
@@ -132,6 +132,9 @@ urlPrefix: http://www.w3.org/TR/page-visibility/; spec: PAGE-VISIBILITY | |||
type: enum; urlPrefix: #pv-page- | |||
text: visible | |||
text: hidden | |||
urlPrefix: http://www.w3.org/TR/appmanifest/; spec: appmanifest |
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.
Tried to find good URL, filed w3c/manifest#469 instead.
In the meantime, can you use https here?
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.
Done.
Strictly speaking it wouldn't violate that, but it would be (unacceptably) weird if Since the internal object will have to be a copy of what is passed (with |
<li> | ||
If the image format is supported, use the image as the artwork for | ||
display. (Otherwise the user agent can select another <a>prefered | ||
artwork</a> and try again.) |
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.
I don't think it's common practice to try again with another source when an image resource fails to decode or turns out to be unsupported. Is there precedent for this? In notifications, we just fall back to having nothing or a default resource.
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.
Now we say "the user agent may have fallback behavior such as displaying an default image as artwork."
Yes, it is used by |
For context, I'm making a similar change in the notifications spec: whatwg/notifications#76 @domenic: I think we could stop calling freeze (or SetIntegrityLevel) there by using an interface with readonly attributes instead of a dictionary. |
Yes, but that would be semantically different... The whole question is whether we should be creating dummy interfaces to work around how Web IDL makes it awkward to have frozen dictionary instances, or whether we should just use ES's primitives to reuse the dictionaries we already have. |
artworks->artwork several foolip's comments added more links
Make the artwork spec more like WebApp manifest icons, which has
src
,type
andsizes
fields. The texts are based on pull request #126Fixes #56