Chromium Code Reviews| 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 681 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 692 callSiteStackLabel = WebInspector.UIString("First layout invalidation"); | 692 callSiteStackLabel = WebInspector.UIString("First layout invalidation"); |
| 693 stackLabel = WebInspector.UIString("Layout forced"); | 693 stackLabel = WebInspector.UIString("Layout forced"); |
| 694 break; | 694 break; |
| 695 } | 695 } |
| 696 | 696 |
| 697 // Direct cause. | 697 // Direct cause. |
| 698 if (event.stackTrace) | 698 if (event.stackTrace) |
| 699 contentHelper.appendStackTrace(stackLabel || WebInspector.UIString("Stac k trace"), event.stackTrace); | 699 contentHelper.appendStackTrace(stackLabel || WebInspector.UIString("Stac k trace"), event.stackTrace); |
| 700 | 700 |
| 701 // Indirect causes. | 701 // Indirect causes. |
| 702 if (event.invalidationTrackingEvents) { // Full invalidation tracking (exper imental). | 702 if (event.invalidationTrackingEvents && target) { // Full invalidation track ing (experimental). |
| 703 WebInspector.TimelineUIUtils._generateInvalidations(event, target, conte ntHelper); | 703 WebInspector.TimelineUIUtils._generateInvalidations(event, target, conte ntHelper); |
| 704 } else if (initiator && initiator.stackTrace) { // Partial invalidation trac king. | 704 } else if (initiator && initiator.stackTrace) { // Partial invalidation trac king. |
| 705 contentHelper.appendStackTrace(callSiteStackLabel || WebInspector.UIStri ng("First invalidated"), initiator.stackTrace); | 705 contentHelper.appendStackTrace(callSiteStackLabel || WebInspector.UIStri ng("First invalidated"), initiator.stackTrace); |
| 706 } | 706 } |
| 707 } | 707 } |
| 708 | 708 |
| 709 /** | 709 /** |
| 710 * @param {!WebInspector.TracingModel.Event} event | 710 * @param {!WebInspector.TracingModel.Event} event |
| 711 * @param {?WebInspector.Target} target | 711 * @param {!WebInspector.Target} target |
| 712 * @param {!WebInspector.TimelineDetailsContentHelper} contentHelper | 712 * @param {!WebInspector.TimelineDetailsContentHelper} contentHelper |
| 713 */ | 713 */ |
| 714 WebInspector.TimelineUIUtils._generateInvalidations = function(event, target, co ntentHelper) | 714 WebInspector.TimelineUIUtils._generateInvalidations = function(event, target, co ntentHelper) |
| 715 { | 715 { |
| 716 if (!event.invalidationTrackingEvents) | 716 if (!event.invalidationTrackingEvents) |
| 717 return; | 717 return; |
| 718 | 718 |
| 719 var invalidations = {}; | 719 var invalidations = {}; |
| 720 event.invalidationTrackingEvents.forEach(function(invalidation) { | 720 event.invalidationTrackingEvents.forEach(function(invalidation) { |
| 721 if (!invalidations[invalidation.type]) | 721 if (!invalidations[invalidation.type]) |
| 722 invalidations[invalidation.type] = [invalidation]; | 722 invalidations[invalidation.type] = [invalidation]; |
| 723 else | 723 else |
| 724 invalidations[invalidation.type].push(invalidation); | 724 invalidations[invalidation.type].push(invalidation); |
| 725 }); | 725 }); |
| 726 | 726 |
| 727 Object.keys(invalidations).forEach(function(type) { | 727 Object.keys(invalidations).forEach(function(type) { |
| 728 WebInspector.TimelineUIUtils._generateInvalidationsForType( | 728 WebInspector.TimelineUIUtils._generateInvalidationsForType( |
| 729 type, target, invalidations[type], contentHelper); | 729 type, target, invalidations[type], contentHelper); |
| 730 }); | 730 }); |
| 731 } | 731 } |
| 732 | 732 |
| 733 /** | 733 /** |
| 734 * @param {string} type | 734 * @param {string} type |
| 735 * @param {?WebInspector.Target} target | 735 * @param {!WebInspector.Target} target |
| 736 * @param {!Array.<!WebInspector.InvalidationTrackingEvent>} invalidations | 736 * @param {!Array.<!WebInspector.InvalidationTrackingEvent>} invalidations |
| 737 * @param {!WebInspector.TimelineDetailsContentHelper} contentHelper | 737 * @param {!WebInspector.TimelineDetailsContentHelper} contentHelper |
| 738 */ | 738 */ |
| 739 WebInspector.TimelineUIUtils._generateInvalidationsForType = function(type, targ et, invalidations, contentHelper) | 739 WebInspector.TimelineUIUtils._generateInvalidationsForType = function(type, targ et, invalidations, contentHelper) |
| 740 { | 740 { |
| 741 var title; | 741 var title; |
| 742 switch (type) { | 742 switch (type) { |
| 743 case WebInspector.TimelineModel.RecordType.StyleRecalcInvalidationTracking: | 743 case WebInspector.TimelineModel.RecordType.StyleRecalcInvalidationTracking: |
| 744 title = WebInspector.UIString("Style invalidations"); | 744 title = WebInspector.UIString("Style invalidations"); |
| 745 break; | 745 break; |
| 746 case WebInspector.TimelineModel.RecordType.LayoutInvalidationTracking: | 746 case WebInspector.TimelineModel.RecordType.LayoutInvalidationTracking: |
| 747 title = WebInspector.UIString("Layout invalidations"); | 747 title = WebInspector.UIString("Layout invalidations"); |
| 748 break; | 748 break; |
| 749 default: | 749 default: |
| 750 title = WebInspector.UIString("Other invalidations"); | 750 title = WebInspector.UIString("Other invalidations"); |
| 751 break; | 751 break; |
| 752 } | 752 } |
| 753 | 753 |
| 754 var detailsNode = createElementWithClass("div", "timeline-details-view-row") ; | 754 var detailsNode = createElementWithClass("div", "timeline-details-view-row") ; |
| 755 var titleElement = detailsNode.createChild("span", "timeline-details-view-ro w-title"); | 755 var titleElement = detailsNode.createChild("span", "timeline-details-view-ro w-title"); |
| 756 titleElement.textContent = WebInspector.UIString("%s: ", title); | 756 titleElement.textContent = WebInspector.UIString("%s: ", title); |
| 757 var eventsList = detailsNode.createChild("div", "timeline-details-view-row-v alue"); | 757 |
| 758 var invalidationsTreeOutline = new TreeOutlineInShadow(); | |
| 759 invalidationsTreeOutline.registerRequiredCSS("timeline/invalidationsTree.css "); | |
| 760 invalidationsTreeOutline.element.classList.add("timeline-details-view-row-va lue"); | |
|
pfeldman
2015/04/09 10:15:52
classList.add(a, b, c) would work.
pdr.
2015/04/09 18:20:34
Done.
| |
| 761 invalidationsTreeOutline.element.classList.add("invalidations-tree"); | |
| 762 detailsNode.appendChild(invalidationsTreeOutline.element); | |
| 763 | |
| 758 var invalidationGroups = groupInvalidationsByCause(invalidations); | 764 var invalidationGroups = groupInvalidationsByCause(invalidations); |
| 759 invalidationGroups.forEach(function(group) { | 765 invalidationGroups.forEach(function(group) { |
| 760 appendInvalidationGroup(eventsList, group); | 766 var groupElement = new WebInspector.TimelineUIUtils.InvalidationsGroupEl ement(target, contentHelper, group); |
| 767 invalidationsTreeOutline.appendChild(groupElement); | |
| 761 }); | 768 }); |
| 762 contentHelper.element.appendChild(detailsNode); | 769 contentHelper.element.appendChild(detailsNode); |
| 763 | 770 |
| 764 /** | 771 /** |
| 765 * @param {!Array.<!WebInspector.InvalidationTrackingEvent>} invalidations | 772 * @param {!Array.<!WebInspector.InvalidationTrackingEvent>} invalidations |
| 766 */ | 773 */ |
| 767 function groupInvalidationsByCause(invalidations) | 774 function groupInvalidationsByCause(invalidations) |
| 768 { | 775 { |
| 769 var causeToInvalidationMap = {}; | 776 var causeToInvalidationMap = {}; |
| 770 for (var index = 0; index < invalidations.length; index++) { | 777 for (var index = 0; index < invalidations.length; index++) { |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 782 }); | 789 }); |
| 783 } | 790 } |
| 784 | 791 |
| 785 if (causeToInvalidationMap[causeKey]) | 792 if (causeToInvalidationMap[causeKey]) |
| 786 causeToInvalidationMap[causeKey].push(invalidation); | 793 causeToInvalidationMap[causeKey].push(invalidation); |
| 787 else | 794 else |
| 788 causeToInvalidationMap[causeKey] = [ invalidation ]; | 795 causeToInvalidationMap[causeKey] = [ invalidation ]; |
| 789 } | 796 } |
| 790 return Object.values(causeToInvalidationMap); | 797 return Object.values(causeToInvalidationMap); |
| 791 } | 798 } |
| 799 } | |
| 800 | |
| 801 /** | |
| 802 * @param {!Set<number>} nodeIds | |
| 803 * @param {!WebInspector.InvalidationTrackingEvent} invalidations | |
| 804 */ | |
| 805 WebInspector.TimelineUIUtils._collectInvalidationNodeIds = function(nodeIds, inv alidations) | |
| 806 { | |
| 807 for (var i = 0; i < invalidations.length; ++i) { | |
| 808 if (invalidations[i].nodeId) | |
| 809 nodeIds.add(invalidations[i].nodeId); | |
| 810 } | |
| 811 } | |
| 812 | |
| 813 /** | |
| 814 * @constructor | |
| 815 * @param {!WebInspector.Target} target | |
| 816 * @param {!WebInspector.TimelineDetailsContentHelper} contentHelper | |
| 817 * @param {!Array.<!WebInspector.InvalidationTrackingEvent>} invalidations | |
| 818 * @extends {TreeElement} | |
| 819 */ | |
| 820 WebInspector.TimelineUIUtils.InvalidationsGroupElement = function(target, conten tHelper, invalidations) | |
| 821 { | |
| 822 TreeElement.call(this, "", true); | |
| 823 | |
| 824 this.listItemElement.classList.add("header"); | |
| 825 this.selectable = false; | |
| 826 this.toggleOnClick = true; | |
| 827 | |
| 828 this._contentHelper = contentHelper; | |
| 829 this._invalidations = invalidations; | |
| 830 this.title = this._createTitle(target); | |
| 831 } | |
| 832 | |
| 833 WebInspector.TimelineUIUtils.InvalidationsGroupElement.prototype = { | |
| 834 | |
| 835 /** | |
| 836 * @param {!WebInspector.Target} target | |
| 837 * @return {!Element} | |
| 838 */ | |
| 839 _createTitle: function(target) | |
| 840 { | |
| 841 var first = this._invalidations[0]; | |
| 842 var reason = first.cause.reason; | |
| 843 var topFrame = first.cause.stackTrace && first.cause.stackTrace[0]; | |
| 844 | |
| 845 var title = createElement("span"); | |
| 846 if (reason) | |
| 847 title.createTextChild(WebInspector.UIString("%s for ", reason)); | |
| 848 else | |
| 849 title.createTextChild(WebInspector.UIString("Unknown cause for ")); | |
| 850 | |
| 851 this._appendTruncatedNodeList(title, this._invalidations); | |
| 852 | |
| 853 if (topFrame && this._contentHelper.linkifier()) { | |
| 854 title.createTextChild(WebInspector.UIString(". ")); | |
| 855 var stack = title.createChild("span", "monospace"); | |
| 856 stack.createChild("span").textContent = WebInspector.beautifyFunctio nName(topFrame.functionName); | |
| 857 stack.createChild("span").textContent = " @ "; | |
| 858 stack.createChild("span").appendChild(this._contentHelper.linkifier( ).linkifyConsoleCallFrame(target, topFrame)); | |
| 859 } | |
| 860 | |
| 861 return title; | |
| 862 }, | |
| 863 | |
| 864 /** | |
| 865 * @override | |
| 866 */ | |
| 867 onpopulate: function() | |
| 868 { | |
| 869 var content = createElementWithClass("div", "content"); | |
| 870 | |
| 871 var first = this._invalidations[0]; | |
| 872 if (first.cause.stackTrace) { | |
| 873 var stack = content.createChild("div"); | |
| 874 stack.createTextChild(WebInspector.UIString("Stack trace:")); | |
| 875 this._contentHelper.createChildStackTraceElement(stack, first.cause. stackTrace); | |
| 876 } | |
| 877 | |
| 878 content.createTextChild(this._invalidations.length > 1 ? WebInspector.UI String("Nodes:") : WebInspector.UIString("Node:")); | |
| 879 var nodeList = content.createChild("div", "node-list"); | |
| 880 var firstNode = true; | |
| 881 for (var i = 0; i < this._invalidations.length; i++) { | |
| 882 var invalidation = this._invalidations[i]; | |
| 883 var invalidationNode = this._createInvalidationNode(invalidation, tr ue); | |
| 884 if (invalidationNode) { | |
| 885 if (!firstNode) | |
| 886 nodeList.createTextChild(WebInspector.UIString(", ")); | |
| 887 firstNode = false; | |
| 888 | |
| 889 nodeList.appendChild(invalidationNode); | |
| 890 | |
| 891 var extraData = invalidation.extraData ? ", " + invalidation.ext raData : ""; | |
| 892 if (invalidation.changedId) { | |
|
pfeldman
2015/04/09 10:15:52
All one-liners? Drop the {}!
pdr.
2015/04/09 18:20:34
Dropped. -20bytes!
| |
| 893 nodeList.createTextChild(WebInspector.UIString("(changed id to \"%s\"%s)", invalidation.changedId, extraData)); | |
| 894 } else if (invalidation.changedClass) { | |
| 895 nodeList.createTextChild(WebInspector.UIString("(changed cla ss to \"%s\"%s)", invalidation.changedClass, extraData)); | |
| 896 } else if (invalidation.changedAttribute) { | |
| 897 nodeList.createTextChild(WebInspector.UIString("(changed att ribute to \"%s\"%s)", invalidation.changedAttribute, extraData)); | |
| 898 } else if (invalidation.changedPseudo) { | |
| 899 nodeList.createTextChild(WebInspector.UIString("(changed pes udo to \"%s\"%s)", invalidation.changedPseudo, extraData)); | |
| 900 } else if (invalidation.selectorPart) { | |
| 901 nodeList.createTextChild(WebInspector.UIString("(changed \"% s\"%s)", invalidation.selectorPart, extraData)); | |
| 902 } | |
| 903 } | |
| 904 } | |
| 905 | |
| 906 var contentTreeElement = new TreeElement(content, false); | |
| 907 contentTreeElement.selectable = false; | |
| 908 this.appendChild(contentTreeElement); | |
| 909 }, | |
| 792 | 910 |
| 793 /** | 911 /** |
| 794 * @param {!Element} parentElement | 912 * @param {!Element} parentElement |
| 795 * @param {!Array.<!WebInspector.InvalidationTrackingEvent>} invalidations | 913 * @param {!Array.<!WebInspector.InvalidationTrackingEvent>} invalidations |
| 796 */ | 914 */ |
| 797 function appendInvalidationGroup(parentElement, invalidations) | 915 _appendTruncatedNodeList: function(parentElement, invalidations) |
| 798 { | |
| 799 if (!target) | |
| 800 return; | |
| 801 | |
| 802 var row = parentElement.createChild("div", "invalidations-group section" ); | |
| 803 var header = row.createChild("div", "header"); | |
| 804 header.addEventListener("click", function() { | |
| 805 toggleDetails(header, invalidations); | |
| 806 }); | |
| 807 | |
| 808 var first = invalidations[0]; | |
| 809 var reason = first.cause.reason; | |
| 810 var topFrame = first.cause.stackTrace && first.cause.stackTrace[0]; | |
| 811 | |
| 812 if (reason) | |
| 813 header.createTextChild(WebInspector.UIString("%s for ", reason)); | |
| 814 else | |
| 815 header.createTextChild(WebInspector.UIString("Unknown cause for ")); | |
| 816 | |
| 817 appendTruncatedNodeList(header, invalidations); | |
| 818 | |
| 819 if (topFrame && contentHelper.linkifier()) { | |
| 820 header.createTextChild(WebInspector.UIString(". ")); | |
| 821 var stack = header.createChild("span", "monospace"); | |
| 822 | |
| 823 stack.createChild("span").textContent = WebInspector.beautifyFunctio nName(topFrame.functionName); | |
| 824 stack.createChild("span").textContent = " @ "; | |
| 825 stack.createChild("span").appendChild(contentHelper.linkifier().link ifyConsoleCallFrame(target, topFrame)); | |
| 826 } | |
| 827 } | |
| 828 | |
| 829 /** | |
| 830 * @param {!WebInspector.InvalidationTrackingEvent} invalidation | |
| 831 * @param {boolean} showUnknownNodes | |
| 832 */ | |
| 833 function createInvalidationNode(invalidation, showUnknownNodes) | |
| 834 { | |
| 835 var node = contentHelper.nodeForBackendId(invalidation.nodeId); | |
| 836 if (node) | |
| 837 return WebInspector.DOMPresentationUtils.linkifyNodeReference(node); | |
| 838 if (invalidation.nodeName) { | |
| 839 var nodeSpan = createElement("span"); | |
| 840 nodeSpan.textContent = WebInspector.UIString("[ %s ]", invalidation. nodeName); | |
| 841 return nodeSpan; | |
| 842 } | |
| 843 if (showUnknownNodes) { | |
| 844 var nodeSpan = createElement("span"); | |
| 845 return nodeSpan.createTextChild(WebInspector.UIString("[ unknown nod e ]")); | |
| 846 } | |
| 847 } | |
| 848 | |
| 849 /** | |
| 850 * @param {!Element} parentElement | |
| 851 * @param {!Array.<!WebInspector.InvalidationTrackingEvent>} invalidations | |
| 852 */ | |
| 853 function appendTruncatedNodeList(parentElement, invalidations) | |
| 854 { | 916 { |
| 855 var invalidationNodes = []; | 917 var invalidationNodes = []; |
| 856 var invalidationNodeIdMap = {}; | 918 var invalidationNodeIdMap = {}; |
| 857 for (var i = 0; i < invalidations.length; i++) { | 919 for (var i = 0; i < invalidations.length; i++) { |
| 858 var invalidation = invalidations[i]; | 920 var invalidation = invalidations[i]; |
| 859 var invalidationNode = createInvalidationNode(invalidation, false); | 921 var invalidationNode = this._createInvalidationNode(invalidation, fa lse); |
| 922 invalidationNode.addEventListener("click", consumeEvent, false); | |
| 860 if (invalidationNode && !invalidationNodeIdMap[invalidation.nodeId]) { | 923 if (invalidationNode && !invalidationNodeIdMap[invalidation.nodeId]) { |
| 861 invalidationNodes.push(invalidationNode); | 924 invalidationNodes.push(invalidationNode); |
| 862 invalidationNodeIdMap[invalidation.nodeId] = true; | 925 invalidationNodeIdMap[invalidation.nodeId] = true; |
| 863 } | 926 } |
| 864 } | 927 } |
| 865 | 928 |
| 866 if (invalidationNodes.length === 1) { | 929 if (invalidationNodes.length === 1) { |
| 867 parentElement.appendChild(invalidationNodes[0]); | 930 parentElement.appendChild(invalidationNodes[0]); |
| 868 } else if (invalidationNodes.length === 2) { | 931 } else if (invalidationNodes.length === 2) { |
| 869 parentElement.appendChild(invalidationNodes[0]); | 932 parentElement.appendChild(invalidationNodes[0]); |
| 870 parentElement.createTextChild(WebInspector.UIString(" and ")); | 933 parentElement.createTextChild(WebInspector.UIString(" and ")); |
| 871 parentElement.appendChild(invalidationNodes[1]); | 934 parentElement.appendChild(invalidationNodes[1]); |
| 872 } else if (invalidationNodes.length >= 3) { | 935 } else if (invalidationNodes.length >= 3) { |
| 873 parentElement.appendChild(invalidationNodes[0]); | 936 parentElement.appendChild(invalidationNodes[0]); |
| 874 parentElement.createTextChild(WebInspector.UIString(", ")); | 937 parentElement.createTextChild(WebInspector.UIString(", ")); |
| 875 parentElement.appendChild(invalidationNodes[1]); | 938 parentElement.appendChild(invalidationNodes[1]); |
| 876 parentElement.createTextChild(WebInspector.UIString(", and %s others ", invalidationNodes.length - 2)); | 939 parentElement.createTextChild(WebInspector.UIString(", and %s others ", invalidationNodes.length - 2)); |
| 877 } | 940 } |
| 878 } | 941 |
| 942 /** | |
| 943 * Consume clicks on nodes to prevent tree element expansion. | |
| 944 * @param {!Event} event | |
| 945 */ | |
| 946 function consumeEvent(event) | |
|
pfeldman
2015/04/09 10:15:52
You don't seem to need to preventDefault, so you c
pdr.
2015/04/09 18:20:34
Oh my.. Didn't realize this already existed.
| |
| 947 { | |
| 948 event.consume(true); | |
| 949 return; | |
| 950 } | |
| 951 }, | |
| 879 | 952 |
| 880 /** | 953 /** |
| 881 * @param {!Element} header | 954 * @param {!WebInspector.InvalidationTrackingEvent} invalidation |
| 882 * @param {!Array.<!WebInspector.InvalidationTrackingEvent>} invalidations | 955 * @param {boolean} showUnknownNodes |
| 883 */ | 956 */ |
| 884 function toggleDetails(header, invalidations) | 957 _createInvalidationNode: function(invalidation, showUnknownNodes) |
| 885 { | 958 { |
| 886 var wasExpanded = header.classList.contains("expanded"); | 959 var node = this._contentHelper.nodeForBackendId(invalidation.nodeId); |
| 887 header.classList.toggle("expanded", !wasExpanded); | 960 if (node) |
| 888 header.parentElement.classList.toggle("expanded", !wasExpanded); | 961 return WebInspector.DOMPresentationUtils.linkifyNodeReference(node); |
| 962 if (invalidation.nodeName) { | |
| 963 var nodeSpan = createElement("span"); | |
| 964 nodeSpan.textContent = WebInspector.UIString("[ %s ]", invalidation. nodeName); | |
| 965 return nodeSpan; | |
| 966 } | |
| 967 if (showUnknownNodes) { | |
| 968 var nodeSpan = createElement("span"); | |
| 969 return nodeSpan.createTextChild(WebInspector.UIString("[ unknown nod e ]")); | |
| 970 } | |
| 971 }, | |
| 889 | 972 |
| 890 if (wasExpanded) { | 973 __proto__: TreeElement.prototype |
| 891 var content = header.nextElementSibling; | |
| 892 if (content) | |
| 893 content.remove(); | |
| 894 } else { | |
| 895 createInvalidationGroupDetails(header.parentElement, invalidations); | |
| 896 } | |
| 897 } | |
| 898 | |
| 899 /** | |
| 900 * @param {!Element} parentElement | |
| 901 * @param {!Array.<!WebInspector.InvalidationTrackingEvent>} invalidations | |
| 902 */ | |
| 903 function createInvalidationGroupDetails(parentElement, invalidations) | |
| 904 { | |
| 905 var content = parentElement.createChild("div", "content"); | |
| 906 | |
| 907 var first = invalidations[0]; | |
| 908 if (first.cause.stackTrace) { | |
| 909 var stack = content.createChild("div"); | |
| 910 stack.createTextChild(WebInspector.UIString("Stack trace:")); | |
| 911 contentHelper.createChildStackTraceElement(stack, first.cause.stackT race); | |
| 912 } | |
| 913 | |
| 914 content.createTextChild(invalidations.length > 1 ? WebInspector.UIString ("Nodes:") : WebInspector.UIString("Node:")); | |
| 915 var nodeList = content.createChild("div", "node-list timeline-details-vi ew-row-stack-trace"); | |
| 916 appendDetailedNodeList(nodeList, invalidations); | |
| 917 } | |
| 918 | |
| 919 /** | |
| 920 * @param {!Element} parentElement | |
| 921 * @param {!Array.<!WebInspector.InvalidationTrackingEvent>} invalidations | |
| 922 */ | |
| 923 function appendDetailedNodeList(parentElement, invalidations) | |
| 924 { | |
| 925 var firstNode = true; | |
| 926 for (var i = 0; i < invalidations.length; i++) { | |
| 927 var invalidation = invalidations[i]; | |
| 928 var invalidationNode = createInvalidationNode(invalidation, true); | |
| 929 if (invalidationNode) { | |
| 930 if (!firstNode) | |
| 931 parentElement.createTextChild(WebInspector.UIString(", ")); | |
| 932 firstNode = false; | |
| 933 | |
| 934 parentElement.appendChild(invalidationNode); | |
| 935 | |
| 936 var extraData = invalidation.extraData ? ", " + invalidation.ext raData : ""; | |
| 937 if (invalidation.changedId) { | |
| 938 parentElement.createTextChild(WebInspector.UIString("(change d id to \"%s\"%s)", invalidation.changedId, extraData)); | |
| 939 } else if (invalidation.changedClass) { | |
| 940 parentElement.createTextChild(WebInspector.UIString("(change d class to \"%s\"%s)", invalidation.changedClass, extraData)); | |
| 941 } else if (invalidation.changedAttribute) { | |
| 942 parentElement.createTextChild(WebInspector.UIString("(change d attribute to \"%s\"%s)", invalidation.changedAttribute, extraData)); | |
| 943 } else if (invalidation.changedPseudo) { | |
| 944 parentElement.createTextChild(WebInspector.UIString("(change d pesudo to \"%s\"%s)", invalidation.changedPseudo, extraData)); | |
| 945 } else if (invalidation.selectorPart) { | |
| 946 parentElement.createTextChild(WebInspector.UIString("(change d \"%s\"%s)", invalidation.selectorPart, extraData)); | |
| 947 } | |
| 948 } | |
| 949 } | |
| 950 } | |
| 951 } | 974 } |
| 952 | 975 |
| 953 /** | 976 /** |
| 954 * @param {!Set<number>} nodeIds | |
| 955 * @param {!WebInspector.InvalidationTrackingEvent} invalidations | |
| 956 */ | |
| 957 WebInspector.TimelineUIUtils._collectInvalidationNodeIds = function(nodeIds, inv alidations) | |
| 958 { | |
| 959 for (var i = 0; i < invalidations.length; ++i) { | |
| 960 if (invalidations[i].nodeId) | |
| 961 nodeIds.add(invalidations[i].nodeId); | |
| 962 } | |
| 963 } | |
| 964 | |
| 965 /** | |
| 966 * @param {!Object} total | 977 * @param {!Object} total |
| 967 * @param {!WebInspector.TimelineModel.Record} record | 978 * @param {!WebInspector.TimelineModel.Record} record |
| 968 */ | 979 */ |
| 969 WebInspector.TimelineUIUtils.aggregateTimeForRecord = function(total, record) | 980 WebInspector.TimelineUIUtils.aggregateTimeForRecord = function(total, record) |
| 970 { | 981 { |
| 971 var traceEvent = record.traceEvent(); | 982 var traceEvent = record.traceEvent(); |
| 972 var model = record.timelineModel(); | 983 var model = record.timelineModel(); |
| 973 WebInspector.TimelineUIUtils._aggregatedStatsForTraceEvent(total, model, tra ceEvent); | 984 WebInspector.TimelineUIUtils._aggregatedStatsForTraceEvent(total, model, tra ceEvent); |
| 974 } | 985 } |
| 975 | 986 |
| (...skipping 869 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1845 return; | 1856 return; |
| 1846 | 1857 |
| 1847 var stackTraceElement = parentElement.createChild("div", "timeline-detai ls-view-row-value timeline-details-view-row-stack-trace monospace"); | 1858 var stackTraceElement = parentElement.createChild("div", "timeline-detai ls-view-row-value timeline-details-view-row-stack-trace monospace"); |
| 1848 | 1859 |
| 1849 var callFrameElem = WebInspector.DOMPresentationUtils.buildStackTracePre viewContents(this._target, this._linkifier, stackTrace); | 1860 var callFrameElem = WebInspector.DOMPresentationUtils.buildStackTracePre viewContents(this._target, this._linkifier, stackTrace); |
| 1850 | 1861 |
| 1851 stackTraceElement.appendChild(callFrameElem); | 1862 stackTraceElement.appendChild(callFrameElem); |
| 1852 } | 1863 } |
| 1853 | 1864 |
| 1854 } | 1865 } |
| OLD | NEW |