Skip to content

Commit

Permalink
Add sanitizeDOMValue to settings.html
Browse files Browse the repository at this point in the history
Fixes #4753
  • Loading branch information
justinfagnani committed Jul 25, 2017
1 parent ffcd985 commit 4d730e1
Showing 1 changed file with 33 additions and 1 deletion.
34 changes: 33 additions & 1 deletion lib/utils/settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,37 @@
Polymer.setRootPath = function(path) {
Polymer.rootPath = path;
}

/**
* A global callback used to sanitize any value before inserting it into the DOM. The callback signature is:
*
* Polymer = {
* sanitizeDOMValue: function(value, name, type, node) { ... }
* }
*
* Where:
*
* `value` is the value to sanitize.
* `name` is the name of an attribute or property (for example, href).
* `type` indicates where the value is being inserted: one of property, attribute, or text.
* `node` is the node where the value is being inserted.
*
* @type {(function(*,string,string,Node):*)|undefined}
* @memberof Polymer
*/
let sanitizeDOMValue = Polymer.sanitizeDOMValue;

// This is needed for tooling
Polymer.sanitizeDOMValue = sanitizeDOMValue;

/**
* Sets the global sanitizeDOMValue available via `Polymer.sanitizeDOMValue`.
*
* @memberof Polymer
* @param {(function(*,string,string,Node):*)|undefined} sanitizeDOMValue the global sanitizeDOMValue callback
*/
Polymer.setSanitizeDOMValue = function(sanitizeDOMValue) {
Polymer.sanitizeDOMValue = sanitizeDOMValue;
}
})();
</script>
</script>

0 comments on commit 4d730e1

Please sign in to comment.