Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007 Apple 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 310 __proto__: WebInspector.Object.prototype | 310 __proto__: WebInspector.Object.prototype |
| 311 } | 311 } |
| 312 | 312 |
| 313 /** | 313 /** |
| 314 * @constructor | 314 * @constructor |
| 315 * @extends {TreeOutline} | 315 * @extends {TreeOutline} |
| 316 */ | 316 */ |
| 317 function TreeOutlineInShadow() | 317 function TreeOutlineInShadow() |
| 318 { | 318 { |
| 319 TreeOutline.call(this); | 319 TreeOutline.call(this); |
| 320 var innerElement = this.element; | 320 this.innerElement = this.element; |
|
lushnikov
2016/05/12 19:15:44
let's call this contentElement to be consistent wi
luoe
2016/05/12 21:28:28
Turns out there was already a "_contentElement", w
| |
| 321 innerElement.classList.add("tree-outline"); | 321 this.innerElement.classList.add("tree-outline"); |
| 322 | 322 |
| 323 // Redefine element to the external one. | 323 // Redefine element to the external one. |
| 324 this.element = createElement("div"); | 324 this.element = createElement("div"); |
| 325 this._shadowRoot = WebInspector.createShadowRootWithCoreStyles(this.element, "ui/treeoutline.css"); | 325 this._shadowRoot = WebInspector.createShadowRootWithCoreStyles(this.element, "ui/treeoutline.css"); |
| 326 this._disclosureElement = this._shadowRoot.createChild("div", "tree-outline- disclosure"); | 326 this._disclosureElement = this._shadowRoot.createChild("div", "tree-outline- disclosure"); |
| 327 this._disclosureElement.appendChild(innerElement); | 327 this._disclosureElement.appendChild(this.innerElement); |
| 328 this._renderSelection = true; | 328 this._renderSelection = true; |
| 329 } | 329 } |
| 330 | 330 |
| 331 TreeOutlineInShadow.prototype = { | 331 TreeOutlineInShadow.prototype = { |
| 332 /** | 332 /** |
| 333 * @param {string} cssFile | 333 * @param {string} cssFile |
| 334 */ | 334 */ |
| 335 registerRequiredCSS: function(cssFile) | 335 registerRequiredCSS: function(cssFile) |
| 336 { | 336 { |
| 337 WebInspector.appendStyle(this._shadowRoot, cssFile); | 337 WebInspector.appendStyle(this._shadowRoot, cssFile); |
| (...skipping 826 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1164 isEventWithinDisclosureTriangle: function(event) | 1164 isEventWithinDisclosureTriangle: function(event) |
| 1165 { | 1165 { |
| 1166 // FIXME: We should not use getComputedStyle(). For that we need to get rid of using ::before for disclosure triangle. (http://webk.it/74446) | 1166 // FIXME: We should not use getComputedStyle(). For that we need to get rid of using ::before for disclosure triangle. (http://webk.it/74446) |
| 1167 var paddingLeftValue = window.getComputedStyle(this._listItemNode).paddi ngLeft; | 1167 var paddingLeftValue = window.getComputedStyle(this._listItemNode).paddi ngLeft; |
| 1168 console.assert(paddingLeftValue.endsWith("px")); | 1168 console.assert(paddingLeftValue.endsWith("px")); |
| 1169 var computedLeftPadding = parseFloat(paddingLeftValue); | 1169 var computedLeftPadding = parseFloat(paddingLeftValue); |
| 1170 var left = this._listItemNode.totalOffsetLeft() + computedLeftPadding; | 1170 var left = this._listItemNode.totalOffsetLeft() + computedLeftPadding; |
| 1171 return event.pageX >= left && event.pageX <= left + TreeElement._ArrowTo ggleWidth && this._expandable; | 1171 return event.pageX >= left && event.pageX <= left + TreeElement._ArrowTo ggleWidth && this._expandable; |
| 1172 } | 1172 } |
| 1173 } | 1173 } |
| OLD | NEW |