| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com> | 3 * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com> |
| 4 * Copyright (C) 2009 Joseph Pecoraro | 4 * Copyright (C) 2009 Joseph Pecoraro |
| 5 * | 5 * |
| 6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
| 7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
| 8 * are met: | 8 * are met: |
| 9 * | 9 * |
| 10 * 1. Redistributions of source code must retain the above copyright | 10 * 1. Redistributions of source code must retain the above copyright |
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 _updateTreeOutlineVisibleWidth: function() | 270 _updateTreeOutlineVisibleWidth: function() |
| 271 { | 271 { |
| 272 if (!this._treeOutlines.length) | 272 if (!this._treeOutlines.length) |
| 273 return; | 273 return; |
| 274 | 274 |
| 275 var width = this._splitWidget.element.offsetWidth; | 275 var width = this._splitWidget.element.offsetWidth; |
| 276 if (this._splitWidget.isVertical()) | 276 if (this._splitWidget.isVertical()) |
| 277 width -= this._splitWidget.sidebarSize(); | 277 width -= this._splitWidget.sidebarSize(); |
| 278 for (var i = 0; i < this._treeOutlines.length; ++i) { | 278 for (var i = 0; i < this._treeOutlines.length; ++i) { |
| 279 this._treeOutlines[i].setVisibleWidth(width); | 279 this._treeOutlines[i].setVisibleWidth(width); |
| 280 this._treeOutlines[i].updateSelection(); | |
| 281 } | 280 } |
| 282 this._breadcrumbs.updateSizes(); | 281 this._breadcrumbs.updateSizes(); |
| 283 }, | 282 }, |
| 284 | 283 |
| 285 /** | 284 /** |
| 286 * @override | 285 * @override |
| 287 * @return {!Element} | 286 * @return {!Element} |
| 288 */ | 287 */ |
| 289 defaultFocusedElement: function() | 288 defaultFocusedElement: function() |
| 290 { | 289 { |
| (...skipping 17 matching lines...) Expand all Loading... |
| 308 var treeOutline = this._treeOutlines[i]; | 307 var treeOutline = this._treeOutlines[i]; |
| 309 // Attach heavy component lazily | 308 // Attach heavy component lazily |
| 310 if (treeOutline.element.parentElement !== this._contentElement) | 309 if (treeOutline.element.parentElement !== this._contentElement) |
| 311 this._contentElement.appendChild(treeOutline.element); | 310 this._contentElement.appendChild(treeOutline.element); |
| 312 } | 311 } |
| 313 WebInspector.Panel.prototype.wasShown.call(this); | 312 WebInspector.Panel.prototype.wasShown.call(this); |
| 314 this._breadcrumbs.update(); | 313 this._breadcrumbs.update(); |
| 315 | 314 |
| 316 for (var i = 0; i < this._treeOutlines.length; ++i) { | 315 for (var i = 0; i < this._treeOutlines.length; ++i) { |
| 317 var treeOutline = this._treeOutlines[i]; | 316 var treeOutline = this._treeOutlines[i]; |
| 318 treeOutline.updateSelection(); | |
| 319 treeOutline.setVisible(true); | 317 treeOutline.setVisible(true); |
| 320 | 318 |
| 321 if (!treeOutline.rootDOMNode) | 319 if (!treeOutline.rootDOMNode) |
| 322 if (treeOutline.domModel().existingDocument()) | 320 if (treeOutline.domModel().existingDocument()) |
| 323 this._documentUpdated(treeOutline.domModel(), treeOutline.do
mModel().existingDocument()); | 321 this._documentUpdated(treeOutline.domModel(), treeOutline.do
mModel().existingDocument()); |
| 324 else | 322 else |
| 325 treeOutline.domModel().requestDocument(); | 323 treeOutline.domModel().requestDocument(); |
| 326 } | 324 } |
| 327 | 325 |
| 328 }, | 326 }, |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 530 this._jumpToSearchResult(jumpBackwards ? -1 : 0); | 528 this._jumpToSearchResult(jumpBackwards ? -1 : 0); |
| 531 } | 529 } |
| 532 }, | 530 }, |
| 533 | 531 |
| 534 _domWordWrapSettingChanged: function(event) | 532 _domWordWrapSettingChanged: function(event) |
| 535 { | 533 { |
| 536 // FIXME: crbug.com/425984 | 534 // FIXME: crbug.com/425984 |
| 537 this._contentElement.classList.toggle("elements-wrap", event.data); | 535 this._contentElement.classList.toggle("elements-wrap", event.data); |
| 538 for (var i = 0; i < this._treeOutlines.length; ++i) | 536 for (var i = 0; i < this._treeOutlines.length; ++i) |
| 539 this._treeOutlines[i].setWordWrap(/** @type {boolean} */ (event.data
)); | 537 this._treeOutlines[i].setWordWrap(/** @type {boolean} */ (event.data
)); |
| 540 | |
| 541 var selectedNode = this.selectedDOMNode(); | |
| 542 if (!selectedNode) | |
| 543 return; | |
| 544 | |
| 545 var treeElement = this._treeElementForNode(selectedNode); | |
| 546 if (treeElement) | |
| 547 treeElement.updateSelection(); // Recalculate selection highlight di
mensions. | |
| 548 }, | 538 }, |
| 549 | 539 |
| 550 switchToAndFocus: function(node) | 540 switchToAndFocus: function(node) |
| 551 { | 541 { |
| 552 // Reset search restore. | 542 // Reset search restore. |
| 553 this._searchableView.cancelSearch(); | 543 this._searchableView.cancelSearch(); |
| 554 WebInspector.inspectorView.setCurrentPanel(this); | 544 WebInspector.inspectorView.setCurrentPanel(this); |
| 555 this.selectDOMNode(node, true); | 545 this.selectDOMNode(node, true); |
| 556 }, | 546 }, |
| 557 | 547 |
| (...skipping 661 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1219 /** | 1209 /** |
| 1220 * @override | 1210 * @override |
| 1221 * @param {!WebInspector.DOMNode} node | 1211 * @param {!WebInspector.DOMNode} node |
| 1222 * @return {?{title: string, color: string}} | 1212 * @return {?{title: string, color: string}} |
| 1223 */ | 1213 */ |
| 1224 decorate: function(node) | 1214 decorate: function(node) |
| 1225 { | 1215 { |
| 1226 return { color: "orange", title: WebInspector.UIString("Element state: %
s", ":" + WebInspector.CSSModel.fromNode(node).pseudoState(node).join(", :")) }; | 1216 return { color: "orange", title: WebInspector.UIString("Element state: %
s", ":" + WebInspector.CSSModel.fromNode(node).pseudoState(node).join(", :")) }; |
| 1227 } | 1217 } |
| 1228 } | 1218 } |
| OLD | NEW |