nikhilbchilwant / google-web-toolkit-incubator

Automatically exported from code.google.com/p/google-web-toolkit-incubator
1 stars 1 forks source link

ImageResource spriting not working properly for IE6 #259

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What version of gwt and gwt-incubator are you using?

gwt 1.6
gwt-incubator 

What OS and browser are you using?

Windows XP/IE6

Do you see this error in hosted mode, web mode, or both?

web mode in IE6 (only tried hosted mode on Linux, which works)

Hopefully using the test case you have generously provided, what steps will
reproduce the problem? 
1. In a ImmutableResourceBundle, define an ImageResource for a png file
2. Create an Image from it by:

new Image(resource.getURL(), resource.getLeft(), resource.getTop(),
resource.getWidth(), resource.getHeight());

3. Add the Image to the document.

What is the expected output? What do you see instead?

The Image doesn't display in IE6.  The same DOM code is genreated for IE7,
but shows up properly there.

Workaround if you have one:

Use CssResource instead by creating a @sprite css rule with gwt-image
pointing to the defined ImageResource.

Original issue reported on code.google.com by chun...@gmail.com on 8 Apr 2009 at 4:57

GoogleCodeExporter commented 8 years ago
I had the same problem when I was using incubator 1.5, with ie6 failing and ie7
working, and now that I've upgraded to 1.6, it now fails for me on both 
browsers.

...I had to revert to normal image-bundles for most stuff, but I really liked 
the
"create images by adding any element with a specified classname"...  Anyway, 
using
the script debugger {free with Microsoft vhd installed w/ virtualBox on 
ubuntu}, I get:

.IB {BACKGROUND: url(undefined) no-repeat -32px 0px;LEFT: -16px;OVERFLOW:
hidden;WIDTH: 16px;POSITION: absolute;TOP: -16px;HEIGHT: 16px}

Where, obviously the url SHOULD be defined...  Were I a little more ambitious, I
would just write a script to manually edit my builds to include the proper 
url... But
that's a real pain and terrible workaround, since the implementation makes 
different
bundles depending on the repeat-x, repeat-y annotations...  

The imagebundles ARE generated in my war folder, but the file name doesn't 
survive
compiles.  I'm wondering if this is because I'm creating the 
ImmutableResourceBundle
AND the CssResource as static final in the Immutable... interface file.

I'll put the creation into an onModule load to get the GWT.create() out of a 
clinit
and into the final bootstrap.  If it helps, I'll post the workaround.

...Including raw source for test purposes, just access 
xFrameBundle.xNS.xClassName()
to include the resource bundle...  Proper use is to create an absolute div with
specified width / height, and fill it with elements that have all the
north/south/east/west classnames {one per element}, AND an element with the 
xCore
class name that has the same size as it's parent.  Add an xCoreBg to give a
semi-transparent background.  Proper display {on most browser} is a green box 
with
faded borders; on ie it's just a box with no borders.  ...If only the 
imageresource
url wasn't getting lost.  ...Might try accessing the url in an onModuleLoad as 
well.

...More La

Original comment by a.revolu...@gmail.com on 12 Apr 2009 at 6:29

Attachments:

GoogleCodeExporter commented 8 years ago
UPDATE!!

Yes, the problem was URL access.

Workaround for ie7 is to call xBundle.xINST.xSprite().getURL().  I've added a 
global
static function that takes any object and does nothing with it.  I call it 
xInkclude,
because it touched the code to make sure the compiler doesn't cut it out.

Where I make the static files matters not, just make sure to directly call one 
of the
sprite's getURL somewhere, and ie7 will work properly.  I'm assuming this will 
fix
ie6 as well.  I'll switch out vhds and do a test...  If I don't post back, 
assume
this is a global fix...

For the code includes in the above zip file, I did:

static StyleElement 
xFrameEl=StyleInjector.injectStylesheet(xFrameBundle.xNS.getText());
static{
    xCommons.xInklude(xFrameBundle.xINST.xNW().getURL());
}

where xInklude does nothing at all, xINST is an instance of the
ImmutableResourceBundle and xNS is the CssResource that points to class names...

Original comment by a.revolu...@gmail.com on 12 Apr 2009 at 6:55