Bug 198096 - CSS parsing of unclosed string [CSS 2.1 Conformance]
Summary: CSS parsing of unclosed string [CSS 2.1 Conformance]
Status: RESOLVED UNMAINTAINED
Alias: None
Product: konqueror
Classification: Applications
Component: khtml parsing (show other bugs)
Version: 4.2.4
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Konqueror Developers
URL: http://www.gtalbot.org/BrowserBugsSec...
Keywords: testcase, triaged
Depends on:
Blocks:
 
Reported: 2009-06-27 23:43 UTC by Gérard Talbot (no longer involved)
Modified: 2024-05-06 20:48 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gérard Talbot (no longer involved) 2009-06-27 23:43:39 UTC
Version:            (using KDE 4.2.4)
OS:                Linux
Installed from:    Ubuntu Packages

Testcase from Gabriele Romanato:
---------
http://test.csswg.org/source/CSS2.1-test-suite/incoming/gabriele/basic/sec4/blocks0.html

Relevant code involved:
-----------------------

<style type="text/css">
p {color: green}
p {color: red '\'}
</style>

<p>This text should be green, not red.</p>



In CSS 2.1, '\'' is an escaped single quote, is a string consisting of a single quote.
On the other hand, '\' is an unclosed string.

"Unexpected end of string. 
 User agents must close strings upon reaching the end of a line, but then drop the construct (declaration or rule) in which the string was found."
http://www.w3.org/TR/CSS21/syndata.html#parsing-errors

regards, Gérard
Comment 1 A. Spehr 2009-06-28 01:05:45 UTC
*** Bug 198103 has been marked as a duplicate of this bug. ***
Comment 2 Gérard Talbot (no longer involved) 2009-06-28 01:24:25 UTC
*** Bug 198099 has been marked as a duplicate of this bug. ***
Comment 3 Gérard Talbot (no longer involved) 2009-09-30 07:01:41 UTC
Original testcase from Gabriele Romanato is now at:

http://test.csswg.org/source/contributors/gabriele/incoming/basic/sec4/blocks0.html

regards, Gérard
Comment 4 Gérard Talbot (no longer involved) 2012-06-23 22:30:04 UTC
Relevant excerpts of spec:

"
A block starts with a left curly brace ({) and ends with the matching right curly brace (}). In between there may be any tokens, except that parentheses (( )), brackets ([ ]), and braces ({ }) must always occur in matching pairs and may be nested. Single (') and double quotes (") must also occur in matching pairs, and characters between them are parsed as a string.
"
CSS 2.1, section 4.1.6 Blocks
http://www.w3.org/TR/CSS21/syndata.html#block

"
In CSS 2.1, a backslash (\) character can indicate one of three types of character escape.
(...)
Second, it cancels the meaning of special CSS characters. Any character (except a hexadecimal digit, linefeed, carriage return, or form feed) can be escaped with a backslash to remove its special meaning. For example, "\"" is a string consisting of one double quote.
"
CSS 2.1, section 4.1.3 Characters and case
http://www.w3.org/TR/CSS21/syndata.html#characters

-----------------

Updating URL field.

Gérard
Comment 5 Gérard Talbot (no longer involved) 2014-06-04 17:13:53 UTC
Temporary link to test:
http://test.csswg.org/source/work-in-progress/gabriele/basic/sec4/blocks0.html

*_Permanent_* link to test:
http://www.gtalbot.org/BrowserBugsSection/Konqueror4Bugs/Bug198096-parsing-unclosed-string.html

Nota bene: If there is one single blank white space between the carriage return and </style>, then parsing is correct and the sentence is green.

Gérard
Comment 6 Christoph Cullmann 2024-05-06 20:48:56 UTC
Dear user,

KHTML (and KJS) was a long time more or less unmaintained and got removed in KF6.

Please migrate to use a QWebEngine based HTML component.

We will do no further fixes or improvements to the KF5 branches of these components beside important security fixes.

For security issues, please see:

https://kde.org/info/security/

Sorry that we did not fix this issue during the life-time of KHTML.

Greetings
Christoph Cullmann