| 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 this._splitView.addEventListener(WebInspector.SplitView.Events.SidebarSizeCh
anged, this._updateTreeOutlineVisibleWidth.bind(this)); | 44 this._splitView.addEventListener(WebInspector.SplitView.Events.SidebarSizeCh
anged, this._updateTreeOutlineVisibleWidth.bind(this)); |
| 45 this._splitView.show(this.element); | 45 this._splitView.show(this.element); |
| 46 | 46 |
| 47 this._searchableView = new WebInspector.SearchableView(this); | 47 this._searchableView = new WebInspector.SearchableView(this); |
| 48 this._searchableView.setMinimumSize(25, 19); | 48 this._searchableView.setMinimumSize(25, 19); |
| 49 this._searchableView.show(this._splitView.mainElement()); | 49 this._searchableView.show(this._splitView.mainElement()); |
| 50 var stackElement = this._searchableView.element; | 50 var stackElement = this._searchableView.element; |
| 51 | 51 |
| 52 this.contentElement = stackElement.createChild("div"); | 52 this.contentElement = stackElement.createChild("div"); |
| 53 this.contentElement.id = "elements-content"; | 53 this.contentElement.id = "elements-content"; |
| 54 this.contentElement.classList.add("outline-disclosure"); | 54 this.contentElement.classList.add("outline-disclosure", "source-code"); |
| 55 this.contentElement.classList.add("source-code"); | |
| 56 if (!WebInspector.settings.domWordWrap.get()) | 55 if (!WebInspector.settings.domWordWrap.get()) |
| 57 this.contentElement.classList.add("nowrap"); | 56 this.contentElement.classList.add("nowrap"); |
| 58 WebInspector.settings.domWordWrap.addChangeListener(this._domWordWrapSetting
Changed.bind(this)); | 57 WebInspector.settings.domWordWrap.addChangeListener(this._domWordWrapSetting
Changed.bind(this)); |
| 59 | 58 |
| 60 this._splitView.sidebarElement().addEventListener("contextmenu", this._sideb
arContextMenuEventFired.bind(this), false); | 59 this._splitView.sidebarElement().addEventListener("contextmenu", this._sideb
arContextMenuEventFired.bind(this), false); |
| 61 | 60 |
| 62 var crumbsContainer = stackElement.createChild("div"); | 61 var crumbsContainer = stackElement.createChild("div"); |
| 63 crumbsContainer.id = "elements-crumbs"; | 62 crumbsContainer.id = "elements-crumbs"; |
| 64 this.crumbsElement = crumbsContainer.createChild("div", "crumbs"); | 63 this.crumbsElement = crumbsContainer.createChild("div", "crumbs"); |
| 65 this.crumbsElement.addEventListener("mousemove", this._mouseMovedInCrumbs.bi
nd(this), false); | 64 this.crumbsElement.addEventListener("mousemove", this._mouseMovedInCrumbs.bi
nd(this), false); |
| (...skipping 629 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 695 | 694 |
| 696 _metricsPaneEdited: function() | 695 _metricsPaneEdited: function() |
| 697 { | 696 { |
| 698 // Once metrics are edited, the Styles pane should be updated. | 697 // Once metrics are edited, the Styles pane should be updated. |
| 699 this.sidebarPanes.styles.needsUpdate = true; | 698 this.sidebarPanes.styles.needsUpdate = true; |
| 700 this.updateStyles(true); | 699 this.updateStyles(true); |
| 701 }, | 700 }, |
| 702 | 701 |
| 703 _mouseMovedInCrumbs: function(event) | 702 _mouseMovedInCrumbs: function(event) |
| 704 { | 703 { |
| 705 var nodeUnderMouse = document.elementFromPoint(event.pageX, event.pageY)
; | 704 var nodeUnderMouse = event.elementFromPoint(); |
| 706 var crumbElement = nodeUnderMouse.enclosingNodeOrSelfWithClass("crumb"); | 705 var crumbElement = nodeUnderMouse.enclosingNodeOrSelfWithClass("crumb"); |
| 707 var node = /** @type {?WebInspector.DOMNode} */ (crumbElement ? crumbEle
ment.representedObject : null); | 706 var node = /** @type {?WebInspector.DOMNode} */ (crumbElement ? crumbEle
ment.representedObject : null); |
| 708 if (node) | 707 if (node) |
| 709 node.highlight(); | 708 node.highlight(); |
| 710 }, | 709 }, |
| 711 | 710 |
| 712 _mouseMovedOutOfCrumbs: function(event) | 711 _mouseMovedOutOfCrumbs: function(event) |
| 713 { | 712 { |
| 714 var nodeUnderMouse = document.elementFromPoint(event.pageX, event.pageY)
; | 713 var nodeUnderMouse = event.elementFromPoint(); |
| 715 if (nodeUnderMouse && nodeUnderMouse.isDescendant(this.crumbsElement)) | 714 if (nodeUnderMouse && nodeUnderMouse.isDescendant(this.crumbsElement)) |
| 716 return; | 715 return; |
| 717 | 716 |
| 718 for (var i = 0; i < this._treeOutlines.length; ++i) | 717 for (var i = 0; i < this._treeOutlines.length; ++i) |
| 719 this._treeOutlines[i].domModel().hideDOMNodeHighlight(); | 718 this._treeOutlines[i].domModel().hideDOMNodeHighlight(); |
| 720 }, | 719 }, |
| 721 | 720 |
| 722 /** | 721 /** |
| 723 * @param {boolean=} forceUpdate | 722 * @param {boolean=} forceUpdate |
| 724 */ | 723 */ |
| (...skipping 878 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1603 /** | 1602 /** |
| 1604 * @suppressReceiverCheck | 1603 * @suppressReceiverCheck |
| 1605 * @this {Element} | 1604 * @this {Element} |
| 1606 */ | 1605 */ |
| 1607 function parentElement() | 1606 function parentElement() |
| 1608 { | 1607 { |
| 1609 return this.parentElement; | 1608 return this.parentElement; |
| 1610 } | 1609 } |
| 1611 } | 1610 } |
| 1612 } | 1611 } |
| OLD | NEW |