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

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

Issue 3517004: Revert 60997 - o Add user customizable launch type for apps by adding options... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: 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
===================================================================
--- 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,
« 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