]> source.dussan.org Git - vaadin-framework.git/commitdiff
CustomLayout now prefixes inline styles with url(). Fixes #2653
authorMarc Englund <marc.englund@itmill.com>
Thu, 19 Feb 2009 14:07:11 +0000 (14:07 +0000)
committerMarc Englund <marc.englund@itmill.com>
Thu, 19 Feb 2009 14:07:11 +0000 (14:07 +0000)
svn changeset:6907/svn branch:trunk

src/com/itmill/toolkit/terminal/gwt/client/ui/ICustomLayout.java

index 452621dbc15abaeda023419ec9555b49359031eb..0b218e796f5295b96c1cc1a71d5a56f73e710ef0 100644 (file)
@@ -225,11 +225,16 @@ public class ICustomLayout extends ComplexPanel implements Paintable,
         template = template.replaceAll(
                 "<((?:img)|(?:IMG)) ([^>]*)src=\"((?![a-z]+:)[^/][^\"]+)\"",
                 "<$1 $2src=\"" + relImgPrefix + "$3\"");
-        // also support src attributes without quotas
+        // also support src attributes without quotes
         template = template
                 .replaceAll(
                         "<((?:img)|(?:IMG)) ([^>]*)src=[^\"]((?![a-z]+:)[^/][^ />]+)[ />]",
                         "<$1 $2src=\"" + relImgPrefix + "$3\"");
+        // also prefix relative style="...url(...)..."
+        template = template
+                .replaceAll(
+                        "(<[^>]+style=\"[^\"]*url\\()((?![a-z]+:)[^/][^\"]+)(\\)[^>]*>)",
+                        "$1 " + relImgPrefix + "$2 $3");
 
         getElement().setInnerHTML(template);