[ASEnvironment - Layout] Fixes to upward propagation of ASLayoutable properties.

This commit is contained in:
Hannah Troisi
2016-04-02 15:03:43 -07:00
parent a817abd43f
commit dbad1c38e5
12 changed files with 54 additions and 67 deletions

View File

@@ -1702,10 +1702,6 @@ static NSInteger incrementIfFound(NSInteger i) {
[self exitHierarchyState:stateToEnterOrExit];
}
}
if ([newSupernode supportsUpwardPropagation]) {
ASEnvironmentStatePropagateUp(newSupernode, _environmentState.layoutOptionsState);
}
}
// Track that a node will be displayed as part of the current node hierarchy.
@@ -1860,7 +1856,7 @@ void recursivelyTriggerDisplayForLayer(CALayer *layer, BOOL shouldBlock)
ASDN::MutexLocker l(_propertyLock);
if (_methodOverrides & ASDisplayNodeMethodOverrideLayoutSpecThatFits) {
ASLayoutSpec *layoutSpec = [self layoutSpecThatFits:constrainedSize];
layoutSpec.parent = self;
layoutSpec.parent = self; // This causes upward propogation of any non-default layoutable values.
layoutSpec.isMutable = NO;
ASLayout *layout = [layoutSpec measureWithSizeRange:constrainedSize];
// Make sure layoutableObject of the root layout is `self`, so that the flattened layout will be structurally correct.