aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Chromium Automerger <chromium-automerger@android>2013-06-13 23:57:57 +0000
committerAndroid Chromium Automerger <chromium-automerger@android>2013-06-13 23:57:57 +0000
commitaac02afedf0e616b49bc1e860780ec64c85c61ea (patch)
tree914be6219979f8b2e033f307caa4f4847f4713ae
parent0ba4afadb559560d4c0c8866b192aff3963189d1 (diff)
parent2b9eb6543a79a64bb37197a69f8856328b21b2ef (diff)
downloadgrit-aac02afedf0e616b49bc1e860780ec64c85c61ea.tar.gz
Merge tools/grit from https://chromium.googlesource.com/external/grit-i18n.git at 2b9eb6543a79a64bb37197a69f8856328b21b2ef
This commit was generated by merge_from_chromium.py. Change-Id: Ie289a4cf4577ebc7c85db10f4c03e2d63b6b7e05
-rw-r--r--grit/gather/chrome_html.py11
-rw-r--r--grit/gather/chrome_html_unittest.py2
2 files changed, 10 insertions, 3 deletions
diff --git a/grit/gather/chrome_html.py b/grit/gather/chrome_html.py
index d554776..840b251 100644
--- a/grit/gather/chrome_html.py
+++ b/grit/gather/chrome_html.py
@@ -29,7 +29,8 @@ DIST_SUBSTR = '%DISTRIBUTION%'
# Matches a chrome theme source URL.
-_THEME_SOURCE = lazy_re.compile('chrome://theme/IDR_[A-Z0-9_]*')
+_THEME_SOURCE = lazy_re.compile(
+ '(?P<baseurl>chrome://theme/IDR_[A-Z0-9_]*)(?P<query>\?.*)?')
# Matches CSS image urls with the capture group 'filename'.
_CSS_IMAGE_URLS = lazy_re.compile(
'(?P<attribute>content|background|[\w-]*-image):[ ]*' +
@@ -69,10 +70,14 @@ def GetImageList(
"""
# Any matches for which a chrome URL handler will serve all scale factors
# can simply request all scale factors.
- if _THEME_SOURCE.match(filename):
+ theme_match = _THEME_SOURCE.match(filename)
+ if theme_match:
images = [('1x', filename)]
for scale_factor in scale_factors:
- images.append((scale_factor, "%s@%s" % (filename, scale_factor)))
+ scale_filename = "%s@%s" % (theme_match.group('baseurl'), scale_factor)
+ if theme_match.group('query'):
+ scale_filename += theme_match.group('query')
+ images.append((scale_factor, scale_filename))
return images
if filename.find(':') != -1:
diff --git a/grit/gather/chrome_html_unittest.py b/grit/gather/chrome_html_unittest.py
index 8f636ff..55597a4 100644
--- a/grit/gather/chrome_html_unittest.py
+++ b/grit/gather/chrome_html_unittest.py
@@ -265,6 +265,7 @@ class ChromeHtmlUnittest(unittest.TestCase):
'test.css': '''
.image {
background: url('chrome://theme/IDR_RESOURCE_NAME');
+ content: url('chrome://theme/IDR_RESOURCE_NAME_WITH_Q?$1');
}
''',
})
@@ -281,6 +282,7 @@ class ChromeHtmlUnittest(unittest.TestCase):
<style>
.image {
background: -webkit-image-set(url('chrome://theme/IDR_RESOURCE_NAME') 1x, url('chrome://theme/IDR_RESOURCE_NAME@2x') 2x);
+ content: -webkit-image-set(url('chrome://theme/IDR_RESOURCE_NAME_WITH_Q?$1') 1x, url('chrome://theme/IDR_RESOURCE_NAME_WITH_Q@2x?$1') 2x);
}
</style>
</head>