Summary: fillCSSNode was only ever used in RCTShadowView to set the child count which is already performed in insert/remove subview calls and in RCTShadowText is was used to set the measure function which can be done in the initializer instead.

Reviewed By: majak, javache

Differential Revision: D3586418

fbshipit-source-id: de2155daf0f1702c8977bf23183a3b6a650d016b
This commit is contained in:
Emil Sjolander 2016-07-20 02:49:09 -07:00 коммит произвёл Facebook Github Bot 7
Родитель 702c14bdf2
Коммит 102577565a
4 изменённых файлов: 1 добавлений и 17 удалений

Просмотреть файл

@ -61,6 +61,7 @@ static css_dim_t RCTMeasure(void *context, float width, css_measure_mode_t width
_cachedTextStorageWidth = -1;
_cachedTextStorageWidthMode = -1;
_fontSizeMultiplier = 1.0;
self.cssNode->measure = RCTMeasure;
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(contentSizeMultiplierDidChange:)
name:RCTUIManagerWillUpdateViewsDueToContentSizeMultiplierChangeNotification
@ -442,13 +443,6 @@ static css_dim_t RCTMeasure(void *context, float width, css_measure_mode_t width
}
}
- (void)fillCSSNode:(css_node_t *)node
{
[super fillCSSNode:node];
node->measure = RCTMeasure;
node->children_count = 0;
}
- (void)insertReactSubview:(RCTShadowView *)subview atIndex:(NSInteger)atIndex
{
[super insertReactSubview:subview atIndex:atIndex];

Просмотреть файл

@ -49,7 +49,6 @@
{
[self applySizeConstraints];
[self fillCSSNode:self.cssNode];
layoutNode(self.cssNode, CSS_UNDEFINED, CSS_UNDEFINED, CSS_DIRECTION_INHERIT);
NSMutableSet<RCTShadowView *> *viewsWithNewFrame = [NSMutableSet set];

Просмотреть файл

@ -186,7 +186,6 @@ typedef void (^RCTApplierBlock)(NSDictionary<NSNumber *, UIView *> *viewRegistry
/**
* The following are implementation details exposed to subclasses. Do not call them directly
*/
- (void)fillCSSNode:(css_node_t *)node NS_REQUIRES_SUPER;
- (void)dirtyLayout NS_REQUIRES_SUPER;
- (BOOL)isLayoutDirty;

Просмотреть файл

@ -89,11 +89,6 @@ static void RCTProcessMetaProps(const float metaProps[META_PROP_COUNT], float st
: 0;
}
- (void)fillCSSNode:(css_node_t *)node
{
node->children_count = (int)_reactSubviews.count;
}
// The absolute stuff is so that we can take into account our absolute position when rounding in order to
// snap to the pixel grid. For example, say you have the following structure:
//
@ -253,7 +248,6 @@ static void RCTProcessMetaProps(const float metaProps[META_PROP_COUNT], float st
_layoutLifecycle = RCTUpdateLifecycleDirtied;
}
[self fillCSSNode:_cssNode];
layoutNode(_cssNode, frame.size.width, frame.size.height, CSS_DIRECTION_INHERIT);
[self applyLayoutNode:_cssNode viewsWithNewFrame:viewsWithNewFrame absolutePosition:absolutePosition];
}
@ -299,7 +293,6 @@ static void RCTProcessMetaProps(const float metaProps[META_PROP_COUNT], float st
_cssNode->print = RCTPrint;
_cssNode->get_child = RCTGetChild;
_cssNode->is_dirty = RCTIsDirty;
[self fillCSSNode:_cssNode];
}
return self;
}
@ -637,7 +630,6 @@ RCT_STYLE_PROPERTY(FlexWrap, flexWrap, flex_wrap, css_wrap_type_t)
if (_recomputePadding || _recomputeMargin || _recomputeBorder) {
[self dirtyLayout];
}
[self fillCSSNode:_cssNode];
_recomputeMargin = NO;
_recomputePadding = NO;
_recomputeBorder = NO;