debug.DevCss Extends
A class for solving development CSS issues/emulating the CSS Compiler.

Inheritance

Constructor

goog.debug.DevCss(opt_userAgentopt_userAgentVersion)

Parameters

opt_userAgent : goog.debug.DevCss.UserAgent=
The user agent, if not passed in, will be determined using goog.userAgent.
opt_userAgentVersion : number | string=
The user agent's version. If not passed in, will be determined using goog.userAgent.

Instance Methods

Public Protected Private
activateBrowserSpecificCssRules(opt_enableIe6ReadyHandler)
Rewrites the CSSOM as needed to activate any useragent-specific selectors.
Arguments:
opt_enableIe6ReadyHandler : boolean=
If true(the default), and the userAgent is ie6, we set a document "ready" event handler to walk the DOM and make combined selector className changes. Having this parameter also aids unit testing.
code »
addIe6CombinedClassNames_()
Adds combined selectors with underscores to make them "work" in IE6.
code »
generateUserAgentTokens_()
Generates user agent token match strings with comparison and version bits. For example: userAgentTokens_.ANY will be like 'GECKO' userAgentTokens_.LESS_THAN will be like 'GECKO-LT3' etc...
code »
getIe6CombinedSelectorText_(cssText) ?string
Gets the appropriate new combined selector text for IE6. Also adds an entry onto ie6CombinedMatches_ with relevant info for the likely following call to walk the DOM and rewrite the class attribute. Example: With a selector like ".class2 { -goog-ie6-selector: .class1.class2; prop: value }". this function will return: ".class1_class2 { prop: value }".
Arguments:
cssText : string
The CSS selector text and css rule text combined.
Returns: ?string  The rewritten css rule text.
code »
getRuleVersionAndCompare_(cssRuletoken) !Array | undefined
Extracts a rule version from the selector text, and if it finds one, calls compareVersions against it and the passed in token string to provide the value needed to determine if we have a match or not.
Arguments:
cssRule : CSSRule
The rule to test against.
token : string
The match token to test against the rule.
Returns: !Array | undefined  A tuple with the result of the compareVersions call and the matched ruleVersion.
code »
getVersionNumberFromSelectorText_(selectorTextuserAgentToken) string | undefined
Gets the version number bit from a selector matching userAgentToken.
Arguments:
selectorText : string
The selector text of a CSS rule.
userAgentToken : string
Includes the LTE/GTE bit to see if it matches.
Returns: string | undefined  The version number.
code »
replaceBrowserSpecificClassNames_(cssRule)
Replaces a CSS selector if we have matches based on our useragent/version. Example: With a selector like ".USERAGENT-IE-LTE6 .class { prop: value }" if we are running IE6 we'll end up with ".class { prop: value }", thereby "activating" the selector.
Arguments:
cssRule : CSSRule
The cssRule to potentially replace.
code »
replaceIe6CombinedSelectors_(cssRule)
Replaces IE6 combined selector rules with a workable development alternative. IE6 actually parses .class1.class2 {} to simply .class2 {} which is nasty. To fully support combined selectors in IE6 this function needs to be paired with a call to replace the relevant DOM elements classNames as well.
Arguments:
cssRule : CSSRule
The rule to potentially fix.
code »

Instance Properties

ie6CombinedMatches_ :
No description.
Code »
isIe6OrLess_ :
No description.
Code »
userAgentTokens_ :
No description.
Code »
userAgentVersion_ :
No description.
Code »
userAgent_ :
One of goog.debug.DevCss.UserAgent.
Code »

Enumerations

goog.debug.DevCss.CssToken_ :
A list of strings that may be used for matching in CSS files/development.
Constants:
GREATER_THAN
No description.
GREATER_THAN_OR_EQUAL
No description.
IE6_COMBINED_GLUE
No description.
IE6_SELECTOR_TEXT
No description.
LESS_THAN
No description.
LESS_THAN_OR_EQUAL
No description.
SEPARATOR
No description.
USERAGENT
No description.
Code »
goog.debug.DevCss.UserAgent :
A list of possible user agent strings.
Constants:
FIREFOX
No description.
GECKO
No description.
IE
No description.
MOBILE
No description.
OPERA
No description.
SAFARI
No description.
WEBKIT
No description.
Code »

Package debug

Package Reference