cssom

Classes


Public Protected Private

Enumerations

goog.cssom.CssRuleType :
Enumeration of CSSRule types.
Constants:
FONT_FACE
No description.
IMPORT
No description.
MEDIA
No description.
NAMESPACE
No description.
PAGE
No description.
STYLE
No description.
Code »

Global Functions

goog.cssom.addCssRule(cssStyleSheetcssTextopt_index)
Cross browser function to add a CSSRule into a CSSStyleSheet, optionally at a given index.
Arguments:
cssStyleSheet : CSSStyleSheet
The CSSRule's parentStyleSheet.
cssText : string
The text for the new CSSRule.
opt_index : number=
The index of the cssRule in its parentStylesheet.
code »
goog.cssom.addCssText(cssTextopt_domHelper) !Element
Appends a DOM node to HEAD containing the css text that's passed in.
Arguments:
cssText : string
CSS to add to the end of the document.
opt_domHelper : goog.dom.DomHelper=
Optional DOM helper user for document interactions.
Returns: !Element  The newly created STYLE element.
code »
goog.cssom.getAllCssStyleRules(opt_styleSheet) Array.<CSSStyleRule>
Recursively gets all CSSStyleRules, optionally starting from a given CSSStyleSheet. Note that this excludes any CSSImportRules, CSSMediaRules, etc..
Arguments:
opt_styleSheet : (CSSStyleSheet | StyleSheetList)=
The CSSStyleSheet.
Returns: Array.<CSSStyleRule>  A list of CSSStyleRules.
code »
goog.cssom.getAllCssStyleSheets(opt_styleSheetopt_includeDisabled) !Array.<CSSStyleSheet>
Gets all CSSStyleSheet objects starting from some CSSStyleSheet. Note that we want to return the sheets in the order of the cascade, therefore if we encounter an import, we will splice that CSSStyleSheet object in front of the CSSStyleSheet that contains it in the returned array of CSSStyleSheets.
Arguments:
opt_styleSheet : (CSSStyleSheet | StyleSheetList)=
A CSSStyleSheet.
opt_includeDisabled : boolean=
If true, includes disabled stylesheets, defaults to false.
Returns: !Array.<CSSStyleSheet>  A list of CSSStyleSheet objects.
code »
goog.cssom.getAllCssText(opt_styleSheet) string
Recursively gets all CSS as text, optionally starting from a given CSSStyleSheet.
Arguments:
opt_styleSheet : (CSSStyleSheet | StyleSheetList)=
The CSSStyleSheet.
Returns: string  css text.
code »
goog.cssom.getAllCss_(styleSheetisTextOutput) string | !Array.<CSSRule>
Recursively gets all CSS text or rules.
Arguments:
styleSheet : CSSStyleSheet | StyleSheetList
The CSSStyleSheet.
isTextOutput : boolean
If true, output is cssText, otherwise cssRules.
Returns: string | !Array.<CSSRule>  cssText or cssRules.
code »
goog.cssom.getCssRuleIndexInParentStyleSheet(cssRuleopt_parentStyleSheet) number
Get the index of the CSSRule in it's CSSStyleSheet.
Arguments:
cssRule : CSSRule
A CSSRule.
opt_parentStyleSheet : CSSStyleSheet=
A reference to the stylesheet object this cssRule belongs to.
Returns: number  The index of the CSSRule, or -1.
code »
goog.cssom.getCssRulesFromStyleSheet(styleSheet) CSSRuleList
Returns the CSSRules from a styleSheet. Worth noting here is that IE and FF differ in terms of what they will return. Firefox will return styleSheet.cssRules, which includes ImportRules and anything which implements the CSSRules interface. IE returns simply a list of CSSRules.
Arguments:
styleSheet : CSSStyleSheet
The CSSStyleSheet.
Returns: CSSRuleList  An array of CSSRules or null.
code »
goog.cssom.getCssTextFromCssRule(cssRule) string
Gets the cssText from a CSSRule object cross-browserly.
Arguments:
cssRule : CSSRule
A CSSRule.
Returns: string  cssText The text for the rule, including the selector.
code »
goog.cssom.getFileNameFromStyleSheet(styleSheet) ?string
Cross browser method to get the filename from the StyleSheet's href. Explorer only returns the filename in the href, while other agents return the full path.
Arguments:
styleSheet : !StyleSheet
Any valid StyleSheet object with an href.
Returns: ?string  filename The filename, or null if not an external styleSheet.
code »
goog.cssom.getParentStyleSheet(cssRule) CSSStyleSheet
We do some trickery in getAllCssStyleRules that hacks this in for IE. If the cssRule object isn't coming from a result of that function call, this method will return undefined in IE.
Arguments:
cssRule : CSSRule
The CSSRule.
Returns: CSSStyleSheet  A styleSheet object.
code »
goog.cssom.removeCssRule(cssStyleSheetindex)
Cross browser function to remove a CSSRule in a CSSStyleSheet at an index.
Arguments:
cssStyleSheet : CSSStyleSheet
The CSSRule's parentStyleSheet.
index : number
The CSSRule's index in the parentStyleSheet.
code »
goog.cssom.replaceCssRule(cssRulecssTextopt_parentStyleSheetopt_index)
Replace a cssRule with some cssText for a new rule. If the cssRule object is not one of objects returned by getAllCssStyleRules, then you'll need to provide both the styleSheet and possibly the index, since we can't infer them from the standard cssRule object in IE. We do some trickery in getAllCssStyleRules to hack this in.
Arguments:
cssRule : CSSRule
A CSSRule.
cssText : string
The text for the new CSSRule.
opt_parentStyleSheet : CSSStyleSheet=
A reference to the stylesheet object this cssRule belongs to.
opt_index : number=
The index of the cssRule in its parentStylesheet.
code »

Global Properties

goog.cssom.iframe :
No description.
Code »

Package cssom

Package Reference