gwtproject / gwt

GWT Open Source Project
http://www.gwtproject.org
1.5k stars 371 forks source link

Cell widgets' ClientBundle shouldn't include ImageResource #5607

Closed dankurka closed 9 years ago

dankurka commented 9 years ago

Originally reported on Google Code with ID 5608

Found in GWT Release (e.g. 1.5.3, 1.6 RC):
2.1.0

Detailed description (please be as specific as possible):
CellList.Resources, CellBrowser.Resources, CellTree.Resources, etc. all include ImageResource
that are IMO "implementation details" of the default styles (mostly, if not all, background
images); e.g. CellList.Resources#cellListSelectedBackground for instance. 
It means that if I want to use, say, a CSS gradient as background in supported browsers
and simple background-color otherwise (i.e. no image), the image will still be bundled
in the "sprite image" for IE despite not being used (because the image is generated
before the code is optimized and unused methods are pruned).

IMO, Resources should only include the necessary ImageResources (the one called directly
from code) and the Style. And if the default styling for a particular widget includes
@sprite'd ImageResources, it should use a DefaultResources, and the widget's constructor
use a GWT.create(DefaultResources.class) instead of the current GWT.create(Resources.class)

Reported by t.broyer on 2010-11-18 00:45:40

dankurka commented 9 years ago

Reported by dankurka@google.com on 2013-05-28 05:50:40