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 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 TreeOutline.call(this); | 272 TreeOutline.call(this); |
273 var innerElement = this.element; | 273 var innerElement = this.element; |
274 innerElement.classList.add("tree-outline"); | 274 innerElement.classList.add("tree-outline"); |
275 if (className) | 275 if (className) |
276 innerElement.classList.add(className); | 276 innerElement.classList.add(className); |
277 | 277 |
278 // Redefine element to the external one. | 278 // Redefine element to the external one. |
279 this.element = createElement("div"); | 279 this.element = createElement("div"); |
280 | 280 |
281 this._shadowRoot = this.element.createShadowRoot(); | 281 this._shadowRoot = this.element.createShadowRoot(); |
282 this._shadowRoot.appendChild(WebInspector.View.createStyleElement("ui/treeou
tline.css")); | 282 this._shadowRoot.appendChild(WebInspector.Widget.createStyleElement("ui/tree
outline.css")); |
283 this._shadowRoot.appendChild(innerElement); | 283 this._shadowRoot.appendChild(innerElement); |
284 WebInspector.installComponentRootStyles(innerElement); | 284 WebInspector.installComponentRootStyles(innerElement); |
285 this._renderSelection = true; | 285 this._renderSelection = true; |
286 } | 286 } |
287 | 287 |
288 TreeOutlineInShadow.prototype = { | 288 TreeOutlineInShadow.prototype = { |
289 /** | 289 /** |
290 * @param {string} cssFile | 290 * @param {string} cssFile |
291 */ | 291 */ |
292 registerRequiredCSS: function(cssFile) | 292 registerRequiredCSS: function(cssFile) |
293 { | 293 { |
294 this._shadowRoot.appendChild(WebInspector.View.createStyleElement(cssFil
e)); | 294 this._shadowRoot.appendChild(WebInspector.Widget.createStyleElement(cssF
ile)); |
295 }, | 295 }, |
296 | 296 |
297 __proto__: TreeOutline.prototype | 297 __proto__: TreeOutline.prototype |
298 } | 298 } |
299 | 299 |
300 /** | 300 /** |
301 * @constructor | 301 * @constructor |
302 * @param {(string|!Node)=} title | 302 * @param {(string|!Node)=} title |
303 * @param {boolean=} expandable | 303 * @param {boolean=} expandable |
304 */ | 304 */ |
(...skipping 752 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1057 isEventWithinDisclosureTriangle: function(event) | 1057 isEventWithinDisclosureTriangle: function(event) |
1058 { | 1058 { |
1059 // FIXME: We should not use getComputedStyle(). For that we need to get
rid of using ::before for disclosure triangle. (http://webk.it/74446) | 1059 // FIXME: We should not use getComputedStyle(). For that we need to get
rid of using ::before for disclosure triangle. (http://webk.it/74446) |
1060 var paddingLeftValue = window.getComputedStyle(this._listItemNode).paddi
ngLeft; | 1060 var paddingLeftValue = window.getComputedStyle(this._listItemNode).paddi
ngLeft; |
1061 console.assert(paddingLeftValue.endsWith("px")); | 1061 console.assert(paddingLeftValue.endsWith("px")); |
1062 var computedLeftPadding = parseFloat(paddingLeftValue); | 1062 var computedLeftPadding = parseFloat(paddingLeftValue); |
1063 var left = this._listItemNode.totalOffsetLeft() + computedLeftPadding; | 1063 var left = this._listItemNode.totalOffsetLeft() + computedLeftPadding; |
1064 return event.pageX >= left && event.pageX <= left + TreeElement._ArrowTo
ggleWidth && this._expandable; | 1064 return event.pageX >= left && event.pageX <= left + TreeElement._ArrowTo
ggleWidth && this._expandable; |
1065 } | 1065 } |
1066 } | 1066 } |
OLD | NEW |