Do not measure the view if it is hidden.

Summary: If views are hidden on screen, we don't want to bother including them in layout calculations.

Reviewed By: rnystrom

Differential Revision: D4022992

fbshipit-source-id: 2e93eb911f26223f305ef7ce788f86d050b83e4a
This commit is contained in:
Dustin Shahidehpour
2016-10-14 14:22:49 -07:00
committed by Facebook Github Bot
parent 89440f630f
commit 05ba3a2565
2 changed files with 23 additions and 2 deletions

View File

@@ -226,6 +226,10 @@ static void _updateFrameRecursive(UIView *view);
@end
static void _attachNodesRecursive(UIView *view) {
if (view.isHidden) {
return;
}
CSSNodeRef node = [view cssNode];
const BOOL usesFlexbox = [view css_usesFlexbox];
const BOOL isLeaf = !usesFlexbox || view.subviews.count == 0;
@@ -258,6 +262,10 @@ static void _attachNodesRecursive(UIView *view) {
}
static void _updateFrameRecursive(UIView *view) {
if (view.isHidden) {
return;
}
CSSNodeRef node = [view cssNode];
const BOOL usesFlexbox = [view css_usesFlexbox];
const BOOL isLeaf = !usesFlexbox || view.subviews.count == 0;