Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(208)

Unified Diff: grit/gather/chrome_html.py

Issue 10795100: Accept CSS url()s without quotes. (Closed) Base URL: http://grit-i18n.googlecode.com/svn/trunk
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « grit/format/html_inline.py ('k') | grit/gather/chrome_html_unittest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: grit/gather/chrome_html.py
diff --git a/grit/gather/chrome_html.py b/grit/gather/chrome_html.py
index 74809b6760d03315be274734ceabfe9b68651f6c..9ced464b2df01714388827f263fadf73bc94f95c 100644
--- a/grit/gather/chrome_html.py
+++ b/grit/gather/chrome_html.py
@@ -33,16 +33,16 @@ _THEME_SOURCE = lazy_re.compile('chrome://theme/IDR_[A-Z0-9_]*')
# Matches CSS image urls with the capture group 'filename'.
_CSS_IMAGE_URLS = lazy_re.compile(
'(?P<attribute>content|background|[\w-]*-image):[ ]*' +
- 'url\((?:\'|\")(?P<filename>[^"\'\)\(]*)(?:\'|\")')
+ 'url\((?P<quote>"|\'|)(?P<filename>[^"\'()]*)(?P=quote)')
# Matches CSS image sets.
_CSS_IMAGE_SETS = lazy_re.compile(
'(?P<attribute>content|background|[\w-]*-image):[ ]*' +
'-webkit-image-set\((?P<images>' +
- '([,\n ]*url\((\'|\")[^"\'\)\(]*(\'|\")\)[ ]*[0-9.]*x)*)\)',
+ '([,\n ]*url\((?P<quote>"|\'|)[^"\'()]*(?P=quote)\)[ ]*[0-9.]*x)*)\)',
re.MULTILINE)
# Matches a single image in a CSS image set with the capture group scale.
_CSS_IMAGE_SET_IMAGE = lazy_re.compile(
- '[,\n ]*url\((\'|\")[^"\'\)\(]*(\'|\")\)[ ]*(?P<scale>[0-9.]*x)',
+ '[,\n ]*url\((?P<quote>"|\'|)[^"\'()]*(?P=quote)\)[ ]*(?P<scale>[0-9.]*x)',
re.MULTILINE)
« no previous file with comments | « grit/format/html_inline.py ('k') | grit/gather/chrome_html_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698