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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/dom_extension/DOMExtension.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 | « no previous file | third_party/WebKit/Source/devtools/front_end/ui/GlassPane.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2007 Apple Inc. All rights reserved.
3 * Copyright (C) 2012 Google Inc. All rights reserved. 3 * Copyright (C) 2012 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 739 matching lines...) Expand 10 before | Expand all | Expand 10 after
750 } 750 }
751 751
752 this.textContent = text; 752 this.textContent = text;
753 return false; 753 return false;
754 }; 754 };
755 755
756 /** 756 /**
757 * @return {?Node} 757 * @return {?Node}
758 */ 758 */
759 Event.prototype.deepElementFromPoint = function() { 759 Event.prototype.deepElementFromPoint = function() {
760 // Some synthetic events have zero coordinates which lead to a wrong element. Better return nothing in this case.
761 if (!this.which && !this.pageX && !this.pageY && !this.clientX && !this.client Y && !this.movementX && !this.movementY)
762 return null;
760 var root = this.target && this.target.getComponentRoot(); 763 var root = this.target && this.target.getComponentRoot();
761 return root ? root.deepElementFromPoint(this.pageX, this.pageY) : null; 764 return root ? root.deepElementFromPoint(this.pageX, this.pageY) : null;
762 }; 765 };
763 766
764 /** 767 /**
765 * @param {number} x 768 * @param {number} x
766 * @param {number} y 769 * @param {number} y
767 * @return {?Node} 770 * @return {?Node}
768 */ 771 */
769 Document.prototype.deepElementFromPoint = function(x, y) { 772 Document.prototype.deepElementFromPoint = function(x, y) {
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
820 return event.keyCode !== 229 && event.key === 'Enter'; 823 return event.keyCode !== 229 && event.key === 'Enter';
821 } 824 }
822 825
823 /** 826 /**
824 * @param {!Event} event 827 * @param {!Event} event
825 * @return {boolean} 828 * @return {boolean}
826 */ 829 */
827 function isEscKey(event) { 830 function isEscKey(event) {
828 return event.keyCode === 27; 831 return event.keyCode === 27;
829 } 832 }
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/ui/GlassPane.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698