Home

# Library goog.cssom.iframe.style

Function Summary
| `CssRuleSet_()` Class representing a CSS rule set. A rule set is something like this: h1, h2 { font-family: Arial; color: red; }
| `CssSelectorPart_(string selectorPartString)` Represents one part of a CSS Selector. For example in the selector 'body #foo .bar', body, #foo, and .bar would be considered selector parts. In the official CSS spec these are called "simple selectors".

`CssSelector_(string= opt_selectorString)`

Represents a single CSS selector, as described in http://www.w3.org/TR/REC-CSS2/selector.html Currently UNSUPPORTED are the following selector features:

- pseudo-classes (:hover)
- child selectors (div > h1)
- adjacent sibling selectors (div + h1)
- attribute selectors (input[type=submit])

| `NodeAncestry_(?Element el)` Represents an element and all its parent/ancestor nodes. This class exists as an optimization so we run tests on an element hierarchy multiple times without walking the dom each time.

`getBackgroundContext(?Element element) ⇒ ?Object`

Generates a set of CSS properties that can be used to make another element's background look like the background of a given element. This is useful when you want to copy the CSS context of an element, but the element's background is transparent. In the original context you would see the ancestor's backround color/image showing through, but in the new context there might be a something different underneath. Note that this assumes the element you're copying context from has a fairly standard positioning/layout - it assumes that when the element has a transparent background what you're going to see through it is its ancestors.

| `getBackgroundXYValues_(?Object styleObject) ⇒ ?Array.<string>` Given an object containing a set of styles, returns a two-element array containing the values of background-position-x and background-position-y.
| `getComputedStyleObject_(?Element element) ⇒ ?Object` Returns an object containing the set of computedStyle/currentStyle values for the given element. Note that this should be used with caution as it ignores the fact that currentStyle and computedStyle are not the same for certain properties.

`getElementContext(?Element element, boolean= opt_forceRuleSetCacheUpdate, boolean= opt_copyBackgroundContext) ⇒ string`

Reads the current css rules from element's document, and returns them rewriting selectors so that any rules that formerly applied to element will be applied to doc.body. This makes it possible to replace a block in a page with an iframe and preserve the css styling of the contents.

| `getRuleSetsFromDocument_(?Document doc) ⇒ ?Array` Inspects a document and returns all active rule sets
| `isTransparentValue_(string colorValue) ⇒ boolean` Tests whether a value is equivalent to 'transparent'.
| `makeColorRuleImportant_(string cssText) ⇒ string` Adds !important to a css color: rule
| `resetDomCache()` Throw away all cached dom information. Call this if you've modified the structure or class/id attributes of your document and you want to recalculate the currently applied CSS rules.