From 8ccef1e99fcaf21df72cf757f8dbfbe39e3d0f8d Mon Sep 17 00:00:00 2001 From: Scott Goodson Date: Mon, 11 Apr 2016 20:34:24 -0700 Subject: [PATCH] [ASEnvironment] Fix incomplete gating of upward propagation of layout properties (disabled for now). --- AsyncDisplayKit/ASDisplayNode.mm | 2 +- AsyncDisplayKit/Layout/ASLayoutSpec.mm | 2 +- AsyncDisplayKit/Layout/ASLayoutablePrivate.h | 3 +++ AsyncDisplayKit/Private/ASEnvironmentInternal.mm | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/AsyncDisplayKit/ASDisplayNode.mm b/AsyncDisplayKit/ASDisplayNode.mm index f7b246270b..cf4c820f2a 100644 --- a/AsyncDisplayKit/ASDisplayNode.mm +++ b/AsyncDisplayKit/ASDisplayNode.mm @@ -2695,7 +2695,7 @@ static const char *ASDisplayNodeDrawingPriorityKey = "ASDrawingPriority"; - (BOOL)supportsUpwardPropagation { - return YES; + return ASEnvironmentStatePropagationEnabled(); } ASEnvironmentLayoutOptionsForwarding diff --git a/AsyncDisplayKit/Layout/ASLayoutSpec.mm b/AsyncDisplayKit/Layout/ASLayoutSpec.mm index e523643f52..847b491e13 100644 --- a/AsyncDisplayKit/Layout/ASLayoutSpec.mm +++ b/AsyncDisplayKit/Layout/ASLayoutSpec.mm @@ -175,7 +175,7 @@ static NSString * const kDefaultChildrenKey = @"kDefaultChildrenKey"; // the specifications that are known to have more than one. - (BOOL)supportsUpwardPropagation { - return YES; + return ASEnvironmentStatePropagationEnabled(); } ASEnvironmentLayoutOptionsForwarding diff --git a/AsyncDisplayKit/Layout/ASLayoutablePrivate.h b/AsyncDisplayKit/Layout/ASLayoutablePrivate.h index ce2de20f6d..84ed0fe81d 100644 --- a/AsyncDisplayKit/Layout/ASLayoutablePrivate.h +++ b/AsyncDisplayKit/Layout/ASLayoutablePrivate.h @@ -79,6 +79,9 @@ extern void ASLayoutableClearCurrentContext(); #define ASEnvironmentLayoutOptionsForwarding \ - (void)propagateUpLayoutOptionsState\ {\ + if (!ASEnvironmentStatePropagationEnabled()) {\ + return;\ + }\ id parent = [self parent];\ if ([parent supportsUpwardPropagation]) {\ ASEnvironmentStatePropagateUp(parent, _environmentState.layoutOptionsState);\ diff --git a/AsyncDisplayKit/Private/ASEnvironmentInternal.mm b/AsyncDisplayKit/Private/ASEnvironmentInternal.mm index 08689548b2..83ea991b85 100644 --- a/AsyncDisplayKit/Private/ASEnvironmentInternal.mm +++ b/AsyncDisplayKit/Private/ASEnvironmentInternal.mm @@ -19,7 +19,7 @@ BOOL ASEnvironmentStatePropagationEnabled() { - return AS_SUPPORT_PROPAGATION; + return AS_SUPPORT_PROPAGATION; }