Closed
Bug 97527
Opened 23 years ago
Closed 23 years ago
class selector in HTML should be case insensitive
Categories
(Core :: CSS Parsing and Computation, defect)
Core
CSS Parsing and Computation
Tracking
()
People
(Reporter: ftang, Assigned: pierre)
Details
(Keywords: topembed)
Attachments
(1 file)
94 bytes,
text/html
|
Details |
this is filed to fix bugscape bug 5640 Here are some background information according to CSS2 http://www.w3.org/TR/REC-CSS2/selector.html#q1 5.1 Pattern matching ... The case-sensitivity of document language element names in selectors depends on the document language. For example, in HTML, element names are case-insensitive, but in XML they are case-sensitive. also ..... 5.8.3 Class selectors For style sheets used with HTML, authors may use the dot (.) notation as an alternative to the "~=" notation when matching on the "class" attribute. Thus, for HTML, "DIV.value" and "DIV[class~=value]" have the same meaning. The attribute value must immediately follow the ".". Example(s): For example, we can assign style information to all elements with class~="pastoral" as follows: *.pastoral { color: green } /* all elements with class~=pastoral */ or just .pastoral { color: green } /* all elements with class~=pastoral */ The following assigns style only to H1 elements with class~="pastoral": Also in http://www.w3.org/TR/html4/struct/global.html#adef-class 7.5.2 Element identifiers: the id and class attributes Attribute definitions ... class = cdata-list [CS] This attribute assigns a class name or set of class names to an element. Any number of elements may be assigned the same class name or names. Multiple class names must be separated by white space characters. .... ... The class attribute, on the other hand, assigns one or more class names to an element; the element may be said to belong to these classes. A class name may be shared by several element instances. The class attribute has several roles in HTML: * As a style sheet selector (when an author wishes to assign style information to a set of elements). * For general purpose processing by user agents. and 6.1 Case information Each attribute definition includes information about the case-sensitivity of its values. The case information is presented with the following keys: CS The value is case-sensitive (i.e., user agents interpret "a" and "A" differently).
Reporter | ||
Comment 1•23 years ago
|
||
It looks like if we following HTML4.01 and CSS2, then class attribute is case-sensitive, since html4.01 label it as [CS] and therefore the class selector in HTML4.01 shoudl be case sensitive because CSS2 said "The case-sensitivity of document language element names in selectors depends on the document language. " however, IE treat it case-insensitive.
Reporter | ||
Comment 2•23 years ago
|
||
mark this as topembed since it block bugscape 5640 and therefore bugscape 7970, however, I don't think we should change the current behavior since it violate the css2 specification.
Keywords: topembed
Reporter | ||
Comment 3•23 years ago
|
||
Reporter | ||
Comment 4•23 years ago
|
||
try the test cases, both line are blue in IE but only the second line is blue in n6.1
Assignee | ||
Comment 5•23 years ago
|
||
*** This bug has been marked as a duplicate of 93371 ***
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•