Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(525)

Unified Diff: ui/webui/resources/js/parse_html_subset.js

Issue 369643002: Lay groudwork to Closure compile JavaScript (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more compiled Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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.

Powered by Google App Engine
This is Rietveld 408576698