Index: tools/grit/grit/format/html_inline.py |
=================================================================== |
--- tools/grit/grit/format/html_inline.py (revision 60999) |
+++ tools/grit/grit/format/html_inline.py (working copy) |
@@ -136,12 +136,12 @@ |
"""Helper function to inline external script files""" |
return InlineFileContents(src_match, '<script>%s</script>') |
- def InlineCSSText(text, css_filepath): |
+ def InlineCssText(text, css_filepath): |
"""Helper function that inlines external resources in CSS text""" |
filepath = os.path.dirname(css_filepath) |
- return InlineCSSImages(text, filepath) |
+ return InlineCssBackgroundImages(text, filepath) |
- def InlineCSSFile(src_match, inlined_files=inlined_files): |
+ def InlineCssFile(src_match, inlined_files=inlined_files): |
"""Helper function to inline external css files. |
Args: |
@@ -157,11 +157,11 @@ |
inlined_files.add(filepath) |
# When resolving CSS files we need to pass in the path so that relative URLs |
# can be resolved. |
- return '<style>%s</style>' % InlineCSSText(ReadFile(filepath), filepath) |
+ return '<style>%s</style>' % InlineCssText(ReadFile(filepath), filepath) |
- def InlineCSSImages(text, filepath=input_filepath): |
+ def InlineCssBackgroundImages(text, filepath=input_filepath): |
"""Helper function that inlines external images in CSS backgrounds.""" |
- return re.sub('(?:content|background(?:-image)?):[ ]*url\((?:\'|\")' + |
+ return re.sub('background(?:-image)?:[ ]*url\((?:\'|\")' + |
'(?P<filename>[^"\'\)\(]*)(?:\'|\")', |
lambda m: SrcReplace(m, filepath), |
text) |
@@ -174,7 +174,7 @@ |
flat_text = re.sub( |
'<link rel="stylesheet".+?href="(?P<filename>[^"\']*)".*?>', |
- InlineCSSFile, |
+ InlineCssFile, |
flat_text) |
flat_text = re.sub( |
@@ -194,7 +194,7 @@ |
flat_text) |
# TODO(arv): Only do this inside <style> tags. |
- flat_text = InlineCSSImages(flat_text) |
+ flat_text = InlineCssBackgroundImages(flat_text) |
flat_text = re.sub('<link rel="icon".+?href="(?P<filename>[^"\']*)"', |
SrcReplace, |