-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Rationale for when invalid value default differs from missing value default #10542
Comments
I can speak to The initial idea was that for forward compat, |
Thanks @mfreed7! If I were to try to generalize, it seems like the main reason to have different behavior for invalid value is in cases where the attribute's existence (and empty string value) triggers behavior that we would expect to also be implied by future values. I think the same argument could be made for the cors attribute, that future values would be expected to have behavior similar to anonymous with some specialization, and thus falling back to no cors for future values would be more breaking than falling back to anonymous. preload may or may not be the same, depending on whether the implementation-defined behavior varies or not. autocapitalize has an invalid value state that roughly matches what you might expect from an empty value. So I guess the question then is what is the expectation for writingsuggestions, and should we be changing it to match other properties, or should we be changing the other properties that are similar to follow this pattern, e.g. the following properties have a specified meaning for an empty value that differ from the invalid value state: |
For The missing value default continues to allow for inheritance and UA defaults, similar to |
If the invalid value default was the same default state as the missing value default, it would still be the case that only an explicit IMO the real question is does an author who sets |
Right. I don't know if there's a good use case either way, but my mental model is that any value other than false should set the state to something that is "not false". (That can only be "true" right now, but there could be other valid values in the future.) This seems to be how the |
If we apply this rationale consistently, it seems like we should consider also changing translate, hidden, contenteditable, and spellcheck since they are similar. |
I'm a bit confused by Mason's comment. The empty string value is just another keyword and for that case neither "invalid value default" (incorrect value) or "missing value default" (no attribute specified) are directly applicable. Though if there is no empty string keyword specified, then "invalid value default" (not "missing value default") would end up applying. Say you have an attribute with three states:
It seems quite reasonable that you want to default to the None state when the attribute is not specified, but to Action 1 (or 2) when it is specified but has an unknown value. That might well make sense for forward compatibility for that particular attribute. (Come to think of it, this is essentially what |
I did mis-speak a bit, in particular about the missing value default. It's unfortunate that it's not called the "missing attribute default", since mentally I think of
So there are invalid & missing value defaults that are different from each other, which was the original question, I believe. |
Yes exactly. I'm trying to figure out what the consistent principle to apply is for when an invalid property value |
What is the issue with the HTML Standard?
It seems for most properties, an invalid value default is the same as the missing value default, e.g. we do this for the following:
From a scan of the spec there are five exceptions:
I'd be interested to understand the rationale for these cases where an invalid value is not treated the same as a missing value. In particular, writingsuggestions was added recently, I didn't see any discussion around the invalid value default choice, but this was pointed to as an example for why handwriting should have an invalid value default of true, but I don't understand the rationale for when we should have a different invalid value default from the missing value default.
This seems like we should be consistent unless there is a reason to deviate. In particular, writingsuggestions and handwriting seem very similar to spellcheck which does have the same invalid value and missing value defaults.
@sanketj @mfreed7
The text was updated successfully, but these errors were encountered: