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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/console/ConsoleViewMessage.js

Issue 2201913002: DevTools: [Console] revert filtering out URLs from %c styling properties (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
« no previous file with comments | « third_party/WebKit/LayoutTests/inspector/console/console-format-style-whitelist-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. 3 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
4 * Copyright (C) 2009 Joseph Pecoraro 4 * Copyright (C) 2009 Joseph Pecoraro
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 9 *
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 795 matching lines...) Expand 10 before | Expand all | Expand 10 after
806 } 806 }
807 807
808 var currentStyle = null; 808 var currentStyle = null;
809 function styleFormatter(obj) 809 function styleFormatter(obj)
810 { 810 {
811 currentStyle = {}; 811 currentStyle = {};
812 var buffer = createElement("span"); 812 var buffer = createElement("span");
813 buffer.setAttribute("style", obj.description); 813 buffer.setAttribute("style", obj.description);
814 for (var i = 0; i < buffer.style.length; i++) { 814 for (var i = 0; i < buffer.style.length; i++) {
815 var property = buffer.style[i]; 815 var property = buffer.style[i];
816 var value = buffer.style.getPropertyValue(property); 816 if (isWhitelistedProperty(property))
817 if (!value.startsWith("url(") && isWhitelistedProperty(property) )
818 currentStyle[property] = buffer.style[property]; 817 currentStyle[property] = buffer.style[property];
819 } 818 }
820 } 819 }
821 820
822 function isWhitelistedProperty(property) 821 function isWhitelistedProperty(property)
823 { 822 {
824 var prefixes = ["background", "border", "color", "font", "line", "ma rgin", "padding", "text", "-webkit-background", "-webkit-border", "-webkit-font" , "-webkit-margin", "-webkit-padding", "-webkit-text"]; 823 var prefixes = ["background", "border", "color", "font", "line", "ma rgin", "padding", "text", "-webkit-background", "-webkit-border", "-webkit-font" , "-webkit-margin", "-webkit-padding", "-webkit-text"];
825 for (var i = 0; i < prefixes.length; i++) { 824 for (var i = 0; i < prefixes.length; i++) {
826 if (property.startsWith(prefixes[i])) 825 if (property.startsWith(prefixes[i]))
827 return true; 826 return true;
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after
1357 { 1356 {
1358 if (!this._wrapperElement) { 1357 if (!this._wrapperElement) {
1359 WebInspector.ConsoleViewMessage.prototype.toMessageElement.call(this ); 1358 WebInspector.ConsoleViewMessage.prototype.toMessageElement.call(this );
1360 this._wrapperElement.classList.toggle("collapsed", this._collapsed); 1359 this._wrapperElement.classList.toggle("collapsed", this._collapsed);
1361 } 1360 }
1362 return this._wrapperElement; 1361 return this._wrapperElement;
1363 }, 1362 },
1364 1363
1365 __proto__: WebInspector.ConsoleViewMessage.prototype 1364 __proto__: WebInspector.ConsoleViewMessage.prototype
1366 } 1365 }
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/inspector/console/console-format-style-whitelist-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698