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

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

Issue 1048663002: [invalidations] Convert invalidations to use TreeOutline (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 8 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
« no previous file with comments | « no previous file | Source/devtools/front_end/timeline/timelinePanel.css » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 781 matching lines...) Expand 10 before | Expand all | Expand 10 after
792 792
793 /** 793 /**
794 * @param {!Element} parentElement 794 * @param {!Element} parentElement
795 * @param {!Array.<!WebInspector.InvalidationTrackingEvent>} invalidations 795 * @param {!Array.<!WebInspector.InvalidationTrackingEvent>} invalidations
796 */ 796 */
797 function appendInvalidationGroup(parentElement, invalidations) 797 function appendInvalidationGroup(parentElement, invalidations)
798 { 798 {
799 if (!target) 799 if (!target)
800 return; 800 return;
801 801
802 var row = parentElement.createChild("div", "invalidations-group section" ); 802 var row = parentElement.createChild("div", "invalidations-group");
803 var header = row.createChild("div", "header"); 803 var header = row.createChild("div", "invalidations-header timeline-expan dable-collapsed");
804 header.createChild("div", "timeline-expandable-arrow");
caseq 2015/03/30 17:38:28 Did you consider using TreeOutline here?
804 header.addEventListener("click", function() { 805 header.addEventListener("click", function() {
805 toggleDetails(header, invalidations); 806 toggleDetails(row, header, invalidations);
806 }); 807 });
807 808
808 var first = invalidations[0]; 809 var first = invalidations[0];
809 var reason = first.cause.reason; 810 var reason = first.cause.reason;
810 var topFrame = first.cause.stackTrace && first.cause.stackTrace[0]; 811 var topFrame = first.cause.stackTrace && first.cause.stackTrace[0];
811 812
812 if (reason) 813 if (reason)
813 header.createTextChild(WebInspector.UIString("%s for ", reason)); 814 header.createTextChild(WebInspector.UIString("%s for ", reason));
814 else 815 else
815 header.createTextChild(WebInspector.UIString("Unknown cause for ")); 816 header.createTextChild(WebInspector.UIString("Unknown cause for "));
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
871 parentElement.appendChild(invalidationNodes[1]); 872 parentElement.appendChild(invalidationNodes[1]);
872 } else if (invalidationNodes.length >= 3) { 873 } else if (invalidationNodes.length >= 3) {
873 parentElement.appendChild(invalidationNodes[0]); 874 parentElement.appendChild(invalidationNodes[0]);
874 parentElement.createTextChild(WebInspector.UIString(", ")); 875 parentElement.createTextChild(WebInspector.UIString(", "));
875 parentElement.appendChild(invalidationNodes[1]); 876 parentElement.appendChild(invalidationNodes[1]);
876 parentElement.createTextChild(WebInspector.UIString(", and %s others ", invalidationNodes.length - 2)); 877 parentElement.createTextChild(WebInspector.UIString(", and %s others ", invalidationNodes.length - 2));
877 } 878 }
878 } 879 }
879 880
880 /** 881 /**
882 * @param {!Element} row
881 * @param {!Element} header 883 * @param {!Element} header
882 * @param {!Array.<!WebInspector.InvalidationTrackingEvent>} invalidations 884 * @param {!Array.<!WebInspector.InvalidationTrackingEvent>} invalidations
883 */ 885 */
884 function toggleDetails(header, invalidations) 886 function toggleDetails(row, header, invalidations)
885 { 887 {
886 var wasExpanded = header.classList.contains("expanded"); 888 var wasExpanded = header.classList.contains("timeline-expandable-expande d");
887 header.classList.toggle("expanded", !wasExpanded); 889 header.classList.toggle("timeline-expandable-collapsed", wasExpanded);
888 header.parentElement.classList.toggle("expanded", !wasExpanded); 890 header.classList.toggle("timeline-expandable-expanded", !wasExpanded);
889 891
890 if (wasExpanded) { 892 if (wasExpanded) {
891 var content = header.nextElementSibling; 893 var content = header.nextElementSibling;
892 if (content) 894 if (content)
893 content.remove(); 895 content.remove();
894 } else { 896 } else {
895 createInvalidationGroupDetails(header.parentElement, invalidations); 897 createInvalidationGroupDetails(row, invalidations);
896 } 898 }
897 } 899 }
898 900
899 /** 901 /**
900 * @param {!Element} parentElement 902 * @param {!Element} parentElement
901 * @param {!Array.<!WebInspector.InvalidationTrackingEvent>} invalidations 903 * @param {!Array.<!WebInspector.InvalidationTrackingEvent>} invalidations
902 */ 904 */
903 function createInvalidationGroupDetails(parentElement, invalidations) 905 function createInvalidationGroupDetails(parentElement, invalidations)
904 { 906 {
905 var content = parentElement.createChild("div", "content"); 907 var content = parentElement.createChild("div", "content");
(...skipping 939 matching lines...) Expand 10 before | Expand all | Expand 10 after
1845 return; 1847 return;
1846 1848
1847 var stackTraceElement = parentElement.createChild("div", "timeline-detai ls-view-row-value timeline-details-view-row-stack-trace monospace"); 1849 var stackTraceElement = parentElement.createChild("div", "timeline-detai ls-view-row-value timeline-details-view-row-stack-trace monospace");
1848 1850
1849 var callFrameElem = WebInspector.DOMPresentationUtils.buildStackTracePre viewContents(this._target, this._linkifier, stackTrace); 1851 var callFrameElem = WebInspector.DOMPresentationUtils.buildStackTracePre viewContents(this._target, this._linkifier, stackTrace);
1850 1852
1851 stackTraceElement.appendChild(callFrameElem); 1853 stackTraceElement.appendChild(callFrameElem);
1852 } 1854 }
1853 1855
1854 } 1856 }
OLDNEW
« no previous file with comments | « no previous file | Source/devtools/front_end/timeline/timelinePanel.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698