@@ -184,8 +184,8 @@ private HTMLElement generateHeadElement(int indentLevel) {
184184 String [] presentationStyles = IntroPlugin .getDefault ().getIntroModelRoot ().getPresentation ()
185185 .getImplementationStyles ();
186186 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 ));
189189 }
190190 String pageStyle = introPage .getStyle ();
191191 if (pageStyle != null )
@@ -195,8 +195,8 @@ private HTMLElement generateHeadElement(int indentLevel) {
195195
196196 // add the page's inherited style(s)
197197 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 ] ;
200200 if (pageStyle != null )
201201 head .addContent (generateLinkElement (pageStyle , indentLevel + 1 ));
202202 }
@@ -216,8 +216,8 @@ private HTMLElement generateHeadElement(int indentLevel) {
216216 // TODO: there should only be one of these at the page level, not a
217217 // collection..
218218 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 ] ;
221221 if (introHead != null ) {
222222 content = readFromFile (introHead .getSrc (), introHead .getInlineEncoding ());
223223 if (content != null )
@@ -300,7 +300,8 @@ private HTMLElement generateBodyElement(int indentLevel, HTMLElement head) {
300300
301301 // Add any children of the page, in the order they are defined
302302 AbstractIntroElement [] children = introPage .getChildren ();
303- for (AbstractIntroElement child : children ) {
303+ for (int i = 0 ; i < children .length ; i ++) {
304+ AbstractIntroElement child = children [i ];
304305 // use indentLevel + 2 here, since this element is contained within
305306 // the pageContentDiv
306307 HTMLElement childElement = generateIntroElement (child , indentLevel + 2 );
@@ -443,8 +444,9 @@ private HTMLElement generateIntroDiv(IntroGroup element, int indentLevel) {
443444 imageUrl = BundleUtil .getResolvedResourceLocation (element .getBase (), imageUrl , element
444445 .getBundle ());
445446 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
448450 style = "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + imageUrl + "', sizingMethod='crop');" ; //$NON-NLS-1$ //$NON-NLS-2$
449451 } else {
450452 style = "background-image : url(" + imageUrl + ")" ; //$NON-NLS-1$ //$NON-NLS-2$
@@ -453,7 +455,8 @@ private HTMLElement generateIntroDiv(IntroGroup element, int indentLevel) {
453455 }
454456 // Add any children of the div, in the order they are defined
455457 AbstractIntroElement [] children = element .getChildren ();
456- for (AbstractIntroElement child : children ) {
458+ for (int i = 0 ; i < children .length ; i ++) {
459+ AbstractIntroElement child = children [i ];
457460 HTMLElement childElement = generateIntroElement (child , indentLevel + 1 );
458461 if (childElement != null ) {
459462 addMixinStyle (childElement , child .getMixinStyle ());
@@ -1015,9 +1018,10 @@ private HTMLElement generateImageElement(String imageSrc, String altText, String
10151018 int indentLevel ) {
10161019 HTMLElement image = new FormattedHTMLElement (IIntroHTMLConstants .ELEMENT_IMG , indentLevel , true ,
10171020 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+ 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.
10211025 // IE does not support alpha blanding well.
10221026 // We will set the alpha image loader and load the real image
10231027 // that way. The 'src' attribute in the image itself will
@@ -1026,7 +1030,7 @@ private HTMLElement generateImageElement(String imageSrc, String altText, String
10261030 IIntroHTMLConstants .IMAGE_SRC_BLANK , IIntroConstants .PLUGIN_ID );
10271031 if (blankImageURL != null ) {
10281032 image .addAttribute (IIntroHTMLConstants .ATTRIBUTE_SRC , blankImageURL );
1029- if (svgOnWin32 ) {
1033+ if (pngOnWin32 ) {
10301034 String style = "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + imageSrc + "', sizingMethod='image')" ; //$NON-NLS-1$//$NON-NLS-2$
10311035 image .addAttribute (IIntroHTMLConstants .ATTRIBUTE_STYLE , style );
10321036 }
0 commit comments