Properly mark root shadow node as mounting to a View

Summary: RootFlatShadowNode always mounts to a (top-level) View but was never marked as one that mounts to a View. This diff fixes it. Nothing in the code relied on it being marked as mounting to a View, so it worked fine. A follow up path that implements UIImplementation.measure() for nodes that don't mount to a View goes up until it finds first mounting node, and it was crashing with NPE because it tried to access RootFlatShadowNode's parent (and there isn't one).

Reviewed By: sriramramani

Differential Revision: D2800818
This commit is contained in:
Denis Koroskin 2016-01-04 16:09:39 -08:00 committed by Ahmed El-Helw
parent 31d2443dd4
commit 3d6464d0e1
1 changed files with 5 additions and 0 deletions

View File

@ -14,6 +14,11 @@ package com.facebook.react.flat;
*/
/* package */ final class FlatRootShadowNode extends FlatShadowNode {
/* package */ FlatRootShadowNode() {
forceMountToView();
signalBackingViewIsCreated();
}
private boolean mIsUpdated;
/**