Chromium Code Reviews| Index: ui/webui/resources/js/parse_html_subset.js |
| diff --git a/ui/webui/resources/js/parse_html_subset.js b/ui/webui/resources/js/parse_html_subset.js |
| index c49d8fca89b47286c7e1927f741d5719ceb915b9..598af74f568796f986507dd4b93b82e56c1dc2e3 100644 |
| --- a/ui/webui/resources/js/parse_html_subset.js |
| +++ b/ui/webui/resources/js/parse_html_subset.js |
| @@ -37,7 +37,8 @@ var parseHtmlSubset = (function() { |
| */ |
| var allowedTags = ['A', 'B', 'STRONG']; |
| - function merge() { |
| + /** @param {...Object} var_args Objects to merge. */ |
| + function merge(var_args) { |
| var clone = {}; |
| for (var i = 0; i < arguments.length; ++i) { |
| if (typeof arguments[i] == 'object') { |
| @@ -75,7 +76,12 @@ var parseHtmlSubset = (function() { |
| var tags = allowedTags.concat(extraTags); |
| var attrs = merge(allowedAttributes, opt_extraAttrs || {}); |
| - var doc = document.implementation.createHTMLDocument(''); |
| + /** @suppress {missingProperties} */ |
|
arv (Not doing code reviews)
2014/07/16 18:33:03
Why is this needed?
Dan Beam
2014/07/19 02:28:40
.createHTMLDocument()
arv (Not doing code reviews)
2014/07/21 18:25:31
I still don't understand why this refactoring is n
Dan Beam
2014/07/21 22:30:46
yes, @suppress => @externs (and added to compiler)
|
| + function createDoc() { |
| + return document.implementation.createHTMLDocument(''); |
| + } |
| + |
| + var doc = createDoc(); |
| var r = doc.createRange(); |
| r.selectNode(doc.body); |
| // This does not execute any scripts because the document has no view. |