Bug 99824 - [test case] Parsing of inline style attribute
Summary: [test case] Parsing of inline style attribute
Status: CONFIRMED
Alias: None
Product: konqueror
Classification: Applications
Component: khtml parsing (show other bugs)
Version: Git
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Konqueror Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-02-19 22:23 UTC by Richard Moore
Modified: 2012-05-08 16:01 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
test case (91 bytes, text/html)
2005-08-05 15:15 UTC, Tommi Tervo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Moore 2005-02-19 22:23:28 UTC
Version:            (using KDE Devel)
Installed from:    Compiled sources

Khtml incorrectly parses style attributes, it seems to fail if they are specified in a CSS block. I tried to track this back and the problem seems to be in the grammar itself, but I can't spot the error.

This works:

<html>
<body style="background: white url(ships.png) repeat;">
feuhfuifhwue
</body>
</html>

This does NOT:

<html>
<body style="{background: white url(ships.png) repeat;}">
feuhfuifhwue
</body>
</html>

My readig of the spec at http://www.w3.org/TR/css-style-attr implies both are equally valid.

Notes:
The style appears to get passed directly to it as a DOM string by CSSStyleDeclarationImpl. I'm wondering if it's to do with the voodoo pseudo token khtml-decl-sym{ that gets put into it this seems to exist to set the start state of the parser but then the lexer will see {{ which might throw it off.
Comment 1 Richard Moore 2005-02-19 22:49:29 UTC
Here's a better test case, it's simpler and works standalone. If you remove the braces it works.

<html>
<body style="{ background-color: #cccccc }">
feuhfuifhwue
</body>
</html>
Comment 2 Tommi Tervo 2005-08-05 15:15:35 UTC
Created attachment 12099 [details]
test case
Comment 3 FiNeX 2008-04-20 20:37:47 UTC
Problem confirmed on Konqueror 4 (trunk)
Comment 4 Jeremy 2010-08-21 16:33:26 UTC
I think this is the correct behavior. While {background-color: #cccccc } is a valid block, it isn't a valid declaration-list, which is what the style attribute asks for.