[ASLayoutSpec] Remove cached ASTraitCollection

This commit is contained in:
ricky
2016-06-07 10:50:42 -07:00
parent cb67671f1d
commit 3c34d51a19
3 changed files with 4 additions and 13 deletions

View File

@@ -1901,7 +1901,10 @@ void recursivelyTriggerDisplayForLayer(CALayer *layer, BOOL shouldBlock)
if ((_methodOverrides & ASDisplayNodeMethodOverrideLayoutSpecThatFits) || _layoutSpecBlock != NULL) {
ASLayoutSpec *layoutSpec = [self layoutSpecThatFits:constrainedSize];
layoutSpec.parent = self; // This causes upward propogation of any non-default layoutable values.
layoutSpec.traitCollection = self.asyncTraitCollection;
// manually propagate the trait collection here so that any layoutSpec children of layoutSpec will get a traitCollection
ASEnvironmentStatePropagateDown(layoutSpec, self.environmentTraitCollection);
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.