Make CSSPreloadScanner less broken
When scanning for @import rules to preload, CSSPreloadScanner terminates a URL at ';' unconditionally. This is wrong as there might be ';' in a URL, in which case we make a preload of a broken URL. This patch scans URLs in a saner way: - For urls given as a raw string, terminate at the ending quote - Other those wrapped in a 'url()', terminate at the closing parenthesis Note: We do not intend to write a full parser here, so it's still broken in some cases (e.g., when the url contains ' ' or ')'). It's out of the scope of this patch to fix them. Bug: 1087854 Change-Id: I666c196ac1e12b259136823e0faed09958a896c5 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2451598Reviewed-by:Rune Lillesveen <futhark@chromium.org> Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org> Cr-Commit-Position: refs/heads/master@{#815269}
Showing
Please register or sign in to comment