w3c / wpub

W3C Web Publications
https://w3c.github.io/wpub/
Other
78 stars 19 forks source link

Minor discrepancy between the draft and WebIDL? #303

Closed iherman closed 6 years ago

iherman commented 6 years ago

The current text says that the 'resources' is a required item; the WebIDL does not say that. Shouldn't it be set to "required", too?

Note that setting it to required in the WebIDL does not mean that there must be a list of resources. It just mean that, in an implementation, it would have a default value, which is [] (empty list) as opposed to other, non-required properties that have a default 'undefined' value.

iherman commented 6 years ago

On second though... maybe it is cleaner to set the default value for all values that return an array to [] and not to undefined, in which case there is no reason to single out the resource list.

In a way... what is the rationale, in our manifest, to set the resource list as required, if its value may be empty?

HadrienGardeur commented 6 years ago

I don't think that resources should be required and it's default value should be an empty array in our WebIDL.

iherman commented 6 years ago

Ok. I am fine with that.

iherman commented 6 years ago

@HadrienGardeur #305 (ie, also the latest draft) covers that in terms of https://github.com/w3c/wpub/issues/303#issuecomment-412575203. If you agree, can you also close this issue?

mattgarrish commented 6 years ago

Only change I made post-commit of #305 was to remove the default array on reading order. Required values can't have a default, which tends to make sense.

iherman commented 6 years ago

Only change I made post-commit of #305 https://github.com/w3c/wpub/pull/305 was to remove the default array on reading order. Required values can't have a default, which tends to make sense.

Yep, I saw that, and you're right.