MCPcopy Create free account
hub / github.com/docker/getting-started / _getComputedStyle

Function _getComputedStyle

app/src/static/js/react-bootstrap.js:7908–7937  ·  view source on GitHub ↗
(node)

Source from the content-addressed store, hash-verified

7906var rnumnonpx = /^([+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|))(?!px)[a-z%]+$/i;
7907
7908function _getComputedStyle(node) {
7909 if (!node) throw new TypeError('No Element passed to `getComputedStyle()`');
7910 var doc = node.ownerDocument;
7911 return 'defaultView' in doc ? doc.defaultView.opener ? node.ownerDocument.defaultView.getComputedStyle(node, null) : window.getComputedStyle(node, null) : {
7912 //ie 8 "magic" from: https://github.com/jquery/jquery/blob/1.11-stable/src/css/curCSS.js#L72
7913 getPropertyValue: function getPropertyValue(prop) {
7914 var style = node.style;
7915 prop = (0, _camelizeStyle.default)(prop);
7916 if (prop == 'float') prop = 'styleFloat';
7917 var current = node.currentStyle[prop] || null;
7918 if (current == null && style && style[prop]) current = style[prop];
7919
7920 if (rnumnonpx.test(current) && !rposition.test(prop)) {
7921 // Remember the original values
7922 var left = style.left;
7923 var runStyle = node.runtimeStyle;
7924 var rsLeft = runStyle && runStyle.left; // Put in the new values to get a computed value out
7925
7926 if (rsLeft) runStyle.left = node.currentStyle.left;
7927 style.left = prop === 'fontSize' ? '1em' : current;
7928 current = style.pixelLeft + 'px'; // Revert the changed values
7929
7930 style.left = left;
7931 if (rsLeft) runStyle.left = rsLeft;
7932 }
7933
7934 return current;
7935 }
7936 };
7937}
7938
7939module.exports = exports["default"];
7940

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…