| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2009 Joseph Pecoraro | 3 * Copyright (C) 2009 Joseph Pecoraro |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 var isOdd = this._propertiesOutline.rootElement().children().length % 2 ==
= 0; | 194 var isOdd = this._propertiesOutline.rootElement().children().length % 2 ==
= 0; |
| 195 treeElement.listItemElement.classList.toggle('odd-row', isOdd); | 195 treeElement.listItemElement.classList.toggle('odd-row', isOdd); |
| 196 this._propertiesOutline.appendChild(treeElement); | 196 this._propertiesOutline.appendChild(treeElement); |
| 197 | 197 |
| 198 var trace = propertyTraces.get(propertyName); | 198 var trace = propertyTraces.get(propertyName); |
| 199 if (trace) { | 199 if (trace) { |
| 200 var activeProperty = this._renderPropertyTrace(cssModel, matchedStyles,
nodeStyle.node, treeElement, trace); | 200 var activeProperty = this._renderPropertyTrace(cssModel, matchedStyles,
nodeStyle.node, treeElement, trace); |
| 201 treeElement.listItemElement.addEventListener('mousedown', e => e.consume
(), false); | 201 treeElement.listItemElement.addEventListener('mousedown', e => e.consume
(), false); |
| 202 treeElement.listItemElement.addEventListener('dblclick', e => e.consume(
), false); | 202 treeElement.listItemElement.addEventListener('dblclick', e => e.consume(
), false); |
| 203 treeElement.listItemElement.addEventListener('click', handleClick.bind(n
ull, treeElement), false); | 203 treeElement.listItemElement.addEventListener('click', handleClick.bind(n
ull, treeElement), false); |
| 204 var gotoSourceElement = UI.Icon.create('smallicon-arrow-in-circle', 'got
o-source-icon'); | 204 var gotoSourceElement = UI.Icon.create('mediumicon-arrow-in-circle', 'go
to-source-icon'); |
| 205 gotoSourceElement.addEventListener('click', this._navigateToSource.bind(
this, activeProperty)); | 205 gotoSourceElement.addEventListener('click', this._navigateToSource.bind(
this, activeProperty)); |
| 206 propertyValueElement.appendChild(gotoSourceElement); | 206 propertyValueElement.appendChild(gotoSourceElement); |
| 207 if (expandedProperties.has(propertyName)) | 207 if (expandedProperties.has(propertyName)) |
| 208 treeElement.expand(); | 208 treeElement.expand(); |
| 209 } | 209 } |
| 210 } | 210 } |
| 211 | 211 |
| 212 this._updateFilter(this._filterRegex); | 212 this._updateFilter(this._filterRegex); |
| 213 | 213 |
| 214 /** | 214 /** |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 trace.classList.add('property-trace-inactive'); | 265 trace.classList.add('property-trace-inactive'); |
| 266 else | 266 else |
| 267 activeProperty = property; | 267 activeProperty = property; |
| 268 | 268 |
| 269 var renderer = | 269 var renderer = |
| 270 new Elements.StylesSidebarPropertyRenderer(null, node, property.name,
/** @type {string} */ (property.value)); | 270 new Elements.StylesSidebarPropertyRenderer(null, node, property.name,
/** @type {string} */ (property.value)); |
| 271 renderer.setColorHandler(this._processColor.bind(this)); | 271 renderer.setColorHandler(this._processColor.bind(this)); |
| 272 var valueElement = renderer.renderValue(); | 272 var valueElement = renderer.renderValue(); |
| 273 valueElement.classList.add('property-trace-value'); | 273 valueElement.classList.add('property-trace-value'); |
| 274 valueElement.addEventListener('click', this._navigateToSource.bind(this, p
roperty), false); | 274 valueElement.addEventListener('click', this._navigateToSource.bind(this, p
roperty), false); |
| 275 var gotoSourceElement = UI.Icon.create('smallicon-arrow-in-circle', 'goto-
source-icon'); | 275 var gotoSourceElement = UI.Icon.create('mediumicon-arrow-in-circle', 'goto
-source-icon'); |
| 276 gotoSourceElement.addEventListener('click', this._navigateToSource.bind(th
is, property)); | 276 gotoSourceElement.addEventListener('click', this._navigateToSource.bind(th
is, property)); |
| 277 valueElement.insertBefore(gotoSourceElement, valueElement.firstChild); | 277 valueElement.insertBefore(gotoSourceElement, valueElement.firstChild); |
| 278 | 278 |
| 279 trace.appendChild(valueElement); | 279 trace.appendChild(valueElement); |
| 280 | 280 |
| 281 var rule = property.ownerStyle.parentRule; | 281 var rule = property.ownerStyle.parentRule; |
| 282 if (rule) { | 282 if (rule) { |
| 283 var linkSpan = trace.createChild('span', 'trace-link'); | 283 var linkSpan = trace.createChild('span', 'trace-link'); |
| 284 linkSpan.appendChild( | 284 linkSpan.appendChild( |
| 285 Elements.StylePropertiesSection.createRuleOriginNode(matchedStyles,
this._linkifier, rule)); | 285 Elements.StylePropertiesSection.createRuleOriginNode(matchedStyles,
this._linkifier, rule)); |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 341 var property = child[Elements.ComputedStyleWidget._propertySymbol]; | 341 var property = child[Elements.ComputedStyleWidget._propertySymbol]; |
| 342 var matched = !regex || regex.test(property.name) || regex.test(property.v
alue); | 342 var matched = !regex || regex.test(property.name) || regex.test(property.v
alue); |
| 343 child.hidden = !matched; | 343 child.hidden = !matched; |
| 344 } | 344 } |
| 345 } | 345 } |
| 346 }; | 346 }; |
| 347 | 347 |
| 348 Elements.ComputedStyleWidget._maxLinkLength = 30; | 348 Elements.ComputedStyleWidget._maxLinkLength = 30; |
| 349 | 349 |
| 350 Elements.ComputedStyleWidget._propertySymbol = Symbol('property'); | 350 Elements.ComputedStyleWidget._propertySymbol = Symbol('property'); |
| OLD | NEW |