/*
Gets the raw value from the style attribute. Useful for retrieving "used values" from the DOM:
https://developer.mozilla.org/en-US/docs/Web/CSS/used_value

Returns NONE if the property isn't set, or the value is an empty string.
330545
function (element, property) {
      var dom = element.dom();
      var raw = getUnsafeProperty(dom, property);

      return Option.from(raw).filter(function (r) { return r.length > 0; });
    }
545895
function(value) {
      
      if (value === "text") {
        value = this.text().trim();
        
      } else if (value === "html") {
        value = this.html().trim();
        
      } else if (value === "val") {
        value = this.val();
      
      } else if (value.indexOf("attr:") === 0) {
        value = this.attr(value.substr(5));
      }
      
      return value;
    }
1180405
function(id) {
            var el = YAHOO.util.Dom.get(id);
            return (el) ? el.style : null;
        }
473222
function getDefAttrVal(self, name) {
        var attrs = self.getAttrs(), attrConfig = ensureNonEmpty(attrs, name, 1), valFn = attrConfig.valueFn, val;
        if (valFn && (valFn = normalFn(self, valFn))) {
            val = valFn.call(self);
            if (val !== undefined) {
                attrConfig.value = val;
            }
            delete attrConfig.valueFn;
            attrs[name] = attrConfig;
        }
        return attrConfig.value;
    }
547410
function(attr) {
      var html;
      if (html = this._escapedAttributes[attr]) return html;
      var val = this.get(attr);
      return this._escapedAttributes[attr] = _.escape(val == null ? '' : '' + val);
    }
1115977
@Nullable
  private static RawTextNode getAttributeValue(
      HtmlTagNode tagNode, String name, ErrorReporter errorReporter) {
    HtmlAttributeNode attribute = tagNode.getDirectAttributeNamed(name);
    if (attribute == null) {
      return null;
    }
    RawTextNode value = getAttributeValue(attribute, name, errorReporter);
    // Remove it, we don't actually want to render it
    tagNode.removeChild(attribute);
    return value;
  }
308624
function(el, styleProperty){
            if(el.currentStyle){
                return el.currentStyle[styleProperty];
            }else if(window.getComputedStyle){
                var cssProperty = styleProperty.replace(/([A-Z])/g, "-$1").toLowerCase();
                var computedStyle = window.getComputedStyle(el, "");
                return computedStyle.getPropertyValue(cssProperty);
            }else{
                return "";
            }
        }
254992
static String getAttributeValue(Element element, String name) {
        Attr attribute = element.getAttributeNode(name);
        if (attribute == null) {
            return null;
        } else {
            return attribute.getValue();
        }
    }
79484
function getFormattedValue(value) {
            if (valueFormatter !== null) {
                return valueFormatter(value);
            }

            let chosenValueFormatter = formatDecimalValue;

            if (!value) {
                return 0;
            }
            if (numberFormat !== null) {
                chosenValueFormatter = d3Format.format(numberFormat);
            } else if (isInteger(value)) {
                chosenValueFormatter = formatIntegerValue;
            }

            return chosenValueFormatter(value);
        }
95571
function getCss(elem, attr) {
    const val = win.getComputedStyle(elem)[attr];

    // 对于属性值是 200px 这样的形式，返回 200 这样的数字值
    return regExp.styleValue.test(val) ? pInt(val) : val;
}
1107426
function(styles, val) {
                    var el;
                    var key;
                    var cptStyle;
                    var getCptStyle = window.getComputedStyle;
                    if(_type(styles) == TYPES.s) {
                        if(val === undefined) {
                            el = this[0];
                            cptStyle = getCptStyle ? getCptStyle(el, null) : el.currentStyle[styles];

                            //https://bugzilla.mozilla.org/show_bug.cgi?id=548397 can be null sometimes if iframe with display: none (firefox only!)
                            return getCptStyle ? cptStyle != null ? cptStyle.getPropertyValue(styles) : el[LEXICON.s][styles] : cptStyle;
                        }
                        else {
                            return this.each(function() {
                                setCSSVal(this, styles, val);
                            });
                        }
                    }
                    else {
                        return this.each(function() {
                            for(key in styles)
                                setCSSVal(this, key, styles[key]);
                        });
                    }
                }
581974
function (element, style) {
			var styleString = '';

			for (var key in style) {
				styleString += key + ': ' + style[key] + ';';
			}

			element.setAttribute('style', styleString);

			return element;
		}
236940
function getStyle(el, prop) {
    return window.getComputedStyle !== undefined ? window.getComputedStyle(el, null).getPropertyValue(prop) : el.currentStyle[prop];
  }
778345
@Nullable
  private static RawTextNode getAttributeValue(
      HtmlAttributeNode htmlAttributeNode, String name, ErrorReporter errorReporter) {
    StandaloneNode valueNode = htmlAttributeNode.getChild(1);
    if (valueNode instanceof HtmlAttributeValueNode) {
      HtmlAttributeValueNode attributeValueNode = (HtmlAttributeValueNode) valueNode;
      if (attributeValueNode.numChildren() == 1
          && attributeValueNode.getChild(0) instanceof RawTextNode) {
        return (RawTextNode) attributeValueNode.getChild(0);
      }
    }
    errorReporter.report(valueNode.getSourceLocation(), INVALID_ATTRIBUTE, name);
    return null;
  }
1273647
function ( propStr ) {
            if ( window.getComputedStyle ) {
                this.css = function ( propStr ) {
                    var el = this.element();
    
                    //setter
                    if ( propStr && propStr.indexOf(':') > -1 ) {
                        $B.style.inline( el, propStr );
                        //getter
                    } else {
                        return $B.style.current( el, propStr );
                    }
                };
    
                //IE6~8
            } else if ( document.documentElement.currentStyle ) {
                this.css = function ( propStr ) {
                    var el = this.element();
    
                    //setter
                    if ( propStr && propStr.indexOf(':') > -1 ) {
                        //opacity
                        if ( propStr.indexOf('opacity') > -1 ) {
                            $B.style.opacity( el, $B.style.parse( propStr ).opacity.value );
                        } else {
                            $B.style.inline( el, propStr );
                        }
    
                        //getter
                    } else {
                        return ( propStr && propStr.indexOf('opacity') > -1 )? $B.style.opacity( el ) : $B.style.computed( el, propStr );
                    }
                };
            }
    
            return this.css( propStr );
        }
527649
function resolveAttributeValue(value, part) {
  if (isDirective(value)) {
    value = resolveDirectiveValue(value, part);
  }

  if (value === nothingString) {
    return value;
  }

  if (isTemplateResult(value)) {
    value = value.read();
  }

  if (isPrimitive(value)) {
    const string = typeof value !== 'string' ? String(value) : value;
    // Escape if not prefixed with unsafePrefixString, otherwise strip prefix
    return Buffer.from(
      string.indexOf(unsafePrefixString) === 0 ? string.slice(33) : escapeHTML(string)
    );
  } else if (Buffer.isBuffer(value)) {
    return value;
  } else if (isPromise(value)) {
    return value.then((value) => resolveAttributeValue(value, part));
  } else if (isSyncIterator(value)) {
    if (!Array.isArray(value)) {
      value = Array.from(value);
    }
    return Buffer.concat(
      value.reduce((values, value) => {
        value = resolveAttributeValue(value, part);
        // Flatten
        if (Array.isArray(value)) {
          return values.concat(value);
        }
        values.push(value);
        return values;
      }, [])
    );
  } else {
    throw Error('unknown AttributPart value', value);
  }
}
612677
function getFormattedValues (formatString, rawValues) {
      var formattedValueString = formatString;
      var rawValuesLength = rawValues.length;

      for (var i = 0; i < rawValuesLength; i++) {
        formattedValueString = formattedValueString.replace(
          VALUE_PLACEHOLDER, +rawValues[i].toFixed(4));
      }

      return formattedValueString;
    }