import com.google.gwt.dom.client.Style;
import com.google.gwt.dom.client.Style.Overflow;
import com.google.gwt.user.client.Timer;
-import com.google.gwt.user.client.ui.RootPanel;
import com.vaadin.client.MeasuredSize.MeasureResult;
import com.vaadin.client.ui.ManagedLayout;
import com.vaadin.client.ui.PostLayoutListener;
}
}
+ /**
+ * Called once per iteration in the layout loop before size calculations so
+ * different browsers quirks can be handled. Mainly this is currently for
+ * the IE8 permutation.
+ */
+ protected void performBrowserLayoutHacks() {
+ // Permutations implement this
+ }
+
private void doLayout() {
VConsole.log("Starting layout phase");
Duration passDuration = new Duration();
passes++;
- /*
- * Fixes IE8 issues where IE8 sometimes forgets to update the size
- * of the containing element. To force a reflow by modifying the
- * magical zoom property.
- */
- if (BrowserInfo.get().isIE8()) {
- int zoom = RootPanel.get().getElement().getPropertyInt("zoom");
- RootPanel.get().getElement().setPropertyInt("zoom", zoom);
- }
+ performBrowserLayoutHacks();
int measuredConnectorCount = measureConnectors(
currentDependencyTree, everythingNeedsMeasure);
}
}
+ /**
+ * Performs a hack to trigger a re-layout in the IE8. This is usually
+ * necessary in cases where IE8 "forgets" to update child elements when they
+ * resize.
+ *
+ * @param e
+ * The element to perform the hack on
+ */
+ public static final void forceIE8Redraw(Element e) {
+ if (BrowserInfo.get().isIE8()) {
+ setStyleTemporarily(e, "zoom", "1");
+ }
+ }
+
/**
* Detaches and re-attaches the element from its parent. The element is
* reattached at the same position in the DOM as it was before.
return a.getHref();
}
}
+
+
}
import com.vaadin.client.LayoutManager;
import com.vaadin.client.Paintable;
import com.vaadin.client.UIDL;
+import com.vaadin.client.Util;
import com.vaadin.client.ui.AbstractSingleComponentContainerConnector;
import com.vaadin.client.ui.ClickEventHandler;
import com.vaadin.client.ui.PostLayoutListener;
if (hasContent) {
Element layoutElement = content.getWidget().getElement();
Style childStyle = layoutElement.getStyle();
+
+ // IE8 needs some hackery to measure its content correctly
+ Util.forceIE8Redraw((com.google.gwt.user.client.Element) layoutElement);
+
if (content.isRelativeHeight() && !BrowserInfo.get().isIE9()) {
childStyle.setPosition(Position.ABSOLUTE);