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

Unified Diff: tools/grit/grit/format/html_inline.py

Issue 3453029: Add user customizable launch type for apps. (Closed)
Patch Set: No images this time. Created 10 years, 3 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 | « chrome/browser/resources/shared/js/cr/ui/menu_item.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/grit/grit/format/html_inline.py
diff --git a/tools/grit/grit/format/html_inline.py b/tools/grit/grit/format/html_inline.py
index b23f951927791b07c03fae14c27a45cb97f42426..71d0f68bf5cfaf1d89b45df26d5ed3e185fb3ac9 100755
--- a/tools/grit/grit/format/html_inline.py
+++ b/tools/grit/grit/format/html_inline.py
@@ -136,12 +136,12 @@ def InlineFile(input_filename, output_filename, grd_node):
"""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 InlineCssBackgroundImages(text, filepath)
+ return InlineCSSImages(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 @@ def InlineFile(input_filename, output_filename, grd_node):
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 InlineCssBackgroundImages(text, filepath=input_filepath):
+ def InlineCSSImages(text, filepath=input_filepath):
"""Helper function that inlines external images in CSS backgrounds."""
- return re.sub('background(?:-image)?:[ ]*url\((?:\'|\")' +
+ return re.sub('(?:content|background(?:-image)?):[ ]*url\((?:\'|\")' +
'(?P<filename>[^"\'\)\(]*)(?:\'|\")',
lambda m: SrcReplace(m, filepath),
text)
@@ -174,7 +174,7 @@ def InlineFile(input_filename, output_filename, grd_node):
flat_text = re.sub(
'<link rel="stylesheet".+?href="(?P<filename>[^"\']*)".*?>',
- InlineCssFile,
+ InlineCSSFile,
flat_text)
flat_text = re.sub(
@@ -194,7 +194,7 @@ def InlineFile(input_filename, output_filename, grd_node):
flat_text)
# TODO(arv): Only do this inside <style> tags.
- flat_text = InlineCssBackgroundImages(flat_text)
+ flat_text = InlineCSSImages(flat_text)
flat_text = re.sub('<link rel="icon".+?href="(?P<filename>[^"\']*)"',
SrcReplace,
« no previous file with comments | « chrome/browser/resources/shared/js/cr/ui/menu_item.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698