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

Side by Side Diff: Source/devtools/front_end/timeline/TimelineView.js

Issue 669113002: DevTools: replace mouseout with mouseleave where possible. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: for landing Created 6 years, 2 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * Copyright (C) 2012 Intel Inc. All rights reserved. 3 * Copyright (C) 2012 Intel 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 are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 this._headerElement.id = "timeline-graph-records-header"; 60 this._headerElement.id = "timeline-graph-records-header";
61 61
62 // Create gpu tasks containers. 62 // Create gpu tasks containers.
63 this._cpuBarsElement = this._headerElement.createChild("div", "timeline-util ization-strip"); 63 this._cpuBarsElement = this._headerElement.createChild("div", "timeline-util ization-strip");
64 if (Runtime.experiments.isEnabled("gpuTimeline")) 64 if (Runtime.experiments.isEnabled("gpuTimeline"))
65 this._gpuBarsElement = this._headerElement.createChild("div", "timeline- utilization-strip gpu"); 65 this._gpuBarsElement = this._headerElement.createChild("div", "timeline- utilization-strip gpu");
66 66
67 this._popoverHelper = new WebInspector.PopoverHelper(this.element, this._get PopoverAnchor.bind(this), this._showPopover.bind(this)); 67 this._popoverHelper = new WebInspector.PopoverHelper(this.element, this._get PopoverAnchor.bind(this), this._showPopover.bind(this));
68 68
69 this.element.addEventListener("mousemove", this._mouseMove.bind(this), false ); 69 this.element.addEventListener("mousemove", this._mouseMove.bind(this), false );
70 this.element.addEventListener("mouseout", this._mouseOut.bind(this), false); 70 this.element.addEventListener("mouseleave", this._mouseLeave.bind(this), fal se);
71 this.element.addEventListener("keydown", this._keyDown.bind(this), false); 71 this.element.addEventListener("keydown", this._keyDown.bind(this), false);
72 72
73 this._expandOffset = 15; 73 this._expandOffset = 15;
74 } 74 }
75 75
76 WebInspector.TimelineView.prototype = { 76 WebInspector.TimelineView.prototype = {
77 /** 77 /**
78 * @param {?WebInspector.TimelineFrameModelBase} frameModel 78 * @param {?WebInspector.TimelineFrameModelBase} frameModel
79 */ 79 */
80 setFrameModel: function(frameModel) 80 setFrameModel: function(frameModel)
(...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after
715 * @param {!Event} event 715 * @param {!Event} event
716 * @return {!Element|!AnchorBox|undefined} 716 * @return {!Element|!AnchorBox|undefined}
717 */ 717 */
718 _getPopoverAnchor: function(element, event) 718 _getPopoverAnchor: function(element, event)
719 { 719 {
720 var anchor = element.enclosingNodeOrSelfWithClass("timeline-graph-bar"); 720 var anchor = element.enclosingNodeOrSelfWithClass("timeline-graph-bar");
721 if (anchor && anchor._tasksInfo) 721 if (anchor && anchor._tasksInfo)
722 return anchor; 722 return anchor;
723 }, 723 },
724 724
725 _mouseOut: function() 725 _mouseLeave: function()
726 { 726 {
727 this._hideQuadHighlight(); 727 this._hideQuadHighlight();
728 }, 728 },
729 729
730 /** 730 /**
731 * @param {!Event} e 731 * @param {!Event} e
732 */ 732 */
733 _mouseMove: function(e) 733 _mouseMove: function(e)
734 { 734 {
735 var rowElement = e.target.enclosingNodeOrSelfWithClass("timeline-tree-it em"); 735 var rowElement = e.target.enclosingNodeOrSelfWithClass("timeline-tree-it em");
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
1028 * @param {function(!WebInspector.TimelinePresentationModel.Record)} selectRecor d 1028 * @param {function(!WebInspector.TimelinePresentationModel.Record)} selectRecor d
1029 * @param {function()} scheduleRefresh 1029 * @param {function()} scheduleRefresh
1030 */ 1030 */
1031 WebInspector.TimelineRecordListRow = function(linkifier, selectRecord, scheduleR efresh) 1031 WebInspector.TimelineRecordListRow = function(linkifier, selectRecord, scheduleR efresh)
1032 { 1032 {
1033 this.element = createElement("div"); 1033 this.element = createElement("div");
1034 this.element.row = this; 1034 this.element.row = this;
1035 this.element.style.cursor = "pointer"; 1035 this.element.style.cursor = "pointer";
1036 this.element.addEventListener("click", this._onClick.bind(this), false); 1036 this.element.addEventListener("click", this._onClick.bind(this), false);
1037 this.element.addEventListener("mouseover", this._onMouseOver.bind(this), fal se); 1037 this.element.addEventListener("mouseover", this._onMouseOver.bind(this), fal se);
1038 this.element.addEventListener("mouseout", this._onMouseOut.bind(this), false ); 1038 this.element.addEventListener("mouseleave", this._onMouseLeave.bind(this), f alse);
1039 this._linkifier = linkifier; 1039 this._linkifier = linkifier;
1040 1040
1041 // Warning is float right block, it goes first. 1041 // Warning is float right block, it goes first.
1042 this._warningElement = this.element.createChild("div", "timeline-tree-item-w arning hidden"); 1042 this._warningElement = this.element.createChild("div", "timeline-tree-item-w arning hidden");
1043 1043
1044 this._expandArrowElement = this.element.createChild("div", "timeline-tree-it em-expand-arrow"); 1044 this._expandArrowElement = this.element.createChild("div", "timeline-tree-it em-expand-arrow");
1045 this._expandArrowElement.addEventListener("click", this._onExpandClick.bind( this), false); 1045 this._expandArrowElement.addEventListener("click", this._onExpandClick.bind( this), false);
1046 var iconElement = this.element.createChild("span", "timeline-tree-icon"); 1046 var iconElement = this.element.createChild("span", "timeline-tree-icon");
1047 this._typeElement = this.element.createChild("span", "type"); 1047 this._typeElement = this.element.createChild("span", "type");
1048 1048
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
1140 _onMouseOver: function(event) 1140 _onMouseOver: function(event)
1141 { 1141 {
1142 this.element.classList.add("hovered"); 1142 this.element.classList.add("hovered");
1143 if (this._record.graphRow()) 1143 if (this._record.graphRow())
1144 this._record.graphRow().element.classList.add("hovered"); 1144 this._record.graphRow().element.classList.add("hovered");
1145 }, 1145 },
1146 1146
1147 /** 1147 /**
1148 * @param {!Event} event 1148 * @param {!Event} event
1149 */ 1149 */
1150 _onMouseOut: function(event) 1150 _onMouseLeave: function(event)
1151 { 1151 {
1152 this.element.classList.remove("hovered"); 1152 this.element.classList.remove("hovered");
1153 if (this._record.graphRow()) 1153 if (this._record.graphRow())
1154 this._record.graphRow().element.classList.remove("hovered"); 1154 this._record.graphRow().element.classList.remove("hovered");
1155 } 1155 }
1156 } 1156 }
1157 1157
1158 /** 1158 /**
1159 * @constructor 1159 * @constructor
1160 * @param {!Element} graphContainer 1160 * @param {!Element} graphContainer
1161 * @param {function(!WebInspector.TimelinePresentationModel.Record)} selectRecor d 1161 * @param {function(!WebInspector.TimelinePresentationModel.Record)} selectRecor d
1162 * @param {function()} scheduleRefresh 1162 * @param {function()} scheduleRefresh
1163 */ 1163 */
1164 WebInspector.TimelineRecordGraphRow = function(graphContainer, selectRecord, sch eduleRefresh) 1164 WebInspector.TimelineRecordGraphRow = function(graphContainer, selectRecord, sch eduleRefresh)
1165 { 1165 {
1166 this.element = createElement("div"); 1166 this.element = createElement("div");
1167 this.element.row = this; 1167 this.element.row = this;
1168 this.element.addEventListener("mouseover", this._onMouseOver.bind(this), fal se); 1168 this.element.addEventListener("mouseover", this._onMouseOver.bind(this), fal se);
1169 this.element.addEventListener("mouseout", this._onMouseOut.bind(this), false ); 1169 this.element.addEventListener("mouseleave", this._onMouseLeave.bind(this), f alse);
1170 this.element.addEventListener("click", this._onClick.bind(this), false); 1170 this.element.addEventListener("click", this._onClick.bind(this), false);
1171 1171
1172 this._barAreaElement = this.element.createChild("div", "timeline-graph-bar-a rea"); 1172 this._barAreaElement = this.element.createChild("div", "timeline-graph-bar-a rea");
1173 1173
1174 this._barCpuElement = this._barAreaElement.createChild("div", "timeline-grap h-bar cpu"); 1174 this._barCpuElement = this._barAreaElement.createChild("div", "timeline-grap h-bar cpu");
1175 this._barCpuElement.row = this; 1175 this._barCpuElement.row = this;
1176 1176
1177 this._barElement = this._barAreaElement.createChild("div", "timeline-graph-b ar"); 1177 this._barElement = this._barAreaElement.createChild("div", "timeline-graph-b ar");
1178 this._barElement.row = this; 1178 this._barElement.row = this;
1179 1179
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
1239 _onMouseOver: function(event) 1239 _onMouseOver: function(event)
1240 { 1240 {
1241 this.element.classList.add("hovered"); 1241 this.element.classList.add("hovered");
1242 if (this._record.listRow()) 1242 if (this._record.listRow())
1243 this._record.listRow().element.classList.add("hovered"); 1243 this._record.listRow().element.classList.add("hovered");
1244 }, 1244 },
1245 1245
1246 /** 1246 /**
1247 * @param {!Event} event 1247 * @param {!Event} event
1248 */ 1248 */
1249 _onMouseOut: function(event) 1249 _onMouseLeave: function(event)
1250 { 1250 {
1251 this.element.classList.remove("hovered"); 1251 this.element.classList.remove("hovered");
1252 if (this._record.listRow()) 1252 if (this._record.listRow())
1253 this._record.listRow().element.classList.remove("hovered"); 1253 this._record.listRow().element.classList.remove("hovered");
1254 }, 1254 },
1255 1255
1256 dispose: function() 1256 dispose: function()
1257 { 1257 {
1258 this.element.remove(); 1258 this.element.remove();
1259 this._expandElement._dispose(); 1259 this._expandElement._dispose();
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
1297 } else { 1297 } else {
1298 this._element.classList.add("hidden"); 1298 this._element.classList.add("hidden");
1299 } 1299 }
1300 }, 1300 },
1301 1301
1302 _dispose: function() 1302 _dispose: function()
1303 { 1303 {
1304 this._element.remove(); 1304 this._element.remove();
1305 } 1305 }
1306 } 1306 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/timeline/Layers3DView.js ('k') | Source/devtools/front_end/ui/SoftContextMenu.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698