elinks
elinks copied to clipboard
[css] duplicate rules should override previously defined rules
While working on #300 I encountered what is likely to be a bug.
Minimal reproducible example:
<html>
<head>
<style>
body {color: yellow;}
body {color: blue;}
</style>
</head>
<body>
<p>text</p>
</body>
</html>
elinks test.html
The text should show up in blue out of all other browsers I've tested, but it shows up in yellow instead.
I haven't digged into how this happens or whether it can be fixed, but I saw this comment in css_parse_ruleset:
https://github.com/rkd77/elinks/blob/e136d663c94ed73fe5b0c885a76aeec34996ae13/src/document/css/parser.c#L591-L601
It gives me reason to believe that repeated rules should already be overriding previous rules... but it isn't.
When libcss is enabled it is blue.
Please check this ^ commit.