From 9f5a6f88cd0d31f157b12df85bac59763f465b37 Mon Sep 17 00:00:00 2001 From: Matti Tahvonen Date: Thu, 14 May 2009 10:44:19 +0000 Subject: [PATCH] fixed IE6 bugs with both ends relative svn changeset:7794/svn branch:6.0 --- .../gwt/client/ui/VAbsoluteLayout.java | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/com/vaadin/terminal/gwt/client/ui/VAbsoluteLayout.java b/src/com/vaadin/terminal/gwt/client/ui/VAbsoluteLayout.java index c808494c1d..5094286bc7 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VAbsoluteLayout.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VAbsoluteLayout.java @@ -302,7 +302,7 @@ public class VAbsoluteLayout extends ComplexPanel implements Container { } // ensure ne values Style style = getElement().getStyle(); - style.setProperty("zIndex", zIndex); + // style.setProperty("zIndex", zIndex); style.setProperty("top", top); style.setProperty("left", left); style.setProperty("right", right); @@ -331,7 +331,7 @@ public class VAbsoluteLayout extends ComplexPanel implements Container { Style style = getElement().getStyle(); if (bottom != null && top != null) { // define height for wrapper to simulate bottom property - int bottompixels = measureForIE6(bottom); + int bottompixels = measureForIE6(bottom, true); ApplicationConnection.getConsole().log("ALB" + bottompixels); int height = canvas.getOffsetHeight() - bottompixels - getElement().getOffsetTop(); @@ -346,10 +346,10 @@ public class VAbsoluteLayout extends ComplexPanel implements Container { } if (left != null && right != null) { // define width for wrapper to simulate right property - int rightPixels = measureForIE6(right); + int rightPixels = measureForIE6(right, false); ApplicationConnection.getConsole().log("ALR" + rightPixels); int width = canvas.getOffsetWidth() - rightPixels - - getElement().getOffsetWidth(); + - getElement().getOffsetLeft(); ApplicationConnection.getConsole().log("ALR" + width); if (width < 0) { width = 0; @@ -365,14 +365,19 @@ public class VAbsoluteLayout extends ComplexPanel implements Container { private Element measureElement; - private int measureForIE6(String cssLength) { + private int measureForIE6(String cssLength, boolean vertical) { if (measureElement == null) { measureElement = DOM.createDiv(); measureElement.getStyle().setProperty("position", "absolute"); canvas.appendChild(measureElement); } - measureElement.getStyle().setProperty("width", cssLength); - return measureElement.getOffsetWidth(); + if (vertical) { + measureElement.getStyle().setProperty("height", cssLength); + return measureElement.getOffsetHeight(); + } else { + measureElement.getStyle().setProperty("width", cssLength); + return measureElement.getOffsetWidth(); + } } } -- 2.39.5