Merge pull request #2444 from cacaodev/fixed-deprecated-getPropertyCSSValue

FIXED: in CPAnimationContext, 'Unknown function getPropertyCSSValue' error in chrome
This commit is contained in:
cacaodev committed 2016-04-24 13:24:12 +02:00
commit 57189183d6
1 file changed
+8 -5
+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];