-
Notifications
You must be signed in to change notification settings - Fork 142
[css-typed-om] Should StyleMap be case sensitive? #309
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
Comments
If I'm reading Blink's CSSPropertyParser.cpp correctly, I'l defer to the people working on style in Blink. @wilddamon @rune-opera |
I was looking at this recently when I was trying to consolidate the various ways of parsing names we have in Blink. style.getPropertyValue isn't case sensitive - you can see the call to toASCIILower for each character here (I also tried in dev tools, So I think we'd have to create a new code path to do this. |
Would it be a completely new code path? Presumably the existing callers could ASCII lowercase early and from that point on you could have shared code. We've even thought of making the ASCII lowercase operation part of IDL since there are some other APIs where we could also use that kind of thing (all mostly for legacy reasons). (Unfortunately I don't recall which APIs at the moment.) |
@wilddamon, oops, I typo'd above, I meant case insensitive of course. FWIW, in the context of lowercasing in |
We (Blink) have a gperf generated case-sensitive hash for known CSS properties which are case-insensitive in the parser and existing CSSOM APIs. The input is made ascii lower-case before the lookup. It looks trivial to skip the lower-casing for new APIs. |
Yeah, it's not a large new code path - we'd be able to split up that function and/or have a flag to skip the lowercasing loop :) |
Since we don't really care which way this goes, we'll just decide it at the next meeting and be done with it. |
The CSS Working Group just discussed
The full IRC log of that discussion<nainar> Topic: https://github.com//issues/309<fantasai> GitHub: https://github.com//issues/309 <fantasai> TabAtkins: Should the StyleMap be case sensitive for property names? <fantasai> TabAtkins: .style isn't <fantasai> TabAtkins: It doesn't care about casing <fantasai> TabAtkins: We do not care which way it goes, it's trivial <fantasai> TabAtkins: So asking for opinions <fantasai> fantasai: What does it even mean for it to be case-sensitive? <fantasai> TabAtkins: Only accepts lower case <fantasai> dbaron: Is it clear that the canonical case for CSS is lower-case? <fantasai> ... <fantasai> ?: Interaction with custom properties? <fantasai> TabAtkins: Custom properties are always case-sensitive <surma> s/?/surma <fantasai> fantasai: I'll settle this for you, I'll object to treating CSS properties as case-sensitive. <fantasai> dbaron: I think it would be really weird for this to be case-sensitive <fantasai> dbaron: Don't want TypedOM to be different from other OM <dbaron> dbaron: people sometimes pass properties to functions <fantasai> RESOLVED: StyleMap for CSS properties is ASCII case-insensitive because that's how CSS property names are defined |
Closing as this was added in #445 |
Some folks want us to make the platform more case sensitive. Since this is a new API, that means we would make it case sensitive. ex.
Unfortunately this also diverges from
.style
, ex.@annevk @domenic @foolip @tabatkins
The text was updated successfully, but these errors were encountered: