Title: [142999] trunk/Source/WebCore
Revision
142999
Author
yu...@chromium.org
Date
2013-02-15 07:47:28 -0800 (Fri, 15 Feb 2013)

Log Message

Web Inspector: highlight record revealed in Timeline
https://bugs.webkit.org/show_bug.cgi?id=109930

Reviewed by Pavel Feldman.

Revealed timeline record is now highlighted with yellow background
that fades out in 2 seconds.

* inspector/front-end/TimelinePanel.js:
(WebInspector.TimelinePanel.prototype._revealRecord):
(WebInspector.TimelinePanel.prototype._refreshRecords):
(WebInspector.TimelinePanel.prototype._clearRecordHighlight):
* inspector/front-end/timelinePanel.css:
(.highlighted-timeline-record):
(@-webkit-keyframes timeline_record_highlight):
(to):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (142998 => 142999)


--- trunk/Source/WebCore/ChangeLog	2013-02-15 15:45:50 UTC (rev 142998)
+++ trunk/Source/WebCore/ChangeLog	2013-02-15 15:47:28 UTC (rev 142999)
@@ -1,3 +1,22 @@
+2013-02-15  Yury Semikhatsky  <yu...@chromium.org>
+
+        Web Inspector: highlight record revealed in Timeline
+        https://bugs.webkit.org/show_bug.cgi?id=109930
+
+        Reviewed by Pavel Feldman.
+
+        Revealed timeline record is now highlighted with yellow background
+        that fades out in 2 seconds.
+
+        * inspector/front-end/TimelinePanel.js:
+        (WebInspector.TimelinePanel.prototype._revealRecord):
+        (WebInspector.TimelinePanel.prototype._refreshRecords):
+        (WebInspector.TimelinePanel.prototype._clearRecordHighlight):
+        * inspector/front-end/timelinePanel.css:
+        (.highlighted-timeline-record):
+        (@-webkit-keyframes timeline_record_highlight):
+        (to):
+
 2013-02-15  Vsevolod Vlasov  <vse...@chromium.org>
 
         Web Inspector: Pass original selection to textModel to correctly restore it after undo.

Modified: trunk/Source/WebCore/inspector/front-end/TimelinePanel.js (142998 => 142999)


--- trunk/Source/WebCore/inspector/front-end/TimelinePanel.js	2013-02-15 15:45:50 UTC (rev 142998)
+++ trunk/Source/WebCore/inspector/front-end/TimelinePanel.js	2013-02-15 15:47:28 UTC (rev 142999)
@@ -817,6 +817,7 @@
     _revealRecord: function(recordToReveal)
     {
         // Expand all ancestors.
+        this._recordToHighlight = recordToReveal;
         var treeUpdated = false;
         for (var parent = recordToReveal.parent; parent !== this._rootRecord(); parent = parent.parent) {
             treeUpdated = treeUpdated || parent.collapsed;
@@ -868,6 +869,10 @@
         this._itemsGraphsElement.removeChild(this._expandElements);
         this._expandElements.removeChildren();
 
+        this._clearRecordHighlight();
+        var highlightedRecord = this._recordToHighlight;
+        delete this._recordToHighlight;
+
         for (var i = 0; i < endIndex; ++i) {
             var record = recordsInWindow[i];
             var isEven = !(i % 2);
@@ -889,6 +894,11 @@
                     this._graphRowsElement.appendChild(graphRowElement);
                 }
 
+                if (highlightedRecord === record) {
+                    this._highlightedListRowElement = listRowElement;
+                    this._highlightedGraphRowElement = graphRowElement;
+                }
+
                 listRowElement.row.update(record, isEven, visibleTop);
                 graphRowElement.row.update(record, isEven, this._calculator, this._expandOffset, i);
 
@@ -914,9 +924,24 @@
         this._adjustScrollPosition((recordsInWindow.length + this._headerLineCount) * rowHeight);
         this._updateSearchHighlight(false);
 
+        if (this._highlightedListRowElement) {
+            this._highlightedListRowElement.addStyleClass("highlighted-timeline-record");
+            this._highlightedGraphRowElement.addStyleClass("highlighted-timeline-record");
+        }
+
         return recordsInWindow.length;
     },
 
+    _clearRecordHighlight: function()
+    {
+        if (!this._highlightedListRowElement)
+            return;
+        this._highlightedListRowElement.removeStyleClass("highlighted-timeline-record");
+        delete this._highlightedListRowElement;
+        this._highlightedGraphRowElement.removeStyleClass("highlighted-timeline-record");
+        delete this._highlightedGraphRowElement;
+    },
+
     _refreshMainThreadBars: function()
     {
         const barOffset = 3;

Modified: trunk/Source/WebCore/inspector/front-end/timelinePanel.css (142998 => 142999)


--- trunk/Source/WebCore/inspector/front-end/timelinePanel.css	2013-02-15 15:45:50 UTC (rev 142998)
+++ trunk/Source/WebCore/inspector/front-end/timelinePanel.css	2013-02-15 15:47:28 UTC (rev 142999)
@@ -688,3 +688,12 @@
 .memory-category-value {
     float: right;
 }
+
+.highlighted-timeline-record {
+    -webkit-animation: "timeline_record_highlight" 2s 0s;
+}
+
+@-webkit-keyframes timeline_record_highlight {
+    from {background-color: rgba(255, 255, 120, 1); }
+    to { background-color: rgba(255, 255, 120, 0); }
+}
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to