Home

# Class goog.debug.DevCss

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

Instance Method Summary
| `activateBrowserSpecificCssRules(boolean= opt_enableIe6ReadyHandler)` Rewrites the CSSOM as needed to activate any useragent-specific selectors.
| `addIe6CombinedClassNames_()` Adds combined selectors with underscores to make them "work" in IE6.
| `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...

`getIe6CombinedSelectorText_(string 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 }".

| `getRuleVersionAndCompare_(?CSSRule cssRule, string token) ⇒ (Array|null|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.
| `getVersionNumberFromSelectorText_(string selectorText, string userAgentToken) ⇒ (string|undefined)` Gets the version number bit from a selector matching userAgentToken.
| `replaceBrowserSpecificClassNames_(?CSSRule 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.
| `replaceIe6CombinedSelectors_(?CSSRule 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.