FIXED: Unknown function getPropertyCSSValue in Chrome

getPropertyCSSValue have been deprecated in chrome. Replacing with
getPropertyValue supported by all browsers.
This commit is contained in:
cacaodev
2016-04-23 10:54:22 +02:00
parent cd92ebd69c
commit 01c5cf98df
+8 -5
View File
@@ -680,17 +680,20 @@ var createUpdateFrame = function(aView, aKeyPath)
if (aKeyPath !== "frame" && aKeyPath !== "frameSize")
return nil;
var style = getComputedStyle(aView._DOMElement);
var style = getComputedStyle(aView._DOMElement),
getCSSPropertyValue = function(prop) {
return ROUND(parseFloat(style.getPropertyValue(prop)));
};
var updateFrame = function(timestamp)
{
var width = ROUND(style.getPropertyCSSValue('width').getFloatValue(CSSPrimitiveValue.CSS_PX)),
height = ROUND(style.getPropertyCSSValue('height').getFloatValue(CSSPrimitiveValue.CSS_PX));
var width = getCSSPropertyValue("width"),
height = getCSSPropertyValue("height");
if (aKeyPath == "frame")
{
var left = ROUND(style.getPropertyCSSValue('left').getFloatValue(CSSPrimitiveValue.CSS_PX)),
top = ROUND(style.getPropertyCSSValue('top').getFloatValue(CSSPrimitiveValue.CSS_PX)),
var left = getCSSPropertyValue("left"),
top = getCSSPropertyValue("top"),
frame = CGRectMake(left, top, width, height);
[aView setFrame:frame];