Skip to content

Commit 8d5f3ea

Browse files
author
zhourenjian
committed
Fixed a bug that CSS background-image's url is not correct in IE for the situation of
cross site script loading.
1 parent b43530f commit 8d5f3ea

File tree

1 file changed

+12
-8
lines changed
  • sources/net.sf.j2s.java.org.eclipse.swt/src/org/eclipse/swt

1 file changed

+12
-8
lines changed

sources/net.sf.j2s.java.org.eclipse.swt/src/org/eclipse/swt/package.js

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,11 @@ $WTC$$.registerCSS = function (clazzName, cssText) {
178178
var location = window.location.href.toString ();
179179
//if (protocol == "file:" || host == "") {
180180
var idx = location.lastIndexOf ("/");
181-
if (idx != -1) {
181+
if (idx != -1 && prefix.indexOf ("http://") != 0
182+
&& prefix.indexOf ("https://") != 0
183+
&& prefix.indexOf ("file://") != 0
184+
&& prefix.indexOf ("ftp://") != 0
185+
&& prefix.indexOf ("javascript://") != 0) {
182186
prefix = location.substring (0, idx + 1) + prefix;
183187
}
184188
//}
@@ -273,18 +277,18 @@ $wt = org.eclipse.swt;
273277
ClazzLoader.registerPackages ("org.eclipse.swt", [
274278
"accessibility",
275279
"browser",
276-
"custom",
280+
"custom",
277281
"dnd",
278-
"events",
282+
"events",
279283
"graphics",
280-
"internal",
281-
"internal.dnd",
282-
"internal.browser",
283-
"internal.struct",
284+
"internal",
285+
"internal.dnd",
286+
"internal.browser",
287+
"internal.struct",
284288
"layout",
285289
"printing",
286290
"program",
287-
"widgets"]);
291+
"widgets"]);
288292

289293
var path = ClazzLoader.getClasspathFor ("org.eclipse.swt.*");
290294

0 commit comments

Comments
 (0)