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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/ui/UIUtils.js

Issue 1907263002: DevTools: Fix all outstanding JavaScript style issues. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove yoda disable. fix throw parens Created 4 years, 8 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. 3 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
4 * Copyright (C) 2007 Matt Lilek (pewtermoose@gmail.com). 4 * Copyright (C) 2007 Matt Lilek (pewtermoose@gmail.com).
5 * Copyright (C) 2009 Joseph Pecoraro 5 * Copyright (C) 2009 Joseph Pecoraro
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 10 *
(...skipping 834 matching lines...) Expand 10 before | Expand all | Expand 10 after
845 * @param {!Array.<!WebInspector.SourceRange>} resultRanges 845 * @param {!Array.<!WebInspector.SourceRange>} resultRanges
846 * @param {string} styleClass 846 * @param {string} styleClass
847 * @param {!Array.<!Object>=} changes 847 * @param {!Array.<!Object>=} changes
848 * @return {!Array.<!Element>} 848 * @return {!Array.<!Element>}
849 */ 849 */
850 WebInspector.highlightRangesWithStyleClass = function(element, resultRanges, sty leClass, changes) 850 WebInspector.highlightRangesWithStyleClass = function(element, resultRanges, sty leClass, changes)
851 { 851 {
852 changes = changes || []; 852 changes = changes || [];
853 var highlightNodes = []; 853 var highlightNodes = [];
854 var textNodes = element.childTextNodes(); 854 var textNodes = element.childTextNodes();
855 var lineText = textNodes.map(function (node) { return node.textContent; }).j oin(""); 855 var lineText = textNodes.map(function(node) { return node.textContent; }).jo in("");
856 var ownerDocument = element.ownerDocument; 856 var ownerDocument = element.ownerDocument;
857 857
858 if (textNodes.length === 0) 858 if (textNodes.length === 0)
859 return highlightNodes; 859 return highlightNodes;
860 860
861 var nodeRanges = []; 861 var nodeRanges = [];
862 var rangeEndOffset = 0; 862 var rangeEndOffset = 0;
863 for (var i = 0; i < textNodes.length; ++i) { 863 for (var i = 0; i < textNodes.length; ++i) {
864 var range = {}; 864 var range = {};
865 range.offset = rangeEndOffset; 865 range.offset = rangeEndOffset;
(...skipping 831 matching lines...) Expand 10 before | Expand all | Expand 10 after
1697 var selectorText = rules[j].selectorText; 1697 var selectorText = rules[j].selectorText;
1698 for (var i = 0; style && i < style.length; ++i) 1698 for (var i = 0; style && i < style.length; ++i)
1699 this._patchProperty(selectorText, style, style[i], output); 1699 this._patchProperty(selectorText, style, style[i], output);
1700 if (output.length) 1700 if (output.length)
1701 result.push(rules[j].selectorText + "{" + output.join("") + "}"); 1701 result.push(rules[j].selectorText + "{" + output.join("") + "}");
1702 } 1702 }
1703 1703
1704 var fullText = result.join("\n"); 1704 var fullText = result.join("\n");
1705 this._cachedThemePatches.set(id, fullText); 1705 this._cachedThemePatches.set(id, fullText);
1706 return fullText; 1706 return fullText;
1707 } catch(e) { 1707 } catch (e) {
1708 this._setting.set("default"); 1708 this._setting.set("default");
1709 return ""; 1709 return "";
1710 } 1710 }
1711 }, 1711 },
1712 1712
1713 /** 1713 /**
1714 * @param {string} selectorText 1714 * @param {string} selectorText
1715 * @param {!CSSStyleDeclaration} style 1715 * @param {!CSSStyleDeclaration} style
1716 * @param {string} name 1716 * @param {string} name
1717 * @param {!Array<string>} output 1717 * @param {!Array<string>} output
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
1830 [NetworkAgent.ResourcePriority.High, WebInspector.UIString("High")], 1830 [NetworkAgent.ResourcePriority.High, WebInspector.UIString("High")],
1831 [NetworkAgent.ResourcePriority.VeryHigh, WebInspector.UIString("High est")] 1831 [NetworkAgent.ResourcePriority.VeryHigh, WebInspector.UIString("High est")]
1832 ]); 1832 ]);
1833 WebInspector.uiLabelForPriority._priorityToUILabel = labelMap; 1833 WebInspector.uiLabelForPriority._priorityToUILabel = labelMap;
1834 } 1834 }
1835 return labelMap.get(priority) || WebInspector.UIString("Unknown"); 1835 return labelMap.get(priority) || WebInspector.UIString("Unknown");
1836 } 1836 }
1837 1837
1838 /** @type {!WebInspector.ThemeSupport} */ 1838 /** @type {!WebInspector.ThemeSupport} */
1839 WebInspector.themeSupport; 1839 WebInspector.themeSupport;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698