Only mark Nodes dirty if an actual node is removed.

Reviewed By: gkassabli

Differential Revision: D4125453

fbshipit-source-id: 745cfc55269415fea106a80c72401eb3074f2d31
This commit is contained in:
Dustin Shahidehpour 2016-11-03 13:30:34 -07:00 committed by Facebook Github Bot
parent 0e078d16ae
commit 07fb9040d9
1 changed files with 4 additions and 3 deletions

View File

@ -263,10 +263,11 @@ void CSSNodeInsertChild(const CSSNodeRef node, const CSSNodeRef child, const uin
}
void CSSNodeRemoveChild(const CSSNodeRef node, const CSSNodeRef child) {
CSSNodeListDelete(node->children, child);
if (CSSNodeListDelete(node->children, child) != NULL) {
child->parent = NULL;
_CSSNodeMarkDirty(node);
}
}
CSSNodeRef CSSNodeGetChild(const CSSNodeRef node, const uint32_t index) {
return CSSNodeListGet(node->children, index);