OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 | 96 |
97 if (typeof result.value === "string") { | 97 if (typeof result.value === "string") { |
98 title = result.value; | 98 title = result.value; |
99 if (result.violationCount) | 99 if (result.violationCount) |
100 title = String.sprintf("%s (%d)", title, result.violationCount); | 100 title = String.sprintf("%s (%d)", title, result.violationCount); |
101 } | 101 } |
102 | 102 |
103 var titleFragment = createDocumentFragment(); | 103 var titleFragment = createDocumentFragment(); |
104 if (severity) { | 104 if (severity) { |
105 var severityElement = createElement("div"); | 105 var severityElement = createElement("div"); |
106 severityElement.className = "severity-" + severity; | 106 severityElement.classList.add("severity", severity); |
107 titleFragment.appendChild(severityElement); | 107 titleFragment.appendChild(severityElement); |
108 } | 108 } |
109 titleFragment.createTextChild(title); | 109 titleFragment.createTextChild(title); |
110 | 110 |
111 var treeElement = new TreeElement(titleFragment, null, !!result.children
); | 111 var treeElement = new TreeElement(titleFragment, null, !!result.children
); |
112 parentTreeElement.appendChild(treeElement); | 112 parentTreeElement.appendChild(treeElement); |
113 | 113 |
114 if (result.className) | 114 if (result.className) |
115 treeElement.listItemElement.classList.add(result.className); | 115 treeElement.listItemElement.classList.add(result.className); |
116 if (typeof result.value !== "string") | 116 if (typeof result.value !== "string") |
117 treeElement.listItemElement.appendChild(WebInspector.auditFormatters
.apply(result.value)); | 117 treeElement.listItemElement.appendChild(WebInspector.auditFormatters
.apply(result.value)); |
118 | 118 |
119 if (result.children) { | 119 if (result.children) { |
120 for (var i = 0; i < result.children.length; ++i) | 120 for (var i = 0; i < result.children.length; ++i) |
121 this._appendResult(treeElement, result.children[i]); | 121 this._appendResult(treeElement, result.children[i]); |
122 } | 122 } |
123 if (result.expanded) { | 123 if (result.expanded) { |
124 treeElement.listItemElement.classList.remove("parent"); | 124 treeElement.listItemElement.classList.remove("parent"); |
125 treeElement.listItemElement.classList.add("parent-expanded"); | 125 treeElement.listItemElement.classList.add("parent-expanded"); |
126 treeElement.expand(); | 126 treeElement.expand(); |
127 } | 127 } |
128 return treeElement; | 128 return treeElement; |
129 }, | 129 }, |
130 | 130 |
131 __proto__: WebInspector.SidebarPane.prototype | 131 __proto__: WebInspector.SidebarPane.prototype |
132 } | 132 } |
OLD | NEW |