Add CPCSSAnimationFeature to CPCompatibility constants

This commit is contained in:
cacaodev
2017-03-02 11:21:57 +01:00
parent 98105ad4dc
commit 1c86256f83
3 changed files with 8 additions and 7 deletions
+1 -1
View File
@@ -81,7 +81,7 @@ CPFileAPIFeature = 31;
CPAltEnterTextAreaFeature = 32;
CPCSSAnimationFeature = 33;
/*
When an absolutely positioned div (CPView) with an absolutely positioned canvas in it (CPView with drawRect:) moves things on top of the canvas (subviews) don't redraw correctly. E.g. if you have a bunch of text fields in a CPBox in a sheet which animates in, some of the text fields might not be visible because the CPBox has a canvas at the bottom and the box moved form offscreen to onscreen. This bug is probably very related: https://bugs.webkit.org/show_bug.cgi?id=67203
+1 -1
View File
@@ -80,7 +80,7 @@ var DEFAULT_CSS_PROPERTIES = nil,
var animation = [_target animationForKey:aKeyPath],
context = [CPAnimationContext currentContext];
if (!animation || ![animation isKindOfClass:[CAAnimation class]] || (![context duration] && ![animation duration]) || ![_CPObjectAnimator supportsCSSAnimations])
if (!animation || ![animation isKindOfClass:[CAAnimation class]] || (![context duration] && ![animation duration]) || !CPFeatureIsCompatible(CPCSSAnimationFeature))
{
if (fallback)
fallback();
+6 -5
View File
@@ -20,12 +20,13 @@ var _supportsCSSAnimations = null;
id <CPAnimatablePropertyContainer> _target;
}
+ (BOOL)supportsCSSAnimations
+ (BOOL)initialize
{
if (_supportsCSSAnimations === null)
_supportsCSSAnimations = CPBrowserCSSProperty("animation");
if ([self class] !== [_CPObjectAnimator class])
return;
return _supportsCSSAnimations;
var compat = (CPBrowserCSSProperty("animation") !== nil);
CPSetPlatformFeature(CPCSSAnimationFeature, compat);
}
- (id)initWithTarget:(id)aTarget
@@ -77,7 +78,7 @@ var _supportsCSSAnimations = null;
var animation = [_target animationForKey:aKeyPath],
context = [CPAnimationContext currentContext];
if (!animation || ![animation isKindOfClass:[CAAnimation class]] || (![context duration] && ![animation duration]) || ![_CPObjectAnimator supportsCSSAnimations])
if (!animation || ![animation isKindOfClass:[CAAnimation class]] || (![context duration] && ![animation duration]) || !CPFeatureIsCompatible(CPCSSAnimationFeature))
[_target setValue:aTargetValue forKey:aKeyPath];
else
{