mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Back out "Add fabric implementation to find Top-Most relative and relevant parent of a child view"
Summary: Original commit changeset: 7b91ea695e23 Original Phabricator Diff: D72178408 Changelog: [Internal] Differential Revision: D73103168 fbshipit-source-id: 91a469dd74f8941f3295ff594f47c8fd3ae70184
This commit is contained in:
committed by
Facebook GitHub Bot
parent
513ff5307c
commit
1d5324cba9
-2
@@ -57,8 +57,6 @@ internal class FabricUIManagerBinding : HybridClassBase() {
|
||||
|
||||
external fun findNextFocusableElement(parentTag: Int, focusedTag: Int, direction: Int): Int
|
||||
|
||||
external fun findRelativeTopMostParent(rootTag: Int, childTag: Int): Int
|
||||
|
||||
external fun stopSurface(surfaceId: Int)
|
||||
|
||||
external fun stopSurfaceWithSurfaceHandler(surfaceHandler: SurfaceHandlerBinding)
|
||||
|
||||
-37
@@ -244,40 +244,6 @@ jint FabricUIManagerBinding::findNextFocusableElement(
|
||||
return nextNode->getTag();
|
||||
}
|
||||
|
||||
jint FabricUIManagerBinding::findRelativeTopMostParent(
|
||||
jint rootTag,
|
||||
jint childTag) {
|
||||
std::shared_ptr<UIManager> uimanager = getScheduler()->getUIManager();
|
||||
|
||||
ShadowNode::Shared childShadowNode =
|
||||
uimanager->findShadowNodeByTag_DEPRECATED(childTag);
|
||||
ShadowNode::Shared rootShadowNode =
|
||||
uimanager->findShadowNodeByTag_DEPRECATED(rootTag);
|
||||
|
||||
if (childShadowNode == nullptr || rootShadowNode == nullptr) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
ShadowNode::AncestorList ancestorList =
|
||||
childShadowNode->getFamily().getAncestors(*rootShadowNode);
|
||||
|
||||
if (ancestorList.empty() || ancestorList.size() < 2) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
// ignore the first ancestor as it is the rootShadowNode itself
|
||||
for (auto it = std::next(ancestorList.begin()); it != ancestorList.end();
|
||||
++it) {
|
||||
auto& ancestor = *it;
|
||||
if (ancestor.first.get().getTraits().check(
|
||||
ShadowNodeTraits::Trait::FormsStackingContext)) {
|
||||
return ancestor.first.get().getTag();
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Used by non-bridgeless+Fabric
|
||||
void FabricUIManagerBinding::startSurfaceWithConstraints(
|
||||
jint surfaceId,
|
||||
@@ -753,9 +719,6 @@ void FabricUIManagerBinding::registerNatives() {
|
||||
makeNativeMethod(
|
||||
"findNextFocusableElement",
|
||||
FabricUIManagerBinding::findNextFocusableElement),
|
||||
makeNativeMethod(
|
||||
"findRelativeTopMostParent",
|
||||
FabricUIManagerBinding::findRelativeTopMostParent),
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -135,8 +135,6 @@ class FabricUIManagerBinding : public jni::HybridClass<FabricUIManagerBinding>,
|
||||
jint
|
||||
findNextFocusableElement(jint parentTag, jint focusedTag, jint direction);
|
||||
|
||||
jint findRelativeTopMostParent(jint rootTag, jint childTag);
|
||||
|
||||
void uninstallFabricUIManager();
|
||||
|
||||
// Private member variables
|
||||
|
||||
Reference in New Issue
Block a user