2011-04-05 James Simonsen <simonjam@chromium.org>
Reviewed by Adam Barth. Stop preload scanning CSS when it's impossible to have another @import. https://bugs.webkit.org/show_bug.cgi?id=57664 * fast/preloader/style-expected.txt: * fast/preloader/style.html: Updated to test invalid @import statements. 2011-04-05 James Simonsen <simonjam@chromium.org> Reviewed by Adam Barth. Stop preload scanning CSS when it's impossible to have another @import. https://bugs.webkit.org/show_bug.cgi?id=57664 @import statements are only allowed at the beginning of a CSS file. Only comments or @charset can precede them. After seeing anything else, abort early so that we: - don't have to parse the rest of the CSS. - don't preload something that the regular parser won't load. * html/parser/CSSPreloadScanner.cpp: (WebCore::CSSPreloadScanner::scan): Terminate early if we're done with @imports. (WebCore::CSSPreloadScanner::tokenize): Terminate early if we see a {} or any style rule. (WebCore::CSSPreloadScanner::emitRule): Only @charset or @import are allowed to precede @import. * html/parser/CSSPreloadScanner.h: Add DoneParsingImportRules state. git-svn-id: svn://svn.chromium.org/blink/trunk@82916 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Showing
Please register or sign in to comment