diff --git a/src/ol/dom.js b/src/ol/dom.js index 93b08c0fce..2d2a672bd9 100644 --- a/src/ol/dom.js +++ b/src/ol/dom.js @@ -28,7 +28,7 @@ ol.dom.createCanvasContext2D = function(opt_width, opt_height) { */ ol.dom.outerWidth = function(element) { var width = element.offsetWidth; - var style = element.currentStyle || getComputedStyle(element); + var style = getComputedStyle(element); width += parseInt(style.marginLeft, 10) + parseInt(style.marginRight, 10); return width; @@ -44,7 +44,7 @@ ol.dom.outerWidth = function(element) { */ ol.dom.outerHeight = function(element) { var height = element.offsetHeight; - var style = element.currentStyle || getComputedStyle(element); + var style = getComputedStyle(element); height += parseInt(style.marginTop, 10) + parseInt(style.marginBottom, 10); return height;