-
Notifications
You must be signed in to change notification settings - Fork 162
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
Why is purpose a "unordered set of unique space-separated tokens"? #903
Comments
Accidentally pressed enter too quickly... fixed up above... |
I seem to recall it was for consistency with things like the HTML Doesn't seem like a particularly good reason to me, considering it is a different language to HTML and has a natural way of specifying a set of values. But it's a very old decision and I don't think worth revisiting. |
I'm ok to keep as is if we've shipped this already. |
Yes, Chrome at least parses the space-separated list, as specified, and has for a long time (and it's been meaningful at least as far back as when we introduced maskable): |
Yeah, same on the Gecko side: |
I agree with the author's assumption. Just because things have been working as a space-separated list does not imply it's a good design. The design matching HTML doesn't make sense; this is JSON. Arrays make more sense and require less processing (e.g. no split on space, validate enums, or other magic). It's not easy to model this with types as is and values are not explicit. Having a just a string makes this quite error-prone and complex. I |
I'd be ok to switch it in Gecko (and maybe keep a backward compatibility path for when passed as string - just won't spec it). I don't imagine there are many "multi-purpose" icons out there. |
@dmurph, wdyt? |
I mean you can allow both for legacy reasons, I just don't think the current implementation is explicit/clear for the JSON-compatible target and string parsing inside the date structure should be eliminated where possible. |
Having multiple types for a member is something we've managed to avoid thus far, as it just make things more confusing (+maintenance cost, etc). I'd like for us to continue to avoid that if possible. However, if there is a will and resources to just fix this, then I think we should just do it. |
I suspect this probably inherited from an I guess the main question I have is: What benefit would we gain from this moving to being an array instead of a space-separated string, especially considering that we’d need to maintain the string parser for legacy compat reasons? It might be the more "correct" way to do it, but it would also be more verbose (brackets, commas, more quotes). The only benefit I see is that it could enable us to have |
That should be removed too, just sayin'.
Because then it can be flagged as deprecated and future versions could remove it. People tend to use W3C specs as templates for their own ideas, and this idea shouldn't be propagated. It's better to express what you mean than try to be clever with a string, especially when the tools are available (this is a JSON-compatible context so arrays exist) |
We map acceptable values for
You'll see we have done this for newer properties like |
The spec reads:
Why is it not an array?
The text was updated successfully, but these errors were encountered: