MCPcopy Create free account
hub / github.com/reactjs/react-rails / getRootHostContext

Function getRootHostContext

lib/assets/react-source/development/react.js:11108–11141  ·  view source on GitHub ↗
(rootContainerInstance)

Source from the content-addressed store, hash-verified

11106 return false;
11107 }
11108 function getRootHostContext(rootContainerInstance) {
11109 var type;
11110 var namespace;
11111 var nodeType = rootContainerInstance.nodeType;
11112
11113 switch (nodeType) {
11114 case DOCUMENT_NODE:
11115 case DOCUMENT_FRAGMENT_NODE:
11116 {
11117 type = nodeType === DOCUMENT_NODE ? '#document' : '#fragment';
11118 var root = rootContainerInstance.documentElement;
11119 namespace = root ? root.namespaceURI : getChildNamespace(null, '');
11120 break;
11121 }
11122
11123 default:
11124 {
11125 var container = nodeType === COMMENT_NODE ? rootContainerInstance.parentNode : rootContainerInstance;
11126 var ownNamespace = container.namespaceURI || null;
11127 type = container.tagName;
11128 namespace = getChildNamespace(ownNamespace, type);
11129 break;
11130 }
11131 }
11132
11133 {
11134 var validatedTag = type.toLowerCase();
11135 var ancestorInfo = updatedAncestorInfo(null, validatedTag);
11136 return {
11137 namespace: namespace,
11138 ancestorInfo: ancestorInfo
11139 };
11140 }
11141 }
11142 function getChildHostContext(parentHostContext, type, rootContainerInstance) {
11143 {
11144 var parentHostContextDev = parentHostContext;

Callers 1

pushHostContainerFunction · 0.85

Calls 2

updatedAncestorInfoFunction · 0.85
getChildNamespaceFunction · 0.70

Tested by

no test coverage detected