Changeset 166723 in webkit


Ignore:
Timestamp:
Apr 3, 2014 9:36:18 AM (10 years ago)
Author:
rniwa@webkit.org
Message:

WebKitPerfMonitor: Tooltips cannot be pinned after using browser's back button
https://bugs.webkit.org/show_bug.cgi?id=131155

Reviewed by Andreas Kling.

The bug was caused by Chart.attach binding event listeners on plot container on each call.
This resulted in the click event handler toggling the visiblity of the tooltip twice upon
click when attach() has been called even number of times, keeping the tooltip invisible.

Fixed the bug by extracting the code to bind event listeners outside of Chart.attach as
a separate function, bindPlotEventHandlers, and calling it exactly once when Chart.attach
is called for the first time.

  • public/index.html:

(Chart.attach):
(Chart..bindPlotEventHandlers):

Location:
trunk/Websites/perf.webkit.org
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Websites/perf.webkit.org/ChangeLog

    r166701 r166723  
     12014-04-03  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        WebKitPerfMonitor: Tooltips cannot be pinned after using browser's back button
     4        https://bugs.webkit.org/show_bug.cgi?id=131155
     5
     6        Reviewed by Andreas Kling.
     7
     8        The bug was caused by Chart.attach binding event listeners on plot container on each call.
     9        This resulted in the click event handler toggling the visiblity of the tooltip twice upon
     10        click when attach() has been called even number of times, keeping the tooltip invisible.
     11
     12        Fixed the bug by extracting the code to bind event listeners outside of Chart.attach as
     13        a separate function, bindPlotEventHandlers, and calling it exactly once when Chart.attach
     14        is called for the first time.
     15
     16        * public/index.html:
     17        (Chart.attach):
     18        (Chart..bindPlotEventHandlers):
     19
    1202014-04-03  Ryosuke Niwa  <rniwa@webkit.org>
    221
  • trunk/Websites/perf.webkit.org/public/index.html

    r166701 r166723  
    740740                this.attachMainPlot(minTime);
    741741
    742             var self = this;
    743 
     742            if (bindPlotEventHandlers)
     743                bindPlotEventHandlers(this);
     744            bindPlotEventHandlers = null;
     745        };
     746
     747        function bindPlotEventHandlers(chart) {
    744748            // FIXME: Crosshair should stay where it was between charts.
    745749            $(plotContainer).bind("plothover", function (event, pos, item) {
    746750                for (var i = 0; i < charts.length; i++) {
    747                     if (charts[i] !== self) {
     751                    if (charts[i] !== chart) {
    748752                        charts[i].setCrosshair(pos);
    749753                        charts[i].hideTooltip();
     
    783787                });
    784788            }
    785         };
    786        
     789        }
     790
    787791        charts.push(this);
    788792    }
Note: See TracChangeset for help on using the changeset viewer.