Wednesday, February 1, 2012

Re: ImageResources vs ImageResources.getSafeUri

An ImageResource can be generated in many ways: a data: URI, a "css sprite" (one big image with all ImageResource), a simple reference to the image URL on the server, etc.

new Image(ImageResource) doesn't know which implementation is used (and it shouldn't have to!) so in this case it always sets the image to a transparent GIF and displays the image as a CSS background, adjusting the background position and the image dimensions so that only the part of a "CSS sprite" image (if that's what's being used) is shown.

If you getSafeUri(), then it won't work when the "CSS sprite" technique is used, which is the case by default in IE6 and IE7 (all others should use a data: URI, and IE8 has a fallback to a simple URL in case it's loaded over HTTPS to prevent a mixed-content warning)

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/l30Xt5u1B1QJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment