- From: L. David Baron <dbaron@dbaron.org>
- Date: Mon, 17 Dec 2012 18:06:58 -0800
- To: John Daggett <jdaggett@mozilla.com>
- Cc: www-style list <www-style@w3.org>
On Monday 2012-12-17 16:37 -0800, John Daggett wrote: > >From fantasai's comments regarding case sensitivity on WG list: > > > 6. If you discuss case-sensitivity, here are my positions: > > > > a. I am ok with ASCII-insensitivity if it is just > > about matching. > > > > b. I object to ASCII-folding if this is used anywhere > > in the OM output as a normalization of author input. > > > > In other words, the author must be able to pretend, > > as long as unique idents in his mind are > > case-insensitively unique, that CSS is > > case-sensitive, and have that Just Work. I disagree with fantasai's second objection. I think there are many reasons to want author input to be normalized, such as: (1) it reduces the memory usage and performance requirements on implementations; we can store an 8-bit integer for "font-family" instead of the string "font-family". (2) it reduces the risk of code that's sensitive to things it shouldn't be sensitive to. For example, authors might write javascript that looks like: for (var i = 0; i < declaration.length; ++i) { var prop = declaration[i]; if (prop == "font-family") { // do something } else if (prop == "font-weight") { // do something else } } Today, that code works even when the CSS contains "FONT-FAMILY: SANS-SERIF"; changing this would probably break existing Web content. For both of these reasons, normalization of author input in the object model should be the norm rather than the exception. -David -- 𝄞 L. David Baron http://dbaron.org/ 𝄂 𝄢 Mozilla http://www.mozilla.org/ 𝄂
Received on Tuesday, 18 December 2012 02:07:26 UTC