getComputedStyle method

CssStyleDeclaration getComputedStyle ([String pseudoElement ])

The set of all CSS values applied to this element, including inherited and default values.

The computedStyle contains values that are inherited from other sources, such as parent elements or stylesheets. This differs from the style property, which contains only the values specified directly on this element.

PseudoElement can be values such as ::after, ::before, ::marker, ::line-marker.

See also:


CssStyleDeclaration getComputedStyle([String pseudoElement]) {
  if (pseudoElement == null) {
    pseudoElement = '';
  // TODO(jacobr): last param should be null, see b/5045788
  return window._getComputedStyle(this, pseudoElement);