MCPcopy Create free account
hub / github.com/krasimir/react-in-patterns / getTextContentAccessor

Function getTextContentAccessor

code/new-context-api/public/app.js:2124–2131  ·  view source on GitHub ↗

* Gets the key used to access text content on a DOM node. * * @return {?string} Key used to access text content. * @internal

()

Source from the content-addressed store, hash-verified

2122 * @internal
2123 */
2124function getTextContentAccessor() {
2125 if (!contentKey && ExecutionEnvironment.canUseDOM) {
2126 // Prefer textContent to innerText because many browsers support both but
2127 // SVG <text> elements don't support innerText even when <div> does.
2128 contentKey = 'textContent' in document.documentElement ? 'textContent' : 'innerText';
2129 }
2130 return contentKey;
2131}
2132
2133/**
2134 * This helper object stores information about text content of a target node,

Callers 2

getTextFunction · 0.70
setOffsetsFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected