Browse Source

Added fallbacks for when IE10 reports width/height as 'auto' when getting the ComputedStyle #11308

Change-Id: I5cdf98feb8f5f92edeb253b259c354211bd5e369
tags/7.1.0.beta1
John Ahlroos 11 years ago
parent
commit
28aa793d8e
1 changed files with 8 additions and 0 deletions
  1. 8
    0
      client/src/com/vaadin/client/Util.java

+ 8
- 0
client/src/com/vaadin/client/Util.java View File

@@ -630,6 +630,10 @@ public class Util {
/*-{
var cs = element.ownerDocument.defaultView.getComputedStyle(element);
var heightPx = cs.height;
if(heightPx == 'auto'){
// Fallback for when IE reports auto
heightPx = @com.vaadin.client.Util::getRequiredHeightBoundingClientRect(Lcom/google/gwt/dom/client/Element;)(element) + 'px';
}
var borderTopPx = cs.borderTop;
var borderBottomPx = cs.borderBottom;
var paddingTopPx = cs.paddingTop;
@@ -646,6 +650,10 @@ public class Util {
/*-{
var cs = element.ownerDocument.defaultView.getComputedStyle(element);
var widthPx = cs.width;
if(widthPx == 'auto'){
// Fallback for when IE reports auto
widthPx = @com.vaadin.client.Util::getRequiredWidthBoundingClientRect(Lcom/google/gwt/dom/client/Element;)(element) + 'px';
}
var borderLeftPx = cs.borderLeft;
var borderRightPx = cs.borderRight;
var paddingLeftPx = cs.paddingLeft;

Loading…
Cancel
Save