OLD | NEW |
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 819 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
830 _highlightQuad: function(rowElement) | 830 _highlightQuad: function(rowElement) |
831 { | 831 { |
832 if (!rowElement || !rowElement.row) | 832 if (!rowElement || !rowElement.row) |
833 return false; | 833 return false; |
834 var presentationRecord = rowElement.row._record; | 834 var presentationRecord = rowElement.row._record; |
835 if (presentationRecord.coalesced()) | 835 if (presentationRecord.coalesced()) |
836 return false; | 836 return false; |
837 var record = presentationRecord.record(); | 837 var record = presentationRecord.record(); |
838 if (this._highlightedQuadRecord === record) | 838 if (this._highlightedQuadRecord === record) |
839 return true; | 839 return true; |
840 this._highlightedQuadRecord = record; | |
841 | 840 |
842 var quad = this._uiUtils.highlightQuadForRecord(record); | 841 var quad = this._uiUtils.highlightQuadForRecord(record); |
843 if (!quad) | 842 var target = record.target(); |
| 843 if (!quad || !target) |
844 return false; | 844 return false; |
845 record.target().domAgent().highlightQuad(quad, WebInspector.Color.PageHi
ghlight.Content.toProtocolRGBA(), WebInspector.Color.PageHighlight.ContentOutlin
e.toProtocolRGBA()); | 845 this._highlightedQuadRecord = record; |
| 846 target.domAgent().highlightQuad(quad, WebInspector.Color.PageHighlight.C
ontent.toProtocolRGBA(), WebInspector.Color.PageHighlight.ContentOutline.toProto
colRGBA()); |
846 return true; | 847 return true; |
847 }, | 848 }, |
848 | 849 |
849 _hideQuadHighlight: function() | 850 _hideQuadHighlight: function() |
850 { | 851 { |
851 if (this._highlightedQuadRecord) { | 852 var target = this._highlightedQuadRecord ? this._highlightedQuadRecord.t
arget() : null; |
852 this._highlightedQuadRecord.target().domAgent().hideHighlight(); | 853 if (target) |
| 854 target.domAgent().hideHighlight(); |
| 855 |
| 856 if (this._highlightedQuadRecord) |
853 delete this._highlightedQuadRecord; | 857 delete this._highlightedQuadRecord; |
854 } | |
855 }, | 858 }, |
856 | 859 |
857 /** | 860 /** |
858 * @param {!Element} anchor | 861 * @param {!Element} anchor |
859 * @param {!WebInspector.Popover} popover | 862 * @param {!WebInspector.Popover} popover |
860 */ | 863 */ |
861 _showPopover: function(anchor, popover) | 864 _showPopover: function(anchor, popover) |
862 { | 865 { |
863 if (!anchor._tasksInfo) | 866 if (!anchor._tasksInfo) |
864 return; | 867 return; |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1074 | 1077 |
1075 if (this._dataElement.firstChild) | 1078 if (this._dataElement.firstChild) |
1076 this._dataElement.removeChildren(); | 1079 this._dataElement.removeChildren(); |
1077 | 1080 |
1078 this._warningElement.classList.toggle("hidden", !presentationRecord.hasW
arnings() && !presentationRecord.childHasWarnings()); | 1081 this._warningElement.classList.toggle("hidden", !presentationRecord.hasW
arnings() && !presentationRecord.childHasWarnings()); |
1079 this._warningElement.classList.toggle("timeline-tree-item-child-warning"
, presentationRecord.childHasWarnings() && !presentationRecord.hasWarnings()); | 1082 this._warningElement.classList.toggle("timeline-tree-item-child-warning"
, presentationRecord.childHasWarnings() && !presentationRecord.hasWarnings()); |
1080 | 1083 |
1081 if (presentationRecord.coalesced()) { | 1084 if (presentationRecord.coalesced()) { |
1082 this._dataElement.createTextChild(WebInspector.UIString("× %d", pres
entationRecord.presentationChildren().length)); | 1085 this._dataElement.createTextChild(WebInspector.UIString("× %d", pres
entationRecord.presentationChildren().length)); |
1083 } else { | 1086 } else { |
1084 var detailsNode = uiUtils.buildDetailsNode(record, this._linkifier,
loadedFromFile); | 1087 var detailsNode = uiUtils.buildDetailsNode(record, this._linkifier); |
1085 if (detailsNode) { | 1088 if (detailsNode) { |
1086 this._dataElement.createTextChild("("); | 1089 this._dataElement.createTextChild("("); |
1087 this._dataElement.appendChild(detailsNode); | 1090 this._dataElement.appendChild(detailsNode); |
1088 this._dataElement.createTextChild(")"); | 1091 this._dataElement.createTextChild(")"); |
1089 } | 1092 } |
1090 } | 1093 } |
1091 | 1094 |
1092 this._expandArrowElement.classList.toggle("parent", presentationRecord.e
xpandable()); | 1095 this._expandArrowElement.classList.toggle("parent", presentationRecord.e
xpandable()); |
1093 this._expandArrowElement.classList.toggle("expanded", !!presentationReco
rd.visibleChildrenCount()); | 1096 this._expandArrowElement.classList.toggle("expanded", !!presentationReco
rd.visibleChildrenCount()); |
1094 this._record.setListRow(this); | 1097 this._record.setListRow(this); |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1295 } else { | 1298 } else { |
1296 this._element.classList.add("hidden"); | 1299 this._element.classList.add("hidden"); |
1297 } | 1300 } |
1298 }, | 1301 }, |
1299 | 1302 |
1300 _dispose: function() | 1303 _dispose: function() |
1301 { | 1304 { |
1302 this._element.remove(); | 1305 this._element.remove(); |
1303 } | 1306 } |
1304 } | 1307 } |
OLD | NEW |