Skip to content

Commit

Permalink
Devtools: Use Event.deepPath as a function if available.
Browse files Browse the repository at this point in the history
In crrev.com/1637813002 Event.deepPath changes from an attribute to a
function. Event.deepPath is the prefered method for retriving all
elements at point in an event. This change also adds a fallback to
Event.path for old front-ends targeting Event.deepPath as an attribute.

Review URL: https://codereview.chromium.org/1653213002

Cr-Commit-Position: refs/heads/master@{#374084}
  • Loading branch information
lisamuel authored and Commit bot committed Feb 8, 2016
1 parent 3b52d7d commit ab29e36
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions front_end/devtools.js
Original file line number Diff line number Diff line change
Expand Up @@ -1010,6 +1010,9 @@ function installBackwardsCompatibility()
styleElement.type = "text/css";
styleElement.textContent = "html /deep/ * { min-width: 0; min-height: 0; }";
window.document.head.appendChild(styleElement);

// Support for legacy (<M49) frontends. Remove in M52.
Event.prototype.deepPath = undefined;
}

function windowLoaded()
Expand Down
2 changes: 1 addition & 1 deletion front_end/ui/Tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ WebInspector.Tooltip.prototype = {
*/
_mouseMove: function(event)
{
var path = event.deepPath ? event.deepPath : event.path;
var path = event.path;
if (!path || event.buttons !== 0)
return;

Expand Down

0 comments on commit ab29e36

Please sign in to comment.