For some broken stylesheets, CSSParser produces source data inconsistent with the resulting CSSOM.
Created attachment 166843 [details] Patch
Created attachment 167084 [details] Patch
Comment on attachment 167084 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=167084&action=review > Source/WebCore/css/CSSParser.cpp:10328 > + if (!m_currentRuleData->isBlockRule() && m_currentRuleData->type != CSSRuleSourceData::IMPORT_RULE) I don't think this condition is ever true.
Created attachment 167301 [details] Patch
Created attachment 167317 [details] Patch
Created attachment 167327 [details] Patch
Comment on attachment 167327 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=167327&action=review > Source/WebCore/css/CSSParser.cpp:10300 > + m_currentRuleData.clear(); Redundant > Source/WebCore/css/CSSParser.cpp:10302 > + m_currentRuleData = CSSRuleSourceData::create(ruleType); Let's just add m_currentRuleData = data; above. > Source/WebCore/css/CSSParser.cpp:-10382 > - SourceRange& topRuleBodyRange = m_currentRuleDataStack->last()->ruleBodyRange; Looks like a separate change.
Comment on attachment 167327 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=167327&action=review > Source/WebCore/css/CSSParser.cpp:9929 > + popRuleData(); This should be put into separate patch, you should also fix some similar issues with other types of rules.
Created attachment 167330 [details] Patch
Committed r130511: <http://trac.webkit.org/changeset/130511>
Related Chrome bug http://code.google.com/p/chromium/issues/detail?id=152636