WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED DUPLICATE of
bug 18265
23744
stylesheet not applied because css file not parsed correctly if it contains comments and charset
https://bugs.webkit.org/show_bug.cgi?id=23744
Summary
stylesheet not applied because css file not parsed correctly if it contains c...
jasneet
Reported
2009-02-04 14:45:50 PST
I Steps: Go to
http://csdraveurs.qc.ca/
II Issue: left navigation bar links have extra scroll bars III Conclusion: The issue is caused by the css file not being applied correctly because of the /*comment*/ and @charset in its contents. The css file looks like: /* Définition de règle */ @charset "iso-8859-1"; .leftframe {color: 0067c6; font-family: "Times New Roman", Times, serif; font-size: 10px; font-weight: bold; line-height: normal; text-align: center} IV Other Browsers: IE7: ok FF3: ok V Nightly tested: 40471 Bug in Chromium :
http://code.google.com/p/chromium/issues/detail?id=5771
Attachments
testcase
(895 bytes, application/zip)
2009-02-04 14:48 PST
,
jasneet
no flags
Details
View All
Add attachment
proposed patch, testcase, etc.
jasneet
Comment 1
2009-02-04 14:48:14 PST
Created
attachment 27330
[details]
testcase
Alexey Proskuryakov
Comment 2
2009-02-15 01:44:19 PST
This is broken CSS - "@charset" should be the first bytes in file, except for BOM. But obviously, we should be more forgiving for compatibility with other browsers. One thing we should test for is whether this charset is honored, or just ignored.
Taruchhaya
Comment 3
2009-02-20 05:07:04 PST
I have done some analysis on this bug.My observations are: 1) "leftframe.css" :: Issue is caused by the css file not being applied correctly because of the /*comment*/ and @charset in its contents. The css file looks like: /* Dfinition de rgle */ @charset "iso-8859-1"; .leftframe {color: 0067c6; font-family: "Times New Roman", Times, serif; font-size: 10px; font-weight: bold; line-height: normal; text-lign: center} Reason::The @charset At-Rule is allowed to occur only once in an external style sheet and it must be the very first statement in the style sheet. QUERIES: 1) "/*comment*/" is a valid CSS statement, which is escaped/ignored while executing the code. So shouldn't the same approach be followed in this case and @charset should be considered/honored. While debugging the Grammar.y, I found that "/*comment*/" is not the issue. The issue is in "/r" & "/n" after the comment, which is forcing the parser to consider the rest of the document as an invalid rule. 2) I also found another issue in this bug,i.e. in "Link Tag". Reason:: In Safari, Link Tag is not able to open/recognize the externally linked CSS file. As, HTML document contains the following snippet for link tag: <link href="leftframe.css" rel="stylesheet" type="text/css"> <link href="../leftframe.css" rel="stylesheet" type="text/css"> Here, In second link statement: "../leftframe.css" is invalid because it is trying to access the .css file from the root level, which is not available, webkit should check this condition and then resolve it by appending to the base URI just like how IE does. Please provide me some suggestions on the above issues.
Alexey Proskuryakov
Comment 4
2009-02-20 05:19:08 PST
(In reply to
comment #3
)
> 2) I also found another issue in this bug,i.e. in "Link Tag".
Please file a new bug for this new issue.
Taruchhaya
Comment 5
2009-02-22 20:51:10 PST
Raised the new Bug ID: 24084:: "Link Tag" issue
Alexey Proskuryakov
Comment 6
2009-04-08 01:59:09 PDT
See also:
bug 18265
(@charset in inline CSS).
Alexey Proskuryakov
Comment 7
2009-04-08 02:28:22 PDT
***
Bug 23947
has been marked as a duplicate of this bug. ***
Adam Barth
Comment 8
2009-10-16 12:07:53 PDT
This is the same a
Bug 18265
because the comment get stripped out by the tokenizer. *** This bug has been marked as a duplicate of
bug 18265
***
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug