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, 2009 Anthony Ricaud <rik@webkit.org> | 3 * Copyright (C) 2008, 2009 Anthony Ricaud <rik@webkit.org> |
4 * Copyright (C) 2011 Google Inc. All rights reserved. | 4 * Copyright (C) 2011 Google Inc. All rights reserved. |
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 2537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2548 { | 2548 { |
2549 WebInspector.SortableDataGridNode.call(this, {}); | 2549 WebInspector.SortableDataGridNode.call(this, {}); |
2550 this._parentView = parentView; | 2550 this._parentView = parentView; |
2551 this._request = request; | 2551 this._request = request; |
2552 this._linkifier = new WebInspector.Linkifier(); | 2552 this._linkifier = new WebInspector.Linkifier(); |
2553 this._isFilteredOut = true; | 2553 this._isFilteredOut = true; |
2554 this._isMatchingSearchQuery = false; | 2554 this._isMatchingSearchQuery = false; |
2555 this._staleGraph = true; | 2555 this._staleGraph = true; |
2556 } | 2556 } |
2557 | 2557 |
| 2558 WebInspector.NetworkDataGridNode._hoveredRowSymbol = Symbol("hoveredRow"); |
| 2559 |
2558 WebInspector.NetworkDataGridNode.prototype = { | 2560 WebInspector.NetworkDataGridNode.prototype = { |
2559 /** | 2561 /** |
2560 * @return {!WebInspector.NetworkRequest} | 2562 * @return {!WebInspector.NetworkRequest} |
2561 */ | 2563 */ |
2562 request: function() | 2564 request: function() |
2563 { | 2565 { |
2564 return this._request; | 2566 return this._request; |
2565 }, | 2567 }, |
2566 | 2568 |
2567 /** | 2569 /** |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2710 | 2712 |
2711 this._barRightElement = this._barAreaElement.createChild("div", "network
-graph-bar"); | 2713 this._barRightElement = this._barAreaElement.createChild("div", "network
-graph-bar"); |
2712 this._barRightElement.classList.add(type); | 2714 this._barRightElement.classList.add(type); |
2713 this._barRightElement.classList.toggle("cached", cached); | 2715 this._barRightElement.classList.toggle("cached", cached); |
2714 | 2716 |
2715 this._labelLeftElement = this._barAreaElement.createChild("div", "networ
k-graph-label"); | 2717 this._labelLeftElement = this._barAreaElement.createChild("div", "networ
k-graph-label"); |
2716 this._labelLeftElement.classList.add("waiting"); | 2718 this._labelLeftElement.classList.add("waiting"); |
2717 | 2719 |
2718 this._labelRightElement = this._barAreaElement.createChild("div", "netwo
rk-graph-label"); | 2720 this._labelRightElement = this._barAreaElement.createChild("div", "netwo
rk-graph-label"); |
2719 | 2721 |
2720 cell.addEventListener("mouseover", this._refreshLabelPositions.bind(this
), false); | 2722 cell.addEventListener("mouseover", this._onMouseOver.bind(this), false); |
2721 }, | 2723 }, |
2722 | 2724 |
2723 /** | 2725 /** |
| 2726 * @param {!Event} event |
| 2727 */ |
| 2728 _onMouseOver: function(event) |
| 2729 { |
| 2730 this._refreshLabelPositions(); |
| 2731 this._parentView[WebInspector.NetworkDataGridNode._hoveredRowSymbol] = t
his; |
| 2732 }, |
| 2733 |
| 2734 /** |
2724 * @return {boolean} | 2735 * @return {boolean} |
2725 */ | 2736 */ |
2726 _isFailed: function() | 2737 _isFailed: function() |
2727 { | 2738 { |
2728 return (this._request.failed && !this._request.statusCode) || (this._req
uest.statusCode >= 400); | 2739 return (this._request.failed && !this._request.statusCode) || (this._req
uest.statusCode >= 400); |
2729 }, | 2740 }, |
2730 | 2741 |
2731 /** | 2742 /** |
2732 * @param {!Element} cell | 2743 * @param {!Element} cell |
2733 */ | 2744 */ |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2900 | 2911 |
2901 var labels = calculator.computeBarGraphLabels(this._request); | 2912 var labels = calculator.computeBarGraphLabels(this._request); |
2902 this._labelLeftElement.textContent = labels.left; | 2913 this._labelLeftElement.textContent = labels.left; |
2903 this._labelRightElement.textContent = labels.right; | 2914 this._labelRightElement.textContent = labels.right; |
2904 | 2915 |
2905 var tooltip = (labels.tooltip || ""); | 2916 var tooltip = (labels.tooltip || ""); |
2906 this._barLeftElement.title = tooltip; | 2917 this._barLeftElement.title = tooltip; |
2907 this._labelLeftElement.title = tooltip; | 2918 this._labelLeftElement.title = tooltip; |
2908 this._labelRightElement.title = tooltip; | 2919 this._labelRightElement.title = tooltip; |
2909 this._barRightElement.title = tooltip; | 2920 this._barRightElement.title = tooltip; |
| 2921 |
| 2922 if (this._parentView[WebInspector.NetworkDataGridNode._hoveredRowSymbol]
=== this) |
| 2923 this._refreshLabelPositions(); |
2910 }, | 2924 }, |
2911 | 2925 |
2912 _refreshLabelPositions: function() | 2926 _refreshLabelPositions: function() |
2913 { | 2927 { |
2914 if (!this._percentages) | 2928 if (!this._percentages) |
2915 return; | 2929 return; |
2916 this._labelLeftElement.style.removeProperty("left"); | 2930 this._labelLeftElement.style.removeProperty("left"); |
2917 this._labelLeftElement.style.removeProperty("right"); | 2931 this._labelLeftElement.style.removeProperty("right"); |
2918 this._labelLeftElement.classList.remove("before"); | 2932 this._labelLeftElement.classList.remove("before"); |
2919 this._labelLeftElement.classList.remove("hidden"); | 2933 this._labelLeftElement.classList.remove("hidden"); |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3131 | 3145 |
3132 WebInspector.NetworkPanelFactory.prototype = { | 3146 WebInspector.NetworkPanelFactory.prototype = { |
3133 /** | 3147 /** |
3134 * @return {!WebInspector.Panel} | 3148 * @return {!WebInspector.Panel} |
3135 */ | 3149 */ |
3136 createPanel: function() | 3150 createPanel: function() |
3137 { | 3151 { |
3138 return WebInspector.NetworkPanel._instance(); | 3152 return WebInspector.NetworkPanel._instance(); |
3139 } | 3153 } |
3140 } | 3154 } |
OLD | NEW |