-
-
Notifications
You must be signed in to change notification settings - Fork 259
Closed
Description
while parsing the following stylesheet:
<style type="text/css">
@charset "UTF-8";
body
{
margin:0;
padding:0;
color:#303030;
background-color:#2d323f;
}
img.screenshot
{
border:0px;
padding:0px;
}
</style>
the stylesheet parser will perfectly skip the "body" section and go directly to its following part "img.screenshot".
while debugging i found the problem is here in stylesheet.cpp (void litehtml::css::parse_stylesheet)
while(pos != tstring::npos && text[pos] == _t('@'))
{
tstring::size_type sPos = pos;
pos = text.find_first_of(_t("{"), pos); // <---- why not trying to find matching ';' for @charset 'UTF-8'
if(pos != tstring::npos && text[pos] == _t('{'))
{
pos = find_close_bracket(text, pos, _t('{'), _t('}'));
}
if(pos != tstring::npos)
{
parse_atrule(text.substr(sPos, pos - sPos + 1), baseurl, doc, media);
} else
{
parse_atrule(text.substr(sPos), baseurl, doc, media);
}
if(pos != tstring::npos)
{
pos = text.find_first_not_of(_t(" \n\r\t"), pos + 1);
}
}
thank you.
Metadata
Metadata
Assignees
Labels
No labels