The goog.cssom.iframe.style Namespace

.getBackgroundContext(element)

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.

element {Element}
The element from which to copy background styles.
returns {Object}
Object containing background* properties.

.getElementContext(element, opt_forceRuleSetCacheUpdate, opt_copyBackgroundContext)

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.

element {Element}
The element for which context should be calculated.
opt_forceRuleSetCacheUpdate {boolean=}
Flag to force the internal cache of rulesets to refresh itself before we read the same.
opt_copyBackgroundContext {boolean=}
Flag indicating that if the {@code element} has a transparent background, background rules from the nearest ancestor element(s) that have background-color and/or background-image set should be copied.
returns {string}
String containing all CSS rules present in the original document, with modified selectors.
@see
goog.cssom.iframe.style.getBackgroundContext.

.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.