Closed
Bug 72508
Opened 24 years ago
Closed 24 years ago
style sheet class names are case-sensitive
Categories
(Core :: CSS Parsing and Computation, defect)
Tracking
()
People
(Reporter: chogan, Assigned: pierre)
Details
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; 0.8) Gecko/20010215
BuildID: 2001021508
CSS class names are treated as case-sensitive. When a class is defined in the
style sheet using one case convention, it will only match exactly when used in
the CLASS attribute of an HTML element.
Example:
<!-- style sheet -->
.title
{
BACKGROUND-COLOR: #333366;
COLOR: #ffff68;
FONT-SIZE: 14pt;
FONT-WEIGHT: bold;
PADDING-LEFT: 5pt;
TEXT-INDENT: 1pt;
WORD-SPACING: 2pt
}
<!-- document -->
<td CLASS="TITLE">Title</td>
will not display Title in the correct formatting. However,
changing the style sheet to the following:
<!-- style sheet -->
.TITLE
{
BACKGROUND-COLOR: #333366;
COLOR: #ffff68;
FONT-SIZE: 14pt;
FONT-WEIGHT: bold;
PADDING-LEFT: 5pt;
TEXT-INDENT: 1pt;
WORD-SPACING: 2pt
}
causes the text to be displayed correctly
Reproducible: Always
Steps to Reproduce:
View the following HTML in the browser:
<HTML>
<HEAD>
<TITLE>Title</TITLE>
<STYLE TYPE="text/css">
.TITLE
{
BACKGROUND-COLOR: #333366;
COLOR: #ffff68;
FONT-SIZE: 14pt;
FONT-WEIGHT: bold;
PADDING-LEFT: 5pt;
TEXT-INDENT: 1pt;
WORD-SPACING: 2pt
}
</STYLE>
</HEAD>
<BODY>
<SPAN CLASS="title">hi</SPAN>
</BODY>
</HTML>
Actual Results: 'hi' is displayed in a small, regular, black font on a white
background
Expected Results: 'hi' should have been displayed in a large, bold, yellow font
on a blue background.
The CSS specification (http://www.w3.org/TR/REC-CSS1) specifies that names
should be case-insentitive:
7.1 Forward-compatible parsing
...
The following rules always hold:
* All CSS style sheets are case-insensitive, except for parts that are not
under the control of CSS. I.e., in CSS1, font family names and URLs can be
case-sensitive. Also, the case-sensitivity of the CLASS and ID attributes is
under the control of HTML [2].
Comment 1•24 years ago
|
||
Umm.. as you quote:
> Also, the case-sensitivity of the CLASS and ID attributes is
> under the control of HTML [2].
And the HTML 4.01 spec says
(http://www.w3.org/TR/REC-html40/struct/global.html#adef-class):
class = cdata-list [CS]
The [CS] means "case-sensitive". Marking duplicate of corresponding invalid
bug. See also bug 55668, bug 64915
*** This bug has been marked as a duplicate of 1007 ***
Status: UNCONFIRMED → RESOLVED
Closed: 24 years ago
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•