goog.html.sanitizer.CssSanitizer
Functions
inlineStyleRules( element ) → void
void
Converts rules in STYLE tags into style attributes on the tags they apply to. Modifies the provided DOM subtree in-place.
Parameters |
|
---|
safeParseHtmlAndGetInertElement( html ) → (Element|null)
(Element|null)
Returns an inert DOM tree produced by parsing the provided html using DOMParser. "Inert" here means that merely parsing the string won't execute scripts or load images. If you attach this tree to a non-inert document, it will execute these side effects! In this package we prefer using the TEMPLATE tag over DOMParser to produce inert trees, but at least on Chrome the inert STYLE tag does not have a CSSStyleSheet object attached to it.
Parameters |
| ||||
---|---|---|---|---|---|
Returns |
|
sanitizeInlineStyle( cssStyle, opt_uriRewriter ) → goog.html.SafeStyle
goog.html.SafeStyle
Sanitizes an inline style attribute. Short-hand attributes are expanded to their individual elements. Note: The sanitizer does not output vendor prefixed styles.
Parameters |
| ||||||||
---|---|---|---|---|---|---|---|---|---|
Returns |
|
sanitizeInlineStyleString( cssText, opt_uriRewriter ) → goog.html.SafeStyle
goog.html.SafeStyle
Sanitizes inline CSS text and returns it as a SafeStyle object. When adequate browser support is not available, such as for IE9 and below, a SafeStyle-wrapped empty string is returned.
Parameters |
| ||||||||
---|---|---|---|---|---|---|---|---|---|
Returns |
|
sanitizeStyleSheetString( textContent, opt_containerId, opt_uriRewriter ) → goog.html.SafeStyleSheet
goog.html.SafeStyleSheet
Sanitizes the contents of a STYLE tag.
Parameters |
| ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|