@@ -184,8 +184,8 @@ private HTMLElement generateHeadElement(int indentLevel) {
184
184
String [] presentationStyles = IntroPlugin .getDefault ().getIntroModelRoot ().getPresentation ()
185
185
.getImplementationStyles ();
186
186
if (presentationStyles != null && introPage .injectSharedStyle ()) {
187
- for (String presentationStyle : presentationStyles )
188
- head .addContent (generateLinkElement (presentationStyle , indentLevel + 1 ));
187
+ for (int i = 0 ; i < presentationStyles . length ; i ++ )
188
+ head .addContent (generateLinkElement (presentationStyles [ i ] , indentLevel + 1 ));
189
189
}
190
190
String pageStyle = introPage .getStyle ();
191
191
if (pageStyle != null )
@@ -195,8 +195,8 @@ private HTMLElement generateHeadElement(int indentLevel) {
195
195
196
196
// add the page's inherited style(s)
197
197
String [] pageStyles = introPage .getStyles ();
198
- for (String pageStyle2 : pageStyles ) {
199
- pageStyle = pageStyle2 ;
198
+ for (int i = 0 ; i < pageStyles . length ; i ++ ) {
199
+ pageStyle = pageStyles [ i ] ;
200
200
if (pageStyle != null )
201
201
head .addContent (generateLinkElement (pageStyle , indentLevel + 1 ));
202
202
}
@@ -216,8 +216,8 @@ private HTMLElement generateHeadElement(int indentLevel) {
216
216
// TODO: there should only be one of these at the page level, not a
217
217
// collection..
218
218
IntroHead [] htmlHeads = introPage .getHTMLHeads ();
219
- for (IntroHead htmlHead : htmlHeads ) {
220
- introHead = htmlHead ;
219
+ for (int i = 0 ; i < htmlHeads . length ; i ++ ) {
220
+ introHead = htmlHeads [ i ] ;
221
221
if (introHead != null ) {
222
222
content = readFromFile (introHead .getSrc (), introHead .getInlineEncoding ());
223
223
if (content != null )
@@ -300,7 +300,8 @@ private HTMLElement generateBodyElement(int indentLevel, HTMLElement head) {
300
300
301
301
// Add any children of the page, in the order they are defined
302
302
AbstractIntroElement [] children = introPage .getChildren ();
303
- for (AbstractIntroElement child : children ) {
303
+ for (int i = 0 ; i < children .length ; i ++) {
304
+ AbstractIntroElement child = children [i ];
304
305
// use indentLevel + 2 here, since this element is contained within
305
306
// the pageContentDiv
306
307
HTMLElement childElement = generateIntroElement (child , indentLevel + 2 );
@@ -443,8 +444,9 @@ private HTMLElement generateIntroDiv(IntroGroup element, int indentLevel) {
443
444
imageUrl = BundleUtil .getResolvedResourceLocation (element .getBase (), imageUrl , element
444
445
.getBundle ());
445
446
String style ;
446
- if (Platform .getWS ().equals (Platform .WS_WIN32 ) && !backgroundSizeWorks
447
- && imageUrl .toLowerCase ().endsWith (".svg" )) { //$NON-NLS-1$
447
+ if (Platform .getWS ().equals (Platform .WS_WIN32 ) && !backgroundSizeWorks && imageUrl .toLowerCase ().endsWith (".png" )) { //$NON-NLS-1$
448
+ // IE 5.5+ does not handle alphas in PNGs without
449
+ // this hack. Remove when IE7 becomes widespread
448
450
style = "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + imageUrl + "', sizingMethod='crop');" ; //$NON-NLS-1$ //$NON-NLS-2$
449
451
} else {
450
452
style = "background-image : url(" + imageUrl + ")" ; //$NON-NLS-1$ //$NON-NLS-2$
@@ -453,7 +455,8 @@ private HTMLElement generateIntroDiv(IntroGroup element, int indentLevel) {
453
455
}
454
456
// Add any children of the div, in the order they are defined
455
457
AbstractIntroElement [] children = element .getChildren ();
456
- for (AbstractIntroElement child : children ) {
458
+ for (int i = 0 ; i < children .length ; i ++) {
459
+ AbstractIntroElement child = children [i ];
457
460
HTMLElement childElement = generateIntroElement (child , indentLevel + 1 );
458
461
if (childElement != null ) {
459
462
addMixinStyle (childElement , child .getMixinStyle ());
@@ -1015,18 +1018,18 @@ private HTMLElement generateImageElement(String imageSrc, String altText, String
1015
1018
int indentLevel ) {
1016
1019
HTMLElement image = new FormattedHTMLElement (IIntroHTMLConstants .ELEMENT_IMG , indentLevel , true ,
1017
1020
false );
1018
- boolean svgOnWin32 = imageSrc != null && Platform .getWS ().equals (Platform .WS_WIN32 )
1019
- && !backgroundSizeWorks && imageSrc .toLowerCase ().endsWith (".svg " ); //$NON-NLS-1$
1020
- if (imageSrc == null || svgOnWin32 ) {
1021
- // IE does not support alpha blanding well.
1021
+ boolean pngOnWin32 = imageSrc != null && Platform .getWS ().equals (Platform .WS_WIN32 )
1022
+ && !backgroundSizeWorks && imageSrc .toLowerCase ().endsWith (".png " ); //$NON-NLS-1$
1023
+ if (imageSrc == null || pngOnWin32 ) {
1024
+ // we must handle PNGs here - IE does not support alpha blanding well.
1022
1025
// We will set the alpha image loader and load the real image
1023
1026
// that way. The 'src' attribute in the image itself will
1024
1027
// get the blank image.
1025
1028
String blankImageURL = BundleUtil .getResolvedResourceLocation (
1026
1029
IIntroHTMLConstants .IMAGE_SRC_BLANK , IIntroConstants .PLUGIN_ID );
1027
1030
if (blankImageURL != null ) {
1028
1031
image .addAttribute (IIntroHTMLConstants .ATTRIBUTE_SRC , blankImageURL );
1029
- if (svgOnWin32 ) {
1032
+ if (pngOnWin32 ) {
1030
1033
String style = "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + imageSrc + "', sizingMethod='image')" ; //$NON-NLS-1$//$NON-NLS-2$
1031
1034
image .addAttribute (IIntroHTMLConstants .ATTRIBUTE_STYLE , style );
1032
1035
}
0 commit comments