OLD | NEW |
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 Loading... |
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 Loading... |
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 = {}; |
OLD | NEW |