Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(107)

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/ui/GlassPane.js

Issue 2800733004: [DevTools] Account for synthetic events in deepElementFromPoint() (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/dom_extension/DOMExtension.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 UI.GlassPane = class { 5 UI.GlassPane = class {
6 constructor() { 6 constructor() {
7 this._widget = new UI.Widget(true); 7 this._widget = new UI.Widget(true);
8 this._widget.markAsRoot(); 8 this._widget.markAsRoot();
9 this.element = this._widget.element; 9 this.element = this._widget.element;
10 this.contentElement = this._widget.contentElement; 10 this.contentElement = this._widget.contentElement;
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 this.element.ownerDocument.body.removeEventListener('click', this._onMouseDo wnBound, true); 136 this.element.ownerDocument.body.removeEventListener('click', this._onMouseDo wnBound, true);
137 this._widget.detach(); 137 this._widget.detach();
138 } 138 }
139 139
140 /** 140 /**
141 * @param {!Event} event 141 * @param {!Event} event
142 */ 142 */
143 _onMouseDown(event) { 143 _onMouseDown(event) {
144 if (!this._onClickOutsideCallback) 144 if (!this._onClickOutsideCallback)
145 return; 145 return;
146 if (this.contentElement.isSelfOrAncestor(/** @type {?Node} */ (event.deepEle mentFromPoint()))) 146 var node = event.deepElementFromPoint();
147 if (!node || this.contentElement.isSelfOrAncestor(node))
147 return; 148 return;
148 this._onClickOutsideCallback.call(null, event); 149 this._onClickOutsideCallback.call(null, event);
149 } 150 }
150 151
151 _positionContent() { 152 _positionContent() {
152 if (!this.isShowing()) 153 if (!this.isShowing())
153 return; 154 return;
154 155
155 var showArrow = this._marginBehavior === UI.GlassPane.MarginBehavior.Arrow; 156 var showArrow = this._marginBehavior === UI.GlassPane.MarginBehavior.Arrow;
156 var gutterSize = showArrow ? 8 : (this._marginBehavior === UI.GlassPane.Marg inBehavior.NoMargin ? 0 : 3); 157 var gutterSize = showArrow ? 8 : (this._marginBehavior === UI.GlassPane.Marg inBehavior.NoMargin ? 0 : 3);
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 UI.GlassPane.MarginBehavior = { 389 UI.GlassPane.MarginBehavior = {
389 Arrow: Symbol('Arrow'), 390 Arrow: Symbol('Arrow'),
390 DefaultMargin: Symbol('DefaultMargin'), 391 DefaultMargin: Symbol('DefaultMargin'),
391 NoMargin: Symbol('NoMargin') 392 NoMargin: Symbol('NoMargin')
392 }; 393 };
393 394
394 /** @type {!Map<!Document, !Element>} */ 395 /** @type {!Map<!Document, !Element>} */
395 UI.GlassPane._containers = new Map(); 396 UI.GlassPane._containers = new Map();
396 /** @type {!Set<!UI.GlassPane>} */ 397 /** @type {!Set<!UI.GlassPane>} */
397 UI.GlassPane._panes = new Set(); 398 UI.GlassPane._panes = new Set();
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/dom_extension/DOMExtension.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698