| 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 this._selectEnabled = selectEnabled; | 70 this._selectEnabled = selectEnabled; |
| 71 /** @type {?SDK.DOMNode} */ | 71 /** @type {?SDK.DOMNode} */ |
| 72 this._rootDOMNode = null; | 72 this._rootDOMNode = null; |
| 73 /** @type {?SDK.DOMNode} */ | 73 /** @type {?SDK.DOMNode} */ |
| 74 this._selectedDOMNode = null; | 74 this._selectedDOMNode = null; |
| 75 | 75 |
| 76 this._visible = false; | 76 this._visible = false; |
| 77 | 77 |
| 78 this._popoverHelper = new UI.PopoverHelper(this._element); | 78 this._popoverHelper = new UI.PopoverHelper(this._element); |
| 79 this._popoverHelper.initializeCallbacks(this._getPopoverAnchor.bind(this), t
his._showPopover.bind(this)); | 79 this._popoverHelper.initializeCallbacks(this._getPopoverAnchor.bind(this), t
his._showPopover.bind(this)); |
| 80 this._popoverHelper.setHasPadding(true); |
| 80 this._popoverHelper.setTimeout(0, 100); | 81 this._popoverHelper.setTimeout(0, 100); |
| 81 | 82 |
| 82 /** @type {!Map<!SDK.DOMNode, !Elements.ElementsTreeOutline.UpdateRecord>} *
/ | 83 /** @type {!Map<!SDK.DOMNode, !Elements.ElementsTreeOutline.UpdateRecord>} *
/ |
| 83 this._updateRecords = new Map(); | 84 this._updateRecords = new Map(); |
| 84 /** @type {!Set<!Elements.ElementsTreeElement>} */ | 85 /** @type {!Set<!Elements.ElementsTreeElement>} */ |
| 85 this._treeElementsBeingUpdated = new Set(); | 86 this._treeElementsBeingUpdated = new Set(); |
| 86 | 87 |
| 87 this._domModel.addEventListener(SDK.DOMModel.Events.MarkersChanged, this._ma
rkersChanged, this); | 88 this._domModel.addEventListener(SDK.DOMModel.Events.MarkersChanged, this._ma
rkersChanged, this); |
| 88 this._showHTMLCommentsSetting = Common.moduleSetting('showHTMLComments'); | 89 this._showHTMLCommentsSetting = Common.moduleSetting('showHTMLComments'); |
| 89 this._showHTMLCommentsSetting.addChangeListener(this._onShowHTMLCommentsChan
ge.bind(this)); | 90 this._showHTMLCommentsSetting.addChangeListener(this._onShowHTMLCommentsChan
ge.bind(this)); |
| (...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 565 naturalWidth: this.naturalWidth, | 566 naturalWidth: this.naturalWidth, |
| 566 naturalHeight: this.naturalHeight, | 567 naturalHeight: this.naturalHeight, |
| 567 currentSrc: this.currentSrc | 568 currentSrc: this.currentSrc |
| 568 }; | 569 }; |
| 569 } | 570 } |
| 570 } | 571 } |
| 571 } | 572 } |
| 572 | 573 |
| 573 /** | 574 /** |
| 574 * @param {!Element} link | 575 * @param {!Element} link |
| 575 * @param {!UI.Popover} popover | 576 * @param {!UI.GlassPane} popover |
| 577 * @return {!Promise<boolean>} |
| 576 */ | 578 */ |
| 577 _showPopover(link, popover) { | 579 _showPopover(link, popover) { |
| 580 var fulfill; |
| 581 var promise = new Promise(x => fulfill = x); |
| 578 var listItem = link.enclosingNodeOrSelfWithNodeName('li'); | 582 var listItem = link.enclosingNodeOrSelfWithNodeName('li'); |
| 579 var node = /** @type {!Elements.ElementsTreeElement} */ (listItem.treeElemen
t).node(); | 583 var node = /** @type {!Elements.ElementsTreeElement} */ (listItem.treeElemen
t).node(); |
| 580 this._loadDimensionsForNode( | 584 this._loadDimensionsForNode( |
| 581 node, Components.DOMPresentationUtils.buildImagePreviewContents.bind( | 585 node, Components.DOMPresentationUtils.buildImagePreviewContents.bind( |
| 582 Components.DOMPresentationUtils, node.target(), link[Elements.
ElementsTreeElement.HrefSymbol], true, | 586 Components.DOMPresentationUtils, node.target(), link[Elements.
ElementsTreeElement.HrefSymbol], true, |
| 583 showPopover)); | 587 showPopover)); |
| 588 return promise; |
| 584 | 589 |
| 585 /** | 590 /** |
| 586 * @param {!Element=} contents | 591 * @param {!Element=} contents |
| 587 */ | 592 */ |
| 588 function showPopover(contents) { | 593 function showPopover(contents) { |
| 589 if (!contents) | 594 if (contents) |
| 590 return; | 595 popover.contentElement.appendChild(contents); |
| 591 popover.showForAnchor(contents, link); | 596 fulfill(!!contents); |
| 592 } | 597 } |
| 593 } | 598 } |
| 594 | 599 |
| 595 _onmousedown(event) { | 600 _onmousedown(event) { |
| 596 var element = this._treeElementFromEvent(event); | 601 var element = this._treeElementFromEvent(event); |
| 597 | 602 |
| 598 if (!element || element.isEventWithinDisclosureTriangle(event)) | 603 if (!element || element.isEventWithinDisclosureTriangle(event)) |
| 599 return; | 604 return; |
| 600 | 605 |
| 601 element.select(); | 606 element.select(); |
| (...skipping 1086 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1688 */ | 1693 */ |
| 1689 function resolved(node) { | 1694 function resolved(node) { |
| 1690 if (node) { | 1695 if (node) { |
| 1691 this.treeOutline._selectedDOMNode = node; | 1696 this.treeOutline._selectedDOMNode = node; |
| 1692 this.treeOutline._selectedNodeChanged(); | 1697 this.treeOutline._selectedNodeChanged(); |
| 1693 } | 1698 } |
| 1694 } | 1699 } |
| 1695 return true; | 1700 return true; |
| 1696 } | 1701 } |
| 1697 }; | 1702 }; |
| OLD | NEW |