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

Function getTextContentAccessor

code/redux/public/app.js:3014–3021  ·  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

3012 * @internal
3013 */
3014function getTextContentAccessor() {
3015 if (!contentKey && ExecutionEnvironment.canUseDOM) {
3016 // Prefer textContent to innerText because many browsers support both but
3017 // SVG <text> elements don't support innerText even when <div> does.
3018 contentKey = 'textContent' in document.documentElement ? 'textContent' : 'innerText';
3019 }
3020 return contentKey;
3021}
3022
3023/**
3024 * 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