style.js
No description.

File Location

/goog/cssom/iframe/style.js

Classes

goog.cssom.iframe.style.CssRuleSet_
Class representing a CSS rule set. A rule set is something like this: h1, h2 { font-family: Arial; color: red; }
goog.cssom.iframe.style.CssSelectorPart_
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".
goog.cssom.iframe.style.CssSelector_
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])
goog.cssom.iframe.style.NodeAncestry_
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.

Public Protected Private

Global Functions

goog.cssom.iframe.style.getBackgroundContext(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.
Arguments:
element : Element
The element from which to copy background styles.
Returns: !Object  Object containing background* properties.
code »
goog.cssom.iframe.style.getBackgroundXYValues_(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.
Arguments:
styleObject : Object
Object from which to read style properties.
Returns: Array.<string>  The background-position values in the order [x, y].
code »
goog.cssom.iframe.style.getComputedStyleObject_(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.
Arguments:
element : Element
The element whose computed style to return.
Returns: Object  Object containing style properties and values.
code »
goog.cssom.iframe.style.getElementContext(elementopt_forceRuleSetCacheUpdateopt_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.
Arguments:
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 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.
code »
goog.cssom.iframe.style.ruleSetCache_.getRuleSetsForDocument(doc) !Array.<goog.cssom.iframe.style.CssRuleSet_>
Retrieves the array of css rulesets for this document. A cached version will be used when possible.
Arguments:
doc : Document
The document for which to get rulesets.
Returns: !Array.<goog.cssom.iframe.style.CssRuleSet_>  An array of CssRuleSet objects representing the css rule sets in the supplied document.
code »
goog.cssom.iframe.style.getRuleSetsFromDocument_(doc) !Array.<goog.cssom.iframe.style.CssRuleSet_>
Inspects a document and returns all active rule sets
Arguments:
doc : Document
The document from which to read CSS rules.
Returns: !Array.<goog.cssom.iframe.style.CssRuleSet_>  An array of CssRuleSet objects representing all the active rule sets in the document.
code »
goog.cssom.iframe.style.isTransparentValue_(colorValue) boolean
Tests whether a value is equivalent to 'transparent'.
Arguments:
colorValue : string
The value to test.
Returns: boolean  Whether the value is transparent.
code »
goog.cssom.iframe.style.ruleSetCache_.loadRuleSetsForDocument(doc)
Loads ruleset definitions from a document. If the cache already has rulesets for this document the cached version will be replaced.
Arguments:
doc : Document
The document from which to load rulesets.
code »
goog.cssom.iframe.style.makeColorRuleImportant_(cssText) string
Adds !important to a css color: rule
Arguments:
cssText : string
Text of the CSS rule(s) to modify.
Returns: string  Text with !important added to the color: rule if found.
code »
goog.cssom.iframe.style.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.
code »

Global Variables

ruleSetCache_ :
Cache of ruleset objects keyed by document unique ID.
Code »

Directory iframe

File Reference