Skip to content

Commit 8322643

Browse files
NickGerlemanfacebook-github-bot
authored andcommitted
Remove ShadowNodeTraits::Trait::DirtyYogaNode (#51645)
Summary: Pull Request resolved: #51645 It's dead, Jim Changelog: [Internal] Reviewed By: lenaic Differential Revision: D75324251 fbshipit-source-id: 869e81f0ae0064629ddd84b939a1e492e6646365
1 parent 2a13d20 commit 8322643

File tree

2 files changed

+10
-18
lines changed

2 files changed

+10
-18
lines changed

packages/react-native/ReactCommon/react/renderer/components/view/YogaLayoutableShadowNode.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,7 @@ YogaLayoutableShadowNode::YogaLayoutableShadowNode(
135135
// This is the only legit place where we can dirty cloned Yoga node.
136136
// If we do it later, ancestor nodes will not be able to observe this and
137137
// dirty (and clone) themselves as a result.
138-
if (getTraits().check(ShadowNodeTraits::Trait::DirtyYogaNode) ||
139-
getTraits().check(ShadowNodeTraits::Trait::MeasurableYogaNode)) {
138+
if (getTraits().check(ShadowNodeTraits::Trait::MeasurableYogaNode)) {
140139
yogaNode_.setDirty(true);
141140
}
142141

packages/react-native/ReactCommon/react/renderer/core/ShadowNodeTraits.h

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -41,46 +41,39 @@ class ShadowNodeTraits {
4141
// Nodes with this trait (and all their descendants) will not produce views.
4242
Hidden = 1 << 2,
4343

44-
// Indicates that the `YogaLayoutableShadowNode` must set `isDirty` flag for
45-
// Yoga node when a `ShadowNode` is being cloned. `ShadowNode`s that modify
46-
// Yoga styles in the constructor (or later) *after* the `ShadowNode`
47-
// is cloned must set this trait.
48-
// Any Yoga node (not only Leaf ones) can have this trait.
49-
DirtyYogaNode = 1 << 3,
50-
5144
// Inherits `YogaLayoutableShadowNode` and enforces that the yoga node is a
5245
// leaf.
53-
LeafYogaNode = 1 << 4,
46+
LeafYogaNode = 1 << 3,
5447

5548
// Inherits `YogaLayoutableShadowNode` and has a custom measure function.
5649
// Only Leaf nodes can have this trait.
57-
MeasurableYogaNode = 1 << 5,
50+
MeasurableYogaNode = 1 << 4,
5851

5952
// Indicates that the `ShadowNode` must form a stacking context.
6053
// A Stacking Context forms a level of a `ShadowView` hierarchy (in contrast
6154
// with a level of a `ShadowNode` hierarchy).
6255
// See W3C standard for more details: https://www.w3.org/TR/CSS2/zindex.html
63-
FormsStackingContext = 1 << 6,
56+
FormsStackingContext = 1 << 5,
6457

6558
// Indicates that the node must form a `ShadowView`.
66-
FormsView = 1 << 7,
59+
FormsView = 1 << 6,
6760

6861
// Internal to `ShadowNode`; do not use it outside.
6962
// Indicates that `children` list is shared between nodes and need
7063
// to be cloned before the first mutation.
71-
ChildrenAreShared = 1 << 8,
64+
ChildrenAreShared = 1 << 7,
7265

7366
// Indicates that direct children of the node should not be collapsed
74-
ChildrenFormStackingContext = 1 << 9,
67+
ChildrenFormStackingContext = 1 << 8,
7568

7669
// Inherits `YogaLayoutableShadowNode` and has a custom baseline function.
77-
BaselineYogaNode = 1 << 10,
70+
BaselineYogaNode = 1 << 9,
7871

7972
// Forces the node not to form a host view.
80-
ForceFlattenView = 1 << 11,
73+
ForceFlattenView = 1 << 10,
8174

8275
// Indicates if the node is keyboard focusable.
83-
KeyboardFocusable = 1 << 12,
76+
KeyboardFocusable = 1 << 11,
8477
};
8578

8679
/*

0 commit comments

Comments
 (0)