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

Side by Side Diff: Source/devtools/front_end/audits/AuditsPanel.js

Issue 662793002: [DevTools] Replace usages of document with custom functions. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 2 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after
420 }, 420 },
421 421
422 /** 422 /**
423 * @param {string} format 423 * @param {string} format
424 * @param {...*} vararg 424 * @param {...*} vararg
425 * @return {!WebInspector.AuditRuleResult} 425 * @return {!WebInspector.AuditRuleResult}
426 */ 426 */
427 addFormatted: function(format, vararg) 427 addFormatted: function(format, vararg)
428 { 428 {
429 var substitutions = Array.prototype.slice.call(arguments, 1); 429 var substitutions = Array.prototype.slice.call(arguments, 1);
430 var fragment = document.createDocumentFragment(); 430 var fragment = createDocumentFragment();
431 431
432 function append(a, b) 432 function append(a, b)
433 { 433 {
434 if (!(b instanceof Node)) 434 if (!(b instanceof Node))
435 b = document.createTextNode(b); 435 b = createTextNode(b);
436 a.appendChild(b); 436 a.appendChild(b);
437 return a; 437 return a;
438 } 438 }
439 439
440 var formattedResult = String.format(format, substitutions, this._formatt ers, fragment, append).formattedResult; 440 var formattedResult = String.format(format, substitutions, this._formatt ers, fragment, append).formattedResult;
441 if (formattedResult instanceof Node) 441 if (formattedResult instanceof Node)
442 formattedResult.normalize(); 442 formattedResult.normalize();
443 return this.addChild(formattedResult); 443 return this.addChild(formattedResult);
444 } 444 }
445 } 445 }
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
552 } 552 }
553 553
554 // Contributed audit rules should go into this namespace. 554 // Contributed audit rules should go into this namespace.
555 WebInspector.AuditRules = {}; 555 WebInspector.AuditRules = {};
556 556
557 /** 557 /**
558 * Contributed audit categories should go into this namespace. 558 * Contributed audit categories should go into this namespace.
559 * @type {!Object.<string, function(new:WebInspector.AuditCategory)>} 559 * @type {!Object.<string, function(new:WebInspector.AuditCategory)>}
560 */ 560 */
561 WebInspector.AuditCategories = {}; 561 WebInspector.AuditCategories = {};
OLDNEW
« no previous file with comments | « Source/devtools/front_end/audits/AuditResultView.js ('k') | Source/devtools/front_end/components/DOMBreakpointsSidebarPane.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698