diff options
Diffstat (limited to 'src')
35 files changed, 73 insertions, 609 deletions
diff --git a/src/com/vaadin/terminal/gwt/DefaultWidgetSet.gwt.xml b/src/com/vaadin/terminal/gwt/DefaultWidgetSet.gwt.xml index 66ab7202ed..5884cdaceb 100644 --- a/src/com/vaadin/terminal/gwt/DefaultWidgetSet.gwt.xml +++ b/src/com/vaadin/terminal/gwt/DefaultWidgetSet.gwt.xml @@ -18,7 +18,7 @@ <when-type-is class="com.google.gwt.core.client.impl.SchedulerImpl" /> </replace-with> - <!-- Use our own history impl for IE to workaround #2931. --> + <!-- Use our own history impl for IE7 to workaround #2931. --> <replace-with class="com.vaadin.terminal.gwt.client.HistoryImplIEVaadin"> <when-type-is class="com.google.gwt.user.client.impl.HistoryImpl" /> <when-property-is name="user.agent" value="ie6" /> diff --git a/src/com/vaadin/terminal/gwt/client/ApplicationConfiguration.java b/src/com/vaadin/terminal/gwt/client/ApplicationConfiguration.java index 506f2d8eaf..15a025937d 100644 --- a/src/com/vaadin/terminal/gwt/client/ApplicationConfiguration.java +++ b/src/com/vaadin/terminal/gwt/client/ApplicationConfiguration.java @@ -443,10 +443,6 @@ public class ApplicationConfiguration implements EntryPoint { public void onModuleLoad() { - // Enable IE6 Background image caching - if (BrowserInfo.get().isIE6()) { - enableIE6BackgroundImageCache(); - } // Prepare VConsole for debugging if (isDebugMode()) { VDebugConsole console = GWT.create(VDebugConsole.class); @@ -476,19 +472,6 @@ public class ApplicationConfiguration implements EntryPoint { startNextApplication(); } - // From ImageSrcIE6 - private static native void enableIE6BackgroundImageCache() - /*-{ - // Fix IE background image refresh bug, present through IE6 - // see http://www.mister-pixel.com/#Content__state=is_that_simple - // this only works with IE6 SP1+ - try { - $doc.execCommand("BackgroundImageCache", false, true); - } catch (e) { - // ignore error on other browsers - } - }-*/; - /** * Checks if client side is in debug mode. Practically this is invoked by * adding ?debug parameter to URI. diff --git a/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java b/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java index 18ccd363a8..5e0f420d49 100644 --- a/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java +++ b/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java @@ -2332,19 +2332,6 @@ public class ApplicationConnection { } - /** - * Adds PNG-fix conditionally (only for IE6) to the specified IMG -element. - * - * @param el - * the IMG element to fix - */ - public void addPngFix(Element el) { - BrowserInfo b = BrowserInfo.get(); - if (b.isIE6()) { - Util.addPngFix(el); - } - } - /* * Helper to run layout functions triggered by child components with a * decent interval. diff --git a/src/com/vaadin/terminal/gwt/client/BrowserInfo.java b/src/com/vaadin/terminal/gwt/client/BrowserInfo.java index 3c908556fa..daa62b4495 100644 --- a/src/com/vaadin/terminal/gwt/client/BrowserInfo.java +++ b/src/com/vaadin/terminal/gwt/client/BrowserInfo.java @@ -192,10 +192,6 @@ public class BrowserInfo { return isSafari() && browserDetails.getBrowserMajorVersion() == 4; } - public boolean isIE6() { - return isIE() && browserDetails.getBrowserMajorVersion() == 6; - } - public boolean isIE7() { return isIE() && browserDetails.getBrowserMajorVersion() == 7; } diff --git a/src/com/vaadin/terminal/gwt/client/Util.java b/src/com/vaadin/terminal/gwt/client/Util.java index bd46871902..fd014bffe6 100644 --- a/src/com/vaadin/terminal/gwt/client/Util.java +++ b/src/com/vaadin/terminal/gwt/client/Util.java @@ -11,7 +11,6 @@ import java.util.Iterator; import java.util.Map; import java.util.Set; -import com.google.gwt.core.client.GWT; import com.google.gwt.core.client.Scheduler; import com.google.gwt.core.client.Scheduler.ScheduledCommand; import com.google.gwt.dom.client.DivElement; @@ -209,18 +208,6 @@ public class Util { } /** - * Detects if current browser is IE6. - * - * @deprecated use BrowserInfo class instead - * - * @return true if IE6 - */ - @Deprecated - public static boolean isIE6() { - return BrowserInfo.get().isIE6(); - } - - /** * @deprecated use BrowserInfo class instead * @return */ @@ -250,7 +237,7 @@ public class Util { DOM.setInnerText(escapeHtmlHelper, html); String escapedText = DOM.getInnerHTML(escapeHtmlHelper); if (BrowserInfo.get().isIE() && BrowserInfo.get().getIEVersion() < 9) { - // #7478 IE6-IE8 "incorrectly" returns "<br>" for newlines set using + // #7478 IE7-IE8 "incorrectly" returns "<br>" for newlines set using // setInnerText. The same for " " which is converted to " " escapedText = escapedText.replaceAll("<(BR|br)>", "\n"); escapedText = escapedText.replaceAll(" ", " "); @@ -275,48 +262,6 @@ public class Util { } /** - * Adds transparent PNG fix to image element; only use for IE6. - * - * @param el - * IMG element - */ - public native static void addPngFix(Element el) - /*-{ - el.attachEvent("onload", function() { - @com.vaadin.terminal.gwt.client.Util::doIE6PngFix(Lcom/google/gwt/user/client/Element;)(el); - },false); - }-*/; - - private native static void doPngFix(Element el, String blankImageUrl) - /*-{ - var src = el.src; - if (src.indexOf(".png") < 1) return; - var w = el.width || 16; - var h = el.height || 16; - if(h==30 || w==28) { - setTimeout(function(){ - el.style.height = el.height + "px"; - el.style.width = el.width + "px"; - el.src = blankImageUrl; - },10); - } else { - el.src = blankImageUrl; - el.style.height = h + "px"; - el.style.width = w + "px"; - } - el.style.padding = "0"; - el.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+src+"', sizingMethod='crop')"; - }-*/; - - public static void doIE6PngFix(Element el) { - String blankImageUrl = GWT.getModuleBaseURL() + "ie6pngfix/blank.gif"; - String src = el.getAttribute("src"); - if (src != null && !src.equals(blankImageUrl)) { - doPngFix(el, blankImageUrl); - } - } - - /** * Clones given element as in JavaScript. * * Deprecate this if there appears similar method into GWT someday. @@ -334,11 +279,7 @@ public class Util { public static int measureHorizontalPaddingAndBorder(Element element, int paddingGuess) { String originalWidth = DOM.getStyleAttribute(element, "width"); - String originalOverflow = ""; - if (BrowserInfo.get().isIE6()) { - originalOverflow = DOM.getStyleAttribute(element, "overflow"); - DOM.setStyleAttribute(element, "overflow", "hidden"); - } + int originalOffsetWidth = element.getOffsetWidth(); int widthGuess = (originalOffsetWidth - paddingGuess); if (widthGuess < 1) { @@ -348,9 +289,7 @@ public class Util { int padding = element.getOffsetWidth() - widthGuess; DOM.setStyleAttribute(element, "width", originalWidth); - if (BrowserInfo.get().isIE6()) { - DOM.setStyleAttribute(element, "overflow", originalOverflow); - } + return padding; } @@ -412,7 +351,6 @@ public class Util { int offsetWidth = element.getOffsetWidth(); int offsetHeight = element.getOffsetHeight(); - // if (BrowserInfo.get().isIE6()) { if (offsetHeight < 1) { offsetHeight = 1; } @@ -420,7 +358,6 @@ public class Util { offsetWidth = 10; } element.getStyle().setPropertyPx("width", offsetWidth); - // } element.getStyle().setPropertyPx("height", offsetHeight); @@ -428,9 +365,7 @@ public class Util { - element.getPropertyInt("clientHeight"); element.getStyle().setProperty("height", height); - // if (BrowserInfo.get().isIE6()) { element.getStyle().setProperty("width", width); - // } } else { borders = element.getOffsetHeight() - element.getPropertyInt("clientHeight"); diff --git a/src/com/vaadin/terminal/gwt/client/VCaption.java b/src/com/vaadin/terminal/gwt/client/VCaption.java index 5381f20d1b..59f1a5c437 100644 --- a/src/com/vaadin/terminal/gwt/client/VCaption.java +++ b/src/com/vaadin/terminal/gwt/client/VCaption.java @@ -29,7 +29,6 @@ public class VCaption extends HTML { private final ApplicationConnection client; private boolean placedAfterComponent = false; - private boolean iconOnloadHandled = false; private int maxWidth = -1; @@ -112,7 +111,6 @@ public class VCaption extends HTML { // Icon forces the caption to be above the component placedAfterComponent = false; - iconOnloadHandled = false; icon.setUri(uidl.getStringAttribute(ATTRIBUTE_ICON)); } else if (icon != null) { @@ -246,16 +244,10 @@ public class VCaption extends HTML { } if (DOM.eventGetType(event) == Event.ONLOAD - && icon.getElement() == target && !iconOnloadHandled) { + && icon.getElement() == target) { icon.setWidth(""); icon.setHeight(""); - /* - * IE6 pngFix causes two onload events to be fired and we want to - * react only to the first one - */ - iconOnloadHandled = true; - // if max width defined, recalculate if (maxWidth != -1) { setMaxWidth(maxWidth); diff --git a/src/com/vaadin/terminal/gwt/client/ui/FocusElementPanel.java b/src/com/vaadin/terminal/gwt/client/ui/FocusElementPanel.java index 5f3e5b18fd..76e6edcc43 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/FocusElementPanel.java +++ b/src/com/vaadin/terminal/gwt/client/ui/FocusElementPanel.java @@ -13,11 +13,9 @@ import com.google.gwt.user.client.Element; import com.google.gwt.user.client.Event; import com.google.gwt.user.client.ui.Widget; import com.google.gwt.user.client.ui.impl.FocusImpl; -import com.vaadin.terminal.gwt.client.BrowserInfo; /** * A panel that contains an always visible 0x0 size element that holds the focus - * for all browsers but IE6. */ public class FocusElementPanel extends SimpleFocusablePanel { @@ -30,22 +28,20 @@ public class FocusElementPanel extends SimpleFocusablePanel { @Override public void setWidget(Widget w) { super.setWidget(w); - if (!BrowserInfo.get().isIE6()) { - if (focusElement.getParentElement() == null) { - Style style = focusElement.getStyle(); - style.setPosition(Position.FIXED); - style.setTop(0, Unit.PX); - style.setLeft(0, Unit.PX); - getElement().appendChild(focusElement); - /* Sink from focusElement too as focus and blur don't bubble */ - DOM.sinkEvents( - (com.google.gwt.user.client.Element) focusElement - .cast(), Event.FOCUSEVENTS); - // revert to original, not focusable - getElement().setPropertyObject("tabIndex", null); - } else { - moveFocusElementAfterWidget(); - } + if (focusElement.getParentElement() == null) { + Style style = focusElement.getStyle(); + style.setPosition(Position.FIXED); + style.setTop(0, Unit.PX); + style.setLeft(0, Unit.PX); + getElement().appendChild(focusElement); + /* Sink from focusElement too as focus and blur don't bubble */ + DOM.sinkEvents( + (com.google.gwt.user.client.Element) focusElement.cast(), + Event.FOCUSEVENTS); + // revert to original, not focusable + getElement().setPropertyObject("tabIndex", null); + } else { + moveFocusElementAfterWidget(); } } @@ -58,28 +54,20 @@ public class FocusElementPanel extends SimpleFocusablePanel { @Override public void setFocus(boolean focus) { - if (BrowserInfo.get().isIE6()) { - super.setFocus(focus); + if (focus) { + FocusImpl.getFocusImplForPanel().focus( + (Element) focusElement.cast()); } else { - if (focus) { - FocusImpl.getFocusImplForPanel().focus( - (Element) focusElement.cast()); - } else { - FocusImpl.getFocusImplForPanel().blur( - (Element) focusElement.cast()); - } + FocusImpl.getFocusImplForPanel() + .blur((Element) focusElement.cast()); } } @Override public void setTabIndex(int tabIndex) { - if (BrowserInfo.get().isIE6()) { - super.setTabIndex(tabIndex); - } else { - getElement().setTabIndex(-1); - if (focusElement != null) { - focusElement.setTabIndex(tabIndex); - } + getElement().setTabIndex(-1); + if (focusElement != null) { + focusElement.setTabIndex(tabIndex); } } diff --git a/src/com/vaadin/terminal/gwt/client/ui/FocusableScrollPanel.java b/src/com/vaadin/terminal/gwt/client/ui/FocusableScrollPanel.java index 74823ce75b..2452190d9d 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/FocusableScrollPanel.java +++ b/src/com/vaadin/terminal/gwt/client/ui/FocusableScrollPanel.java @@ -21,7 +21,6 @@ import com.google.gwt.user.client.Event; import com.google.gwt.user.client.ui.ScrollPanel; import com.google.gwt.user.client.ui.Widget; import com.google.gwt.user.client.ui.impl.FocusImpl; -import com.vaadin.terminal.gwt.client.BrowserInfo; /** * A scrollhandlers similar to {@link ScrollPanel}. @@ -57,18 +56,9 @@ public class FocusableScrollPanel extends SimpleFocusablePanel implements if (useFakeFocusElement()) { if (focusElement.getParentElement() == null) { Style style = focusElement.getStyle(); - if (BrowserInfo.get().isIE6()) { - style.setOverflow(Overflow.HIDDEN); - style.setHeight(0, Unit.PX); - style.setWidth(0, Unit.PX); - style.setPosition(Position.ABSOLUTE); - - addScrollHandler(this); - } else { - style.setPosition(Position.FIXED); - style.setTop(0, Unit.PX); - style.setLeft(0, Unit.PX); - } + style.setPosition(Position.FIXED); + style.setTop(0, Unit.PX); + style.setLeft(0, Unit.PX); getElement().appendChild(focusElement); /* Sink from focusElemet too as focusa and blur don't bubble */ DOM.sinkEvents( diff --git a/src/com/vaadin/terminal/gwt/client/ui/Icon.java b/src/com/vaadin/terminal/gwt/client/ui/Icon.java index eba1a9bd78..bf24f6dac2 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/Icon.java +++ b/src/com/vaadin/terminal/gwt/client/ui/Icon.java @@ -19,7 +19,6 @@ public class Icon extends UIObject { DOM.setElementProperty(getElement(), "alt", ""); setStyleName(CLASSNAME); this.client = client; - client.addPngFix(getElement()); } public Icon(ApplicationConnection client, String uidlUri) { diff --git a/src/com/vaadin/terminal/gwt/client/ui/VAbsoluteLayout.java b/src/com/vaadin/terminal/gwt/client/ui/VAbsoluteLayout.java index b0590ce5a0..cace2105c5 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VAbsoluteLayout.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VAbsoluteLayout.java @@ -22,7 +22,6 @@ import com.google.gwt.user.client.ui.ComplexPanel; import com.google.gwt.user.client.ui.SimplePanel; import com.google.gwt.user.client.ui.Widget; import com.vaadin.terminal.gwt.client.ApplicationConnection; -import com.vaadin.terminal.gwt.client.BrowserInfo; import com.vaadin.terminal.gwt.client.Container; import com.vaadin.terminal.gwt.client.EventId; import com.vaadin.terminal.gwt.client.Paintable; @@ -30,7 +29,6 @@ import com.vaadin.terminal.gwt.client.RenderSpace; import com.vaadin.terminal.gwt.client.UIDL; import com.vaadin.terminal.gwt.client.Util; import com.vaadin.terminal.gwt.client.VCaption; -import com.vaadin.terminal.gwt.client.VConsole; public class VAbsoluteLayout extends ComplexPanel implements Container { @@ -211,9 +209,6 @@ public class VAbsoluteLayout extends ComplexPanel implements Container { canvas.getStyle().setProperty("width", width); if (!rendering) { - if (BrowserInfo.get().isIE6()) { - relayoutWrappersForIe6(); - } relayoutRelativeChildren(); } } @@ -236,21 +231,10 @@ public class VAbsoluteLayout extends ComplexPanel implements Container { canvas.getStyle().setProperty("height", height); if (!rendering) { - if (BrowserInfo.get().isIE6()) { - relayoutWrappersForIe6(); - } relayoutRelativeChildren(); } } - private void relayoutWrappersForIe6() { - for (Widget wrapper : getChildren()) { - if (wrapper instanceof AbsoluteWrapper) { - ((AbsoluteWrapper) wrapper).ie6Layout(); - } - } - } - public class AbsoluteWrapper extends SimplePanel { private String css; private String left; @@ -353,9 +337,6 @@ public class VAbsoluteLayout extends ComplexPanel implements Container { style.setProperty("right", right); style.setProperty("bottom", bottom); - if (BrowserInfo.get().isIE6()) { - ie6Layout(); - } } updateCaptionPosition(); } @@ -369,60 +350,6 @@ public class VAbsoluteLayout extends ComplexPanel implements Container { - caption.getHeight()); } } - - private void ie6Layout() { - // special handling for IE6 is needed, it does not support - // setting both left/right or top/bottom - Style style = getElement().getStyle(); - if (bottom != null && top != null) { - // define height for wrapper to simulate bottom property - int bottompixels = measureForIE6(bottom, true); - VConsole.log("ALB" + bottompixels); - int height = canvas.getOffsetHeight() - bottompixels - - getElement().getOffsetTop(); - VConsole.log("ALB" + height); - if (height < 0) { - height = 0; - } - style.setPropertyPx("height", height); - } else { - // reset possibly existing value - style.setProperty("height", ""); - } - if (left != null && right != null) { - // define width for wrapper to simulate right property - int rightPixels = measureForIE6(right, false); - VConsole.log("ALR" + rightPixels); - int width = canvas.getOffsetWidth() - rightPixels - - getElement().getOffsetLeft(); - VConsole.log("ALR" + width); - if (width < 0) { - width = 0; - } - style.setPropertyPx("width", width); - } else { - // reset possibly existing value - style.setProperty("width", ""); - } - } - - } - - private Element measureElement; - - private int measureForIE6(String cssLength, boolean vertical) { - if (measureElement == null) { - measureElement = DOM.createDiv(); - measureElement.getStyle().setProperty("position", "absolute"); - canvas.appendChild(measureElement); - } - if (vertical) { - measureElement.getStyle().setProperty("height", cssLength); - return measureElement.getOffsetHeight(); - } else { - measureElement.getStyle().setProperty("width", cssLength); - return measureElement.getOffsetWidth(); - } } /** diff --git a/src/com/vaadin/terminal/gwt/client/ui/VAccordion.java b/src/com/vaadin/terminal/gwt/client/ui/VAccordion.java index 66192489a9..6faf82446a 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VAccordion.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VAccordion.java @@ -16,7 +16,6 @@ import com.google.gwt.user.client.Event; import com.google.gwt.user.client.ui.ComplexPanel; import com.google.gwt.user.client.ui.Widget; import com.vaadin.terminal.gwt.client.ApplicationConnection; -import com.vaadin.terminal.gwt.client.BrowserInfo; import com.vaadin.terminal.gwt.client.ContainerResizedListener; import com.vaadin.terminal.gwt.client.Paintable; import com.vaadin.terminal.gwt.client.RenderInformation; @@ -50,10 +49,6 @@ public class VAccordion extends VTabsheetBase implements public VAccordion() { super(CLASSNAME); - // IE6 needs this to calculate offsetHeight correctly - if (BrowserInfo.get().isIE6()) { - DOM.setStyleAttribute(getElement(), "zoom", "1"); - } } @Override @@ -434,10 +429,6 @@ public class VAccordion extends VTabsheetBase implements setElement(DOM.createDiv()); caption = new VCaption(null, client); caption.addClickHandler(this); - if (BrowserInfo.get().isIE6()) { - DOM.setEventListener(captionNode, this); - DOM.sinkEvents(captionNode, Event.BUTTON_LEFT); - } super.add(caption, captionNode); DOM.appendChild(captionNode, caption.getElement()); DOM.appendChild(getElement(), captionNode); @@ -496,10 +487,6 @@ public class VAccordion extends VTabsheetBase implements removeStyleDependentName("open"); setHeight(-1); setWidth(""); - if (BrowserInfo.get().isIE6()) { - // Work around for IE6 layouting problem #3359 - getElement().getStyle().setProperty("zoom", "1"); - } open = false; } diff --git a/src/com/vaadin/terminal/gwt/client/ui/VButton.java b/src/com/vaadin/terminal/gwt/client/ui/VButton.java index 442d0709ef..3df623415a 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VButton.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VButton.java @@ -143,8 +143,8 @@ public class VButton extends FocusWidget implements Paintable, ClickHandler, } wrapper.insertBefore(errorIndicatorElement, captionElement); - // Fix for IE6, IE7 - if (BrowserInfo.get().isIE6() || BrowserInfo.get().isIE7()) { + // Fix for IE7 + if (BrowserInfo.get().isIE7()) { errorIndicatorElement.setInnerText(" "); } @@ -453,7 +453,7 @@ public class VButton extends FocusWidget implements Paintable, ClickHandler, @Override public void setWidth(String width) { - if (BrowserInfo.get().isIE6() || BrowserInfo.get().isIE7()) { + if (BrowserInfo.get().isIE7()) { if (width != null && width.length() > 2) { // Assume pixel values are always sent from // ApplicationConnection diff --git a/src/com/vaadin/terminal/gwt/client/ui/VContextMenu.java b/src/com/vaadin/terminal/gwt/client/ui/VContextMenu.java index c519990aee..4c1d644756 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VContextMenu.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VContextMenu.java @@ -31,7 +31,6 @@ import com.google.gwt.user.client.ui.MenuBar; import com.google.gwt.user.client.ui.MenuItem; import com.google.gwt.user.client.ui.PopupPanel; import com.google.gwt.user.client.ui.impl.FocusImpl; -import com.vaadin.terminal.gwt.client.BrowserInfo; import com.vaadin.terminal.gwt.client.Focusable; import com.vaadin.terminal.gwt.client.Util; @@ -218,11 +217,6 @@ public class VContextMenu extends VOverlay implements SubPartAware { public void onLoad(LoadEvent event) { // Handle icon onload events to ensure shadow is resized correctly - if (BrowserInfo.get().isIE6()) { - // Ensure PNG transparency works in IE6 - Util.doIE6PngFix((Element) Element.as(event.getNativeEvent() - .getEventTarget())); - } delayedImageLoadExecutioner.trigger(); } diff --git a/src/com/vaadin/terminal/gwt/client/ui/VEmbedded.java b/src/com/vaadin/terminal/gwt/client/ui/VEmbedded.java index 59f0afdd3c..80dc2ef015 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VEmbedded.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VEmbedded.java @@ -87,7 +87,6 @@ public class VEmbedded extends HTML implements Paintable { setHTML(""); el = DOM.createImg(); created = true; - client.addPngFix(el); DOM.sinkEvents(el, Event.ONLOAD); } diff --git a/src/com/vaadin/terminal/gwt/client/ui/VFilterSelect.java b/src/com/vaadin/terminal/gwt/client/ui/VFilterSelect.java index 7c3d3066ce..6f90a140e8 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VFilterSelect.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VFilterSelect.java @@ -12,7 +12,6 @@ import java.util.List; import com.google.gwt.core.client.Scheduler; import com.google.gwt.core.client.Scheduler.ScheduledCommand; -import com.google.gwt.dom.client.Style.Overflow; import com.google.gwt.event.dom.client.BlurEvent; import com.google.gwt.event.dom.client.BlurHandler; import com.google.gwt.event.dom.client.ClickEvent; @@ -726,12 +725,6 @@ public class VFilterSelect extends Composite implements Paintable, Field, } public void onLoad(LoadEvent event) { - if (BrowserInfo.get().isIE6()) { - // Ensure PNG transparency works in IE6 - Util.doIE6PngFix((Element) Element.as(event.getNativeEvent() - .getEventTarget())); - } - // Handle icon onload events to ensure shadow is resized // correctly delayedImageLoadExecutioner.trigger(); @@ -1315,13 +1308,7 @@ public class VFilterSelect extends Composite implements Paintable, Field, private void updateSelectedIconPosition() { // Position icon vertically to middle int availableHeight = 0; - if (BrowserInfo.get().isIE6()) { - getElement().getStyle().setOverflow(Overflow.HIDDEN); - availableHeight = getOffsetHeight(); - getElement().getStyle().setProperty("overflow", ""); - } else { - availableHeight = getOffsetHeight(); - } + availableHeight = getOffsetHeight(); int iconHeight = Util.getRequiredHeight(selectedItemIcon); int marginTop = (availableHeight - iconHeight) / 2; @@ -1664,16 +1651,8 @@ public class VFilterSelect extends Composite implements Paintable, Field, this.width = width; } - if (BrowserInfo.get().isIE6()) { - // Required in IE when textfield is wider than this.width - getElement().getStyle().setOverflow(Overflow.HIDDEN); - horizPaddingAndBorder = Util.setWidthExcludingPaddingAndBorder( - this, width, horizPaddingAndBorder); - getElement().getStyle().setProperty("overflow", ""); - } else { - horizPaddingAndBorder = Util.setWidthExcludingPaddingAndBorder( - this, width, horizPaddingAndBorder); - } + horizPaddingAndBorder = Util.setWidthExcludingPaddingAndBorder(this, + width, horizPaddingAndBorder); if (initDone) { updateRootWidth(); @@ -1763,16 +1742,7 @@ public class VFilterSelect extends Composite implements Paintable, Field, * @return The width in pixels */ private int getMainWidth() { - int componentWidth; - if (BrowserInfo.get().isIE6()) { - // Required in IE when textfield is wider than this.width - getElement().getStyle().setOverflow(Overflow.HIDDEN); - componentWidth = getOffsetWidth(); - getElement().getStyle().setProperty("overflow", ""); - } else { - componentWidth = getOffsetWidth(); - } - return componentWidth; + return getOffsetWidth(); } /** diff --git a/src/com/vaadin/terminal/gwt/client/ui/VForm.java b/src/com/vaadin/terminal/gwt/client/ui/VForm.java index cabe691a3e..67be713e1a 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VForm.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VForm.java @@ -16,7 +16,6 @@ import com.google.gwt.user.client.Event; import com.google.gwt.user.client.ui.ComplexPanel;
import com.google.gwt.user.client.ui.Widget;
import com.vaadin.terminal.gwt.client.ApplicationConnection;
-import com.vaadin.terminal.gwt.client.BrowserInfo;
import com.vaadin.terminal.gwt.client.Container;
import com.vaadin.terminal.gwt.client.Paintable;
import com.vaadin.terminal.gwt.client.RenderInformation;
@@ -214,9 +213,6 @@ public class VForm extends ComplexPanel implements Container, KeyDownHandler { renderInformation.setContentAreaHeight(renderInformation
.getRenderedSize().getHeight() - getSpaceConsumedVertically());
- if (BrowserInfo.get().isIE6()) {
- getElement().getStyle().setProperty("overflow", "hidden");
- }
renderInformation.setContentAreaWidth(renderInformation
.getRenderedSize().getWidth() - borderPaddingHorizontal);
}
diff --git a/src/com/vaadin/terminal/gwt/client/ui/VLabel.java b/src/com/vaadin/terminal/gwt/client/ui/VLabel.java index 28d16b4a39..76ea1297ea 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VLabel.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VLabel.java @@ -125,7 +125,7 @@ public class VLabel extends HTML implements Paintable { @Override public void setText(String text) { if (BrowserInfo.get().isIE() && BrowserInfo.get().getIEVersion() < 9) { - // #3983 - IE6-IE8 incorrectly replaces \n with <br> so we do the + // #3983 - IE7,IE8 incorrectly replaces \n with <br> so we do the // escaping manually and set as HTML super.setHTML(Util.escapeHTML(text)); } else { diff --git a/src/com/vaadin/terminal/gwt/client/ui/VMenuBar.java b/src/com/vaadin/terminal/gwt/client/ui/VMenuBar.java index a2b49bae05..8b53fb01c1 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VMenuBar.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VMenuBar.java @@ -11,7 +11,6 @@ import java.util.Stack; import com.google.gwt.core.client.GWT; import com.google.gwt.core.client.Scheduler; import com.google.gwt.core.client.Scheduler.ScheduledCommand; -import com.google.gwt.dom.client.NodeList; import com.google.gwt.dom.client.Style; import com.google.gwt.dom.client.Style.Overflow; import com.google.gwt.dom.client.Style.Unit; @@ -157,24 +156,9 @@ public class VMenuBar extends SimpleFocusablePanel implements Paintable, } this.width = width; - if (BrowserInfo.get().isIE6() && width.endsWith("px")) { - // IE6 sometimes measures wrong using - // Util.setWidthExcludingPaddingAndBorder so this is extracted to a - // special case that uses another method. Really should fix the - // Util.setWidthExcludingPaddingAndBorder method but that will - // probably break additional cases - int requestedPixelWidth = Integer.parseInt(width.substring(0, - width.length() - 2)); - int paddingBorder = Util.measureHorizontalPaddingAndBorder( - getElement(), 0); - int w = requestedPixelWidth - paddingBorder; - if (w < 0) { - w = 0; - } - getElement().getStyle().setWidth(w, Unit.PX); - } else { - Util.setWidthExcludingPaddingAndBorder(this, width, 0); - } + + Util.setWidthExcludingPaddingAndBorder(this, width, 0); + if (!subMenu) { // Only needed for root level menu hideChildren(); @@ -478,9 +462,6 @@ public class VMenuBar extends SimpleFocusablePanel implements Paintable, // Handle onload events (icon loaded, size changes) if (DOM.eventGetType(e) == Event.ONLOAD) { - if (BrowserInfo.get().isIE6()) { - Util.doIE6PngFix((Element) Element.as(e.getEventTarget())); - } VMenuBar parent = getParentMenu(); if (parent != null) { // The onload event for an image in a popup should be sent to @@ -780,19 +761,10 @@ public class VMenuBar extends SimpleFocusablePanel implements Paintable, style.setHeight(availableHeight, Unit.PX); style.setOverflowY(Overflow.SCROLL); - // Make room for the scroll bar - if (BrowserInfo.get().isIE6()) { - // IE6 renders the sub menu arrow icons on the scroll bar - // unless we add some padding - style.setPaddingRight(Util.getNativeScrollbarSize(), - Unit.PX); - } else { - // For other browsers, adjusting the width of the popup is - // enough - style.setWidth( - contentWidth + Util.getNativeScrollbarSize(), - Unit.PX); - } + // Make room for the scroll bar by adjusting the width of the + // popup + style.setWidth(contentWidth + Util.getNativeScrollbarSize(), + Unit.PX); popup.updateShadowSizeAndPosition(); } } @@ -962,6 +934,7 @@ public class VMenuBar extends SimpleFocusablePanel implements Paintable, addStyleDependentName("selected"); // needed for IE6 to have a single style name to match for an // element + // TODO Can be optimized now that IE6 is not supported any more if (checkable) { if (checked) { removeStyleDependentName("selected-unchecked"); @@ -1170,22 +1143,9 @@ public class VMenuBar extends SimpleFocusablePanel implements Paintable, paddingWidth = widthBefore - getElement().getClientWidth(); getElement().getStyle().setProperty("padding", ""); } - String overflow = ""; - if (BrowserInfo.get().isIE6()) { - // IE6 cannot measure available width correctly without - // overflow:hidden - overflow = getElement().getStyle().getProperty("overflow"); - getElement().getStyle().setProperty("overflow", "hidden"); - } int availableWidth = getElement().getClientWidth() - paddingWidth; - if (BrowserInfo.get().isIE6()) { - // IE6 cannot measure available width correctly without - // overflow:hidden - getElement().getStyle().setProperty("overflow", overflow); - } - // Used width includes the "more" item if present int usedWidth = getConsumedWidth(); int diff = availableWidth - usedWidth; @@ -1230,16 +1190,6 @@ public class VMenuBar extends SimpleFocusablePanel implements Paintable, } else { widthAvailable = diff; } - - if (BrowserInfo.get().isIE6()) { - /* - * Handle transparency for IE6 here as we cannot - * implement it in CustomMenuItem.onAttach because - * onAttach is never called for CustomMenuItem due to an - * invalid component hierarchy (#6203)... - */ - reloadImages(expand.getElement()); - } } } if (collapsedRootItems.getItems().size() > 0) { @@ -1636,31 +1586,4 @@ public class VMenuBar extends SimpleFocusablePanel implements Paintable, return null; } - @Override - protected void onLoad() { - super.onLoad(); - if (BrowserInfo.get().isIE6()) { - reloadImages(getElement()); - } - } - - /** - * Force a new onload event for all images. Used only for IE6 to deal with - * PNG transparency. - */ - private void reloadImages(Element root) { - - NodeList<com.google.gwt.dom.client.Element> imgElements = root - .getElementsByTagName("img"); - for (int i = 0; i < imgElements.getLength(); i++) { - Element e = (Element) imgElements.getItem(i); - - // IE6 fires onload events for the icons before the listener - // is attached (or never). Updating the src force another - // onload event - String src = e.getAttribute("src"); - e.setAttribute("src", src); - } - } - } diff --git a/src/com/vaadin/terminal/gwt/client/ui/VNativeButton.java b/src/com/vaadin/terminal/gwt/client/ui/VNativeButton.java index 3034259353..458c43024c 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VNativeButton.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VNativeButton.java @@ -99,7 +99,9 @@ public class VNativeButton extends Button implements Paintable, ClickHandler, } getElement().insertBefore(errorIndicatorElement, captionElement); - // Fix for IE6, IE7 + // Fix for IE + // TODO This was originally for IE6 & IE7 and might not be needed + // any more if (BrowserInfo.get().isIE()) { errorIndicatorElement.setInnerText(" "); } diff --git a/src/com/vaadin/terminal/gwt/client/ui/VNativeSelect.java b/src/com/vaadin/terminal/gwt/client/ui/VNativeSelect.java index 6261a3988a..a441fb24bd 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VNativeSelect.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VNativeSelect.java @@ -8,9 +8,7 @@ import java.util.ArrayList; import java.util.Iterator; import com.google.gwt.event.dom.client.ChangeEvent; -import com.vaadin.terminal.gwt.client.BrowserInfo; import com.vaadin.terminal.gwt.client.UIDL; -import com.vaadin.terminal.gwt.client.Util; public class VNativeSelect extends VOptionGroupBase implements Field { @@ -58,11 +56,6 @@ public class VNativeSelect extends VOptionGroupBase implements Field { select.setItemSelected(0, true); firstValueIsTemporaryNullItem = true; } - if (BrowserInfo.get().isIE6()) { - // lazy size change - IE6 uses naive dropdown that does not have a - // proper size yet - Util.notifyParentOfSizeChange(this, true); - } } @Override diff --git a/src/com/vaadin/terminal/gwt/client/ui/VOptionGroup.java b/src/com/vaadin/terminal/gwt/client/ui/VOptionGroup.java index e524d4ed9a..f33b905dea 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VOptionGroup.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VOptionGroup.java @@ -20,7 +20,6 @@ import com.google.gwt.event.dom.client.LoadEvent; import com.google.gwt.event.dom.client.LoadHandler;
import com.google.gwt.event.shared.HandlerRegistration;
import com.google.gwt.user.client.Command;
-import com.google.gwt.user.client.Element;
import com.google.gwt.user.client.ui.CheckBox;
import com.google.gwt.user.client.ui.FocusWidget;
import com.google.gwt.user.client.ui.Focusable;
@@ -28,7 +27,6 @@ import com.google.gwt.user.client.ui.Panel; import com.google.gwt.user.client.ui.RadioButton;
import com.google.gwt.user.client.ui.Widget;
import com.vaadin.terminal.gwt.client.ApplicationConnection;
-import com.vaadin.terminal.gwt.client.BrowserInfo;
import com.vaadin.terminal.gwt.client.EventId;
import com.vaadin.terminal.gwt.client.UIDL;
import com.vaadin.terminal.gwt.client.Util;
@@ -51,10 +49,6 @@ public class VOptionGroup extends VOptionGroupBase implements FocusHandler, private final LoadHandler iconLoadHandler = new LoadHandler() {
public void onLoad(LoadEvent event) {
- if (BrowserInfo.get().isIE6()) {
- Util.doIE6PngFix((Element) Element.as(event.getNativeEvent()
- .getEventTarget()));
- }
Util.notifyParentOfSizeChange(VOptionGroup.this, true);
}
};
diff --git a/src/com/vaadin/terminal/gwt/client/ui/VOverlay.java b/src/com/vaadin/terminal/gwt/client/ui/VOverlay.java index 27b8840823..0957b6270f 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VOverlay.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VOverlay.java @@ -162,9 +162,7 @@ public class VOverlay extends PopupPanel implements CloseHandler<PopupPanel> { private static int adjustByRelativeTopBodyMargin() { if (topFix == -1) { - boolean ie6OrIe7 = BrowserInfo.get().isIE() - && BrowserInfo.get().getIEVersion() <= 7; - topFix = detectRelativeBodyFixes("top", ie6OrIe7); + topFix = detectRelativeBodyFixes("top", BrowserInfo.get().isIE7()); } return topFix; } @@ -178,7 +176,7 @@ public class VOverlay extends PopupPanel implements CloseHandler<PopupPanel> { if(cstyle && cstyle.position == 'relative') { var offset = b.getBoundingClientRect()[axis]; if (removeClientLeftOrTop) { - // IE6 and IE7 include the top left border of the client area into the boundingClientRect + // IE7 include the top left border of the client area into the boundingClientRect var clientTopOrLeft = 0; if (axis == "top") clientTopOrLeft = $wnd.document.documentElement.clientTop; @@ -195,9 +193,7 @@ public class VOverlay extends PopupPanel implements CloseHandler<PopupPanel> { private static int adjustByRelativeLeftBodyMargin() { if (leftFix == -1) { - boolean ie6OrIe7 = BrowserInfo.get().isIE() - && BrowserInfo.get().getIEVersion() <= 7; - leftFix = detectRelativeBodyFixes("left", ie6OrIe7); + leftFix = detectRelativeBodyFixes("left", BrowserInfo.get().isIE7()); } return leftFix; diff --git a/src/com/vaadin/terminal/gwt/client/ui/VPanel.java b/src/com/vaadin/terminal/gwt/client/ui/VPanel.java index 692b8a4858..4611f6e4ab 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VPanel.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VPanel.java @@ -322,40 +322,6 @@ public class VPanel extends SimplePanel implements Container, } public void runHacks(boolean runGeckoFix) { - if (BrowserInfo.get().isIE6() && width != null && !width.equals("")) { - /* - * IE6 requires overflow-hidden elements to have a width specified - * so we calculate the width of the content and caption nodes when - * no width has been specified. - */ - /* - * Fixes #1923 VPanel: Horizontal scrollbar does not appear in IE6 - * with wide content - */ - - /* - * Caption must be shrunk for parent measurements to return correct - * result in IE6 - */ - DOM.setStyleAttribute(captionNode, "width", "1px"); - - int parentPadding = Util.measureHorizontalPaddingAndBorder( - getElement(), 0); - - int parentWidthExcludingPadding = getElement().getOffsetWidth() - - parentPadding; - - Util.setWidthExcludingPaddingAndBorder(captionNode, - parentWidthExcludingPadding - getCaptionMarginLeft(), 26, - false); - - int contentMarginLeft = getContentMarginLeft(); - - Util.setWidthExcludingPaddingAndBorder(contentNode, - parentWidthExcludingPadding - contentMarginLeft, 2, false); - - } - if ((BrowserInfo.get().isIE() || BrowserInfo.get().isFF2()) && (width == null || width.equals(""))) { /* diff --git a/src/com/vaadin/terminal/gwt/client/ui/VPopupCalendar.java b/src/com/vaadin/terminal/gwt/client/ui/VPopupCalendar.java index 2cbae57175..06d58fe733 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VPopupCalendar.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VPopupCalendar.java @@ -264,7 +264,7 @@ public class VPopupCalendar extends VTextualDate implements Paintable, Field, int l = calendarToggle.getAbsoluteLeft();
// Add a little extra space to the right to avoid
- // problems with IE6/IE7 scrollbars and to make it look
+ // problems with IE7 scrollbars and to make it look
// nicer.
int extraSpace = 30;
diff --git a/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java b/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java index 959b92cffa..c42567f9b1 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java @@ -2287,7 +2287,7 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler, * of the caption container element by the correct amount */ public void resizeCaptionContainer(int rightSpacing) { - if (BrowserInfo.get().isIE6() || td.getClassName().contains("-asc") + if (td.getClassName().contains("-asc") || td.getClassName().contains("-desc")) { /* * Room for the sort indicator is made by subtracting the styled @@ -3017,12 +3017,7 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler, } public void setHorizontalScrollPosition(int scrollLeft) { - if (BrowserInfo.get().isIE6()) { - hTableWrapper.getStyle().setPosition(Position.RELATIVE); - hTableWrapper.getStyle().setLeft(-scrollLeft, Unit.PX); - } else { - hTableWrapper.setScrollLeft(scrollLeft); - } + hTableWrapper.setScrollLeft(scrollLeft); } public void setColumnCollapsingAllowed(boolean cc) { @@ -3873,12 +3868,7 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler, * The value of the leftScroll */ public void setHorizontalScrollPosition(int scrollLeft) { - if (BrowserInfo.get().isIE6()) { - hTableWrapper.getStyle().setProperty("position", "relative"); - hTableWrapper.getStyle().setPropertyPx("left", -scrollLeft); - } else { - hTableWrapper.setScrollLeft(scrollLeft); - } + hTableWrapper.setScrollLeft(scrollLeft); } /** @@ -5934,7 +5924,7 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler, */ private int getContentAreaBorderHeight() { if (contentAreaBorderHeight < 0) { - if (BrowserInfo.get().isIE7() || BrowserInfo.get().isIE6()) { + if (BrowserInfo.get().isIE7()) { contentAreaBorderHeight = Util .measureVerticalBorder(scrollBodyPanel.getElement()); } else { diff --git a/src/com/vaadin/terminal/gwt/client/ui/VSlider.java b/src/com/vaadin/terminal/gwt/client/ui/VSlider.java index f6c9b3ab0d..34838698b5 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VSlider.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VSlider.java @@ -300,9 +300,7 @@ public class VSlider extends SimpleFocusablePanel implements Paintable, Field, p = 0;
}
if (vertical) {
- // IE6 rounding behaves a little unstable, reduce one pixel so the
- // containing element (base) won't expand without limits
- p = range - p - (BrowserInfo.get().isIE6() ? 1 : 0);
+ p = range - p;
}
final double pos = p;
diff --git a/src/com/vaadin/terminal/gwt/client/ui/VTextField.java b/src/com/vaadin/terminal/gwt/client/ui/VTextField.java index 41d48041fc..ec3eeed15c 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VTextField.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VTextField.java @@ -468,10 +468,6 @@ public class VTextField extends TextBoxBase implements Paintable, Field, setText(""); removeStyleDependentName(CLASSNAME_PROMPT); setPrompting(false); - if (BrowserInfo.get().isIE6()) { - // IE6 does not show the cursor when tabbing into the field - setCursorPos(0); - } } focusedTextField = this; if (client.hasEventListeners(this, EventId.FOCUS)) { diff --git a/src/com/vaadin/terminal/gwt/client/ui/VTextualDate.java b/src/com/vaadin/terminal/gwt/client/ui/VTextualDate.java index 4a0d6ff0f5..4115f30c37 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VTextualDate.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VTextualDate.java @@ -12,7 +12,6 @@ import com.google.gwt.event.dom.client.ChangeEvent; import com.google.gwt.event.dom.client.ChangeHandler; import com.google.gwt.event.dom.client.FocusEvent; import com.google.gwt.event.dom.client.FocusHandler; -import com.google.gwt.user.client.DOM; import com.google.gwt.user.client.Element; import com.google.gwt.user.client.ui.TextBox; import com.vaadin.terminal.gwt.client.ApplicationConnection; @@ -341,10 +340,6 @@ public class VTextualDate extends VDateField implements Paintable, Field, @Override public void setWidth(String newWidth) { if (!"".equals(newWidth) && (width == null || !newWidth.equals(width))) { - if (BrowserInfo.get().isIE6()) { - // in IE6 cols ~ min-width - DOM.setElementProperty(text.getElement(), "size", "1"); - } needLayout = true; width = newWidth; super.setWidth(width); @@ -354,10 +349,6 @@ public class VTextualDate extends VDateField implements Paintable, Field, } } else { if ("".equals(newWidth) && width != null && !"".equals(width)) { - if (BrowserInfo.get().isIE6()) { - // revert IE6 hack - DOM.setElementProperty(text.getElement(), "size", ""); - } super.setWidth(""); needLayout = true; iLayout(); diff --git a/src/com/vaadin/terminal/gwt/client/ui/VTree.java b/src/com/vaadin/terminal/gwt/client/ui/VTree.java index f50b722d0c..e959038374 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VTree.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VTree.java @@ -279,13 +279,8 @@ public class VTree extends FocusElementPanel implements Paintable, continue; } childTree = new TreeNode(); - if (childTree.ie6compatnode != null) { - body.add(childTree); - } childTree.updateFromUIDL(childUidl, client); - if (childTree.ie6compatnode == null) { - body.add(childTree); - } + body.add(childTree); childTree.addStyleDependentName("root"); childTree.childNodeContainer.addStyleDependentName("root"); } @@ -582,19 +577,12 @@ public class VTree extends FocusElementPanel implements Paintable, private Icon icon; - private Element ie6compatnode; - private Event mouseDownEvent; private int cachedHeight = -1; private boolean focused = false; - /** - * Track onload events as IE6 sends two - */ - private boolean onloadHandled = false; - public TreeNode() { constructDom(); sinkEvents(Event.ONCLICK | Event.ONDBLCLICK | Event.MOUSEEVENTS @@ -692,11 +680,11 @@ public class VTree extends FocusElementPanel implements Paintable, // always when clicking an item, focus it setFocusedNode(this, false); - if (!isIE6OrOpera()) { + if (!BrowserInfo.get().isOpera()) { /* * Ensure that the tree's focus element also gains focus * (TreeNodes focus is faked using FocusElementPanel in browsers - * other than IE6 and Opera). + * other than Opera). */ focus(); } @@ -764,14 +752,7 @@ public class VTree extends FocusElementPanel implements Paintable, final Element target = DOM.eventGetTarget(event); if (type == Event.ONLOAD && target == icon.getElement()) { - if (onloadHandled) { - return; - } - if (BrowserInfo.get().isIE6()) { - fixWidth(); - } iconLoaded.trigger(); - onloadHandled = true; } if (disabled) { @@ -792,7 +773,7 @@ public class VTree extends FocusElementPanel implements Paintable, fireClick(event); } if (type == Event.ONCLICK) { - if (getElement() == target || ie6compatnode == target) { + if (getElement() == target) { // state change toggleState(); } else if (!readonly && inCaption) { @@ -878,7 +859,7 @@ public class VTree extends FocusElementPanel implements Paintable, * previously modified field may contain dirty variables. */ if (!treeHasFocus) { - if (isIE6OrOpera()) { + if (BrowserInfo.get().isOpera()) { if (focusedNode == null) { getNodeByKey(key).setFocused(true); } else { @@ -939,15 +920,6 @@ public class VTree extends FocusElementPanel implements Paintable, protected void constructDom() { addStyleName(CLASSNAME); - // workaround for a very weird IE6 issue #1245 - if (BrowserInfo.get().isIE6()) { - ie6compatnode = DOM.createDiv(); - setStyleName(ie6compatnode, CLASSNAME + "-ie6compatnode"); - DOM.setInnerText(ie6compatnode, " "); - DOM.appendChild(getElement(), ie6compatnode); - - DOM.sinkEvents(ie6compatnode, Event.ONCLICK); - } nodeCaptionDiv = DOM.createDiv(); DOM.setElementProperty(nodeCaptionDiv, "className", CLASSNAME @@ -959,7 +931,7 @@ public class VTree extends FocusElementPanel implements Paintable, DOM.appendChild(nodeCaptionDiv, wrapper); DOM.appendChild(wrapper, nodeCaptionSpan); - if (isIE6OrOpera()) { + if (BrowserInfo.get().isOpera()) { /* * Focus the caption div of the node to get keyboard navigation * to work without scrolling up or down when focusing a node. @@ -1023,7 +995,6 @@ public class VTree extends FocusElementPanel implements Paintable, if (uidl.hasAttribute("icon")) { if (icon == null) { - onloadHandled = false; icon = new Icon(client); DOM.insertBefore(DOM.getFirstChild(nodeCaptionDiv), icon.getElement(), nodeCaptionSpan); @@ -1036,10 +1007,6 @@ public class VTree extends FocusElementPanel implements Paintable, icon = null; } } - - if (BrowserInfo.get().isIE6() && isAttached()) { - fixWidth(); - } } public boolean isLeaf() { @@ -1103,13 +1070,8 @@ public class VTree extends FocusElementPanel implements Paintable, continue; } final TreeNode childTree = new TreeNode(); - if (ie6compatnode != null) { - childNodeContainer.add(childTree); - } childTree.updateFromUIDL(childUidl, client); - if (ie6compatnode == null) { - childNodeContainer.add(childTree); - } + childNodeContainer.add(childTree); if (!i.hasNext()) { childTree .addStyleDependentName(childTree.isLeaf() ? "leaf-last" @@ -1220,32 +1182,6 @@ public class VTree extends FocusElementPanel implements Paintable, } /* - * We need to fix the width of TreeNodes so that the float in - * ie6compatNode does not wrap (see ticket #1245) - */ - private void fixWidth() { - nodeCaptionDiv.getStyle().setProperty("styleFloat", "left"); - nodeCaptionDiv.getStyle().setProperty("display", "inline"); - nodeCaptionDiv.getStyle().setProperty("marginLeft", "0"); - final int captionWidth = ie6compatnode.getOffsetWidth() - + nodeCaptionDiv.getOffsetWidth(); - setWidth(captionWidth + "px"); - } - - /* - * (non-Javadoc) - * - * @see com.google.gwt.user.client.ui.Widget#onAttach() - */ - @Override - public void onAttach() { - super.onAttach(); - if (ie6compatnode != null) { - fixWidth(); - } - } - - /* * (non-Javadoc) * * @see com.google.gwt.user.client.ui.Widget#onDetach() @@ -1275,19 +1211,14 @@ public class VTree extends FocusElementPanel implements Paintable, public void setFocused(boolean focused) { if (!this.focused && focused) { nodeCaptionDiv.addClassName(CLASSNAME_FOCUSED); - if (BrowserInfo.get().isIE6()) { - ie6compatnode.addClassName(CLASSNAME_FOCUSED); - } + this.focused = focused; - if (isIE6OrOpera()) { + if (BrowserInfo.get().isOpera()) { nodeCaptionDiv.focus(); } treeHasFocus = true; } else if (this.focused && !focused) { nodeCaptionDiv.removeClassName(CLASSNAME_FOCUSED); - if (BrowserInfo.get().isIE6()) { - ie6compatnode.removeClassName(CLASSNAME_FOCUSED); - } this.focused = focused; treeHasFocus = false; } @@ -2174,7 +2105,7 @@ public class VTree extends FocusElementPanel implements Paintable, */ public Element getSubPartElement(String subPart) { if ("fe".equals(subPart)) { - if (isIE6OrOpera() && focusedNode != null) { + if (BrowserInfo.get().isOpera() && focusedNode != null) { return focusedNode.getElement(); } return getFocusElement(); @@ -2206,11 +2137,7 @@ public class VTree extends FocusElementPanel implements Paintable, } if (expandCollapse) { - if (treeNode.ie6compatnode != null) { - return treeNode.ie6compatnode; - } else { - return treeNode.getElement(); - } + return treeNode.getElement(); } else { return treeNode.nodeCaptionSpan; } @@ -2254,8 +2181,7 @@ public class VTree extends FocusElementPanel implements Paintable, return null; } - if (subElement == treeNode.getElement() - || subElement == treeNode.ie6compatnode) { + if (subElement == treeNode.getElement()) { // Targets expand/collapse arrow isExpandCollapse = true; } @@ -2316,8 +2242,4 @@ public class VTree extends FocusElementPanel implements Paintable, event.preventDefault(); } } - - private boolean isIE6OrOpera() { - return BrowserInfo.get().isIE6() || BrowserInfo.get().isOpera(); - } } diff --git a/src/com/vaadin/terminal/gwt/client/ui/VTreeTable.java b/src/com/vaadin/terminal/gwt/client/ui/VTreeTable.java index f7bd0b115d..8db320b1da 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VTreeTable.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VTreeTable.java @@ -164,7 +164,7 @@ public class VTreeTable extends VScrollTable { private boolean browserSupportsAnimation() { BrowserInfo bi = BrowserInfo.get(); - return !(bi.isIE6() || bi.isIE7() || bi.isSafari4()); + return !(bi.isIE7() || bi.isSafari4()); } class VTreeTableScrollBody extends VScrollTable.VScrollTableBody { diff --git a/src/com/vaadin/terminal/gwt/client/ui/VTwinColSelect.java b/src/com/vaadin/terminal/gwt/client/ui/VTwinColSelect.java index 1d02e50032..de2a903187 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VTwinColSelect.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VTwinColSelect.java @@ -27,7 +27,6 @@ import com.google.gwt.user.client.ui.HTML; import com.google.gwt.user.client.ui.ListBox;
import com.google.gwt.user.client.ui.Panel;
import com.vaadin.terminal.gwt.client.ApplicationConnection;
-import com.vaadin.terminal.gwt.client.BrowserInfo;
import com.vaadin.terminal.gwt.client.UIDL;
import com.vaadin.terminal.gwt.client.Util;
@@ -385,16 +384,7 @@ public class VTwinColSelect extends VOptionGroupBase implements KeyDownHandler, private void setInternalHeights() {
int captionHeight = 0;
- int totalHeight;
- if (BrowserInfo.get().isIE6()) {
- String o = getElement().getStyle().getOverflow();
-
- getElement().getStyle().setOverflow(Overflow.HIDDEN);
- totalHeight = getOffsetHeight();
- getElement().getStyle().setProperty("overflow", o);
- } else {
- totalHeight = getOffsetHeight();
- }
+ int totalHeight = getOffsetHeight();
if (optionsCaption != null) {
captionHeight = Util.getRequiredHeight(optionsCaption);
@@ -424,11 +414,6 @@ public class VTwinColSelect extends VOptionGroupBase implements KeyDownHandler, int bordersAndPaddings = Util.measureHorizontalPaddingAndBorder(
buttons.getElement(), 0);
- if (BrowserInfo.get().isIE6()) {
- // IE6 sets a border on selects by default..
- bordersAndPaddings += 4;
- }
-
int buttonWidth = Util.getRequiredWidth(buttons);
int totalWidth = getOffsetWidth();
diff --git a/src/com/vaadin/terminal/gwt/client/ui/VUpload.java b/src/com/vaadin/terminal/gwt/client/ui/VUpload.java index 25fd1d7604..77d7a7f762 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VUpload.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VUpload.java @@ -144,8 +144,6 @@ public class VUpload extends SimplePanel implements Paintable { private static native void setEncoding(Element form, String encoding) /*-{ form.enctype = encoding; - // For IE6 - form.encoding = encoding; }-*/; public void updateFromUIDL(UIDL uidl, ApplicationConnection client) { diff --git a/src/com/vaadin/terminal/gwt/client/ui/VUriFragmentUtility.java b/src/com/vaadin/terminal/gwt/client/ui/VUriFragmentUtility.java index 535ec16030..3da85e1b2b 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VUriFragmentUtility.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VUriFragmentUtility.java @@ -10,7 +10,6 @@ import com.google.gwt.event.shared.HandlerRegistration; import com.google.gwt.user.client.History; import com.google.gwt.user.client.ui.Widget; import com.vaadin.terminal.gwt.client.ApplicationConnection; -import com.vaadin.terminal.gwt.client.BrowserInfo; import com.vaadin.terminal.gwt.client.Paintable; import com.vaadin.terminal.gwt.client.UIDL; @@ -30,10 +29,6 @@ public class VUriFragmentUtility extends Widget implements Paintable, public VUriFragmentUtility() { setElement(Document.get().createDivElement()); - if (BrowserInfo.get().isIE6()) { - getElement().getStyle().setProperty("overflow", "hidden"); - getElement().getStyle().setProperty("height", "0"); - } } @Override diff --git a/src/com/vaadin/terminal/gwt/client/ui/VWindow.java b/src/com/vaadin/terminal/gwt/client/ui/VWindow.java index 8ffb0246a3..cec6bf4581 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VWindow.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VWindow.java @@ -593,19 +593,6 @@ public class VWindow extends VOverlay implements Container, DOM.setStyleAttribute(getElement(), "width", ""); - String oldHeaderWidth = ""; // Only for IE6 - if (BrowserInfo.get().isIE6()) { - /* - * For some reason IE6 has title DIV set to width 100% which - * interferes with the header measuring. Also IE6 has width set to - * the contentPanel. - */ - oldHeaderWidth = headerText.getStyle().getProperty("width"); - DOM.setStyleAttribute(contentPanel.getElement(), "width", "auto"); - DOM.setStyleAttribute(contentPanel.getElement(), "zoom", "1"); - headerText.getStyle().setProperty("width", "auto"); - } - // Content int contentWidth = contentPanel.getElement().getScrollWidth(); contentWidth += getContentAreaToRootDifference(); @@ -616,10 +603,6 @@ public class VWindow extends VOverlay implements Container, int naturalWidth = (contentWidth > windowCaptionWidth ? contentWidth : windowCaptionWidth); - if (BrowserInfo.get().isIE6()) { - headerText.getStyle().setProperty("width", oldHeaderWidth); - } - setWidth(naturalWidth + "px"); } @@ -1056,10 +1039,6 @@ public class VWindow extends VOverlay implements Container, // "width" now contains the new width in pixels - if (BrowserInfo.get().isIE6()) { - getElement().getStyle().setProperty("overflow", "hidden"); - } - // Apply the new pixel width getElement().getStyle().setProperty("width", width); @@ -1073,14 +1052,6 @@ public class VWindow extends VOverlay implements Container, DOM.setStyleAttribute(getElement(), "width", rootWidth + "px"); } - // IE6 needs the actual inner content width on the content element, - // otherwise it won't wrap the content properly (no scrollbars - // appear, content flows out of window) - if (BrowserInfo.get().isIE6()) { - DOM.setStyleAttribute(contentPanel.getElement(), "width", - contentAreaInnerWidth + "px"); - } - renderSpace.setWidth(contentAreaInnerWidth); updateShadowSizeAndPosition(); diff --git a/src/com/vaadin/ui/RichTextArea.java b/src/com/vaadin/ui/RichTextArea.java index d371e3c181..848e778755 100644 --- a/src/com/vaadin/ui/RichTextArea.java +++ b/src/com/vaadin/ui/RichTextArea.java @@ -129,6 +129,7 @@ public class RichTextArea extends AbstractField { public void setReadOnly(boolean readOnly) { super.setReadOnly(readOnly); // IE6 cannot support multi-classname selectors properly + // TODO Can be optimized now that support for I6 is dropped if (readOnly) { addStyleName("v-richtextarea-readonly"); } else { |