<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[193612] trunk/Source/WebInspectorUI</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/193612">193612</a></dd>
<dt>Author</dt> <dd>mattbaker@apple.com</dd>
<dt>Date</dt> <dd>2015-12-06 22:15:28 -0800 (Sun, 06 Dec 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Web Inspector: Comparisons in setters should use the massaged value (&quot; = x || 0/false/null/etc&quot;)
https://bugs.webkit.org/show_bug.cgi?id=151910

Reviewed by Timothy Hatcher.

Updated setters that use default values to convert falsy inputs to the default value
before compariing against the current value.

* UserInterface/Models/TimelineMarker.js:
(WebInspector.TimelineMarker.prototype.set time):
Assert new value is a number.

* UserInterface/Views/DataGrid.js:
(WebInspector.DataGridNode.prototype.set hidden):
(WebInspector.DataGridNode.prototype.set data):
Assert new value is of type object. Use shallowEqual compare before setting value.

* UserInterface/Views/GeneralTreeElement.js:
(WebInspector.GeneralTreeElement.prototype.set classNames):
Use shallowEqual compare before setting value.
(WebInspector.GeneralTreeElement.prototype.set mainTitle):
(WebInspector.GeneralTreeElement.prototype.set subtitle):
(WebInspector.GeneralTreeElement.prototype.set status):
(WebInspector.GeneralTreeElement.prototype.set tooltipHandledSeparately):

* UserInterface/Views/TimelineOverview.js:
(WebInspector.TimelineOverview.prototype.set startTime):
(WebInspector.TimelineOverview.prototype.set currentTime):
(WebInspector.TimelineOverview.prototype.set endTime):
(WebInspector.TimelineOverview.prototype.set scrollStartTime):
(WebInspector.TimelineOverview.prototype.set selectionStartTime):
Check current ruler selectionStartTime before setting value.

* UserInterface/Views/TimelineOverviewGraph.js:
(WebInspector.TimelineOverviewGraph.prototype.set zeroTime):
(WebInspector.TimelineOverviewGraph.prototype.set startTime):
(WebInspector.TimelineOverviewGraph.prototype.set endTime):
(WebInspector.TimelineOverviewGraph.prototype.set currentTime):

* UserInterface/Views/TimelineRuler.js:
(WebInspector.TimelineRuler):
(WebInspector.TimelineRuler.prototype.set allowsClippedLabels):
(WebInspector.TimelineRuler.prototype.set formatLabelCallback):
(WebInspector.TimelineRuler.prototype.set allowsTimeRangeSelection):
(WebInspector.TimelineRuler.prototype.set zeroTime):
(WebInspector.TimelineRuler.prototype.set startTime):
(WebInspector.TimelineRuler.prototype.set endTime):
(WebInspector.TimelineRuler.prototype.set secondsPerPixel):
(WebInspector.TimelineRuler.prototype.set selectionStartTime):
(WebInspector.TimelineRuler.prototype.set selectionEndTime):
(WebInspector.TimelineRuler.prototype.set duration): Deleted.
The ruler duration and &quot;pinned&quot; state are controlled by setting an end
time. Removed since it wasn't being used, and there shouldn't be two
ways to the exact same thing.

* UserInterface/Views/TimelineView.js:
(WebInspector.TimelineView.prototype.set zeroTime):
(WebInspector.TimelineView.prototype.set startTime):
(WebInspector.TimelineView.prototype.set endTime):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebInspectorUIChangeLog">trunk/Source/WebInspectorUI/ChangeLog</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsTimelineMarkerjs">trunk/Source/WebInspectorUI/UserInterface/Models/TimelineMarker.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsDataGridjs">trunk/Source/WebInspectorUI/UserInterface/Views/DataGrid.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsGeneralTreeElementjs">trunk/Source/WebInspectorUI/UserInterface/Views/GeneralTreeElement.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsTimelineOverviewjs">trunk/Source/WebInspectorUI/UserInterface/Views/TimelineOverview.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsTimelineOverviewGraphjs">trunk/Source/WebInspectorUI/UserInterface/Views/TimelineOverviewGraph.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsTimelineRulerjs">trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRuler.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsTimelineViewjs">trunk/Source/WebInspectorUI/UserInterface/Views/TimelineView.js</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebInspectorUIChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/ChangeLog (193611 => 193612)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/ChangeLog        2015-12-07 06:13:26 UTC (rev 193611)
+++ trunk/Source/WebInspectorUI/ChangeLog        2015-12-07 06:15:28 UTC (rev 193612)
</span><span class="lines">@@ -1,3 +1,65 @@
</span><ins>+2015-12-06  Matt Baker  &lt;mattbaker@apple.com&gt;
+
+        Web Inspector: Comparisons in setters should use the massaged value (&quot; = x || 0/false/null/etc&quot;)
+        https://bugs.webkit.org/show_bug.cgi?id=151910
+
+        Reviewed by Timothy Hatcher.
+
+        Updated setters that use default values to convert falsy inputs to the default value
+        before compariing against the current value.
+
+        * UserInterface/Models/TimelineMarker.js:
+        (WebInspector.TimelineMarker.prototype.set time):
+        Assert new value is a number.
+
+        * UserInterface/Views/DataGrid.js:
+        (WebInspector.DataGridNode.prototype.set hidden):
+        (WebInspector.DataGridNode.prototype.set data):
+        Assert new value is of type object. Use shallowEqual compare before setting value.
+
+        * UserInterface/Views/GeneralTreeElement.js:
+        (WebInspector.GeneralTreeElement.prototype.set classNames):
+        Use shallowEqual compare before setting value.
+        (WebInspector.GeneralTreeElement.prototype.set mainTitle):
+        (WebInspector.GeneralTreeElement.prototype.set subtitle):
+        (WebInspector.GeneralTreeElement.prototype.set status):
+        (WebInspector.GeneralTreeElement.prototype.set tooltipHandledSeparately):
+
+        * UserInterface/Views/TimelineOverview.js:
+        (WebInspector.TimelineOverview.prototype.set startTime):
+        (WebInspector.TimelineOverview.prototype.set currentTime):
+        (WebInspector.TimelineOverview.prototype.set endTime):
+        (WebInspector.TimelineOverview.prototype.set scrollStartTime):
+        (WebInspector.TimelineOverview.prototype.set selectionStartTime):
+        Check current ruler selectionStartTime before setting value.
+
+        * UserInterface/Views/TimelineOverviewGraph.js:
+        (WebInspector.TimelineOverviewGraph.prototype.set zeroTime):
+        (WebInspector.TimelineOverviewGraph.prototype.set startTime):
+        (WebInspector.TimelineOverviewGraph.prototype.set endTime):
+        (WebInspector.TimelineOverviewGraph.prototype.set currentTime):
+
+        * UserInterface/Views/TimelineRuler.js:
+        (WebInspector.TimelineRuler):
+        (WebInspector.TimelineRuler.prototype.set allowsClippedLabels):
+        (WebInspector.TimelineRuler.prototype.set formatLabelCallback):
+        (WebInspector.TimelineRuler.prototype.set allowsTimeRangeSelection):
+        (WebInspector.TimelineRuler.prototype.set zeroTime):
+        (WebInspector.TimelineRuler.prototype.set startTime):
+        (WebInspector.TimelineRuler.prototype.set endTime):
+        (WebInspector.TimelineRuler.prototype.set secondsPerPixel):
+        (WebInspector.TimelineRuler.prototype.set selectionStartTime):
+        (WebInspector.TimelineRuler.prototype.set selectionEndTime):
+        (WebInspector.TimelineRuler.prototype.set duration): Deleted.
+        The ruler duration and &quot;pinned&quot; state are controlled by setting an end
+        time. Removed since it wasn't being used, and there shouldn't be two
+        ways to the exact same thing.
+
+        * UserInterface/Views/TimelineView.js:
+        (WebInspector.TimelineView.prototype.set zeroTime):
+        (WebInspector.TimelineView.prototype.set startTime):
+        (WebInspector.TimelineView.prototype.set endTime):
+
</ins><span class="cx"> 2015-12-04  Commit Queue  &lt;commit-queue@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed, rolling out r193486.
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsTimelineMarkerjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Models/TimelineMarker.js (193611 => 193612)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/TimelineMarker.js        2015-12-07 06:13:26 UTC (rev 193611)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/TimelineMarker.js        2015-12-07 06:15:28 UTC (rev 193612)
</span><span class="lines">@@ -45,10 +45,14 @@
</span><span class="cx"> 
</span><span class="cx">     set time(x)
</span><span class="cx">     {
</span><ins>+        console.assert(typeof x === &quot;number&quot;, &quot;Time should be a number.&quot;);
+
+        x = x || 0;
+
</ins><span class="cx">         if (this._time === x)
</span><span class="cx">             return;
</span><span class="cx"> 
</span><del>-        this._time = x || 0;
</del><ins>+        this._time = x;
</ins><span class="cx"> 
</span><span class="cx">         this.dispatchEventToListeners(WebInspector.TimelineMarker.Event.TimeChanged);
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsDataGridjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/DataGrid.js (193611 => 193612)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/DataGrid.js        2015-12-07 06:13:26 UTC (rev 193611)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DataGrid.js        2015-12-07 06:15:28 UTC (rev 193612)
</span><span class="lines">@@ -1325,10 +1325,12 @@
</span><span class="cx"> 
</span><span class="cx">     set hidden(x)
</span><span class="cx">     {
</span><del>-        if (x === this._hidden)
</del><ins>+        x = !!x;
+
+        if (this._hidden === x)
</ins><span class="cx">             return;
</span><span class="cx"> 
</span><del>-        this._hidden = x || false;
</del><ins>+        this._hidden = x;
</ins><span class="cx">         if (this._element)
</span><span class="cx">             this._element.classList.toggle(&quot;hidden&quot;, this._hidden);
</span><span class="cx">     }
</span><span class="lines">@@ -1410,7 +1412,14 @@
</span><span class="cx"> 
</span><span class="cx">     set data(x)
</span><span class="cx">     {
</span><del>-        this._data = x || {};
</del><ins>+        console.assert(typeof x === &quot;object&quot;, &quot;Data should be an object.&quot;);
+
+        x = x || {};
+
+        if (Object.shallowEqual(this._data, x))
+            return;
+
+        this._data = x;
</ins><span class="cx">         this.needsRefresh();
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsGeneralTreeElementjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/GeneralTreeElement.js (193611 => 193612)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/GeneralTreeElement.js        2015-12-07 06:13:26 UTC (rev 193611)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/GeneralTreeElement.js        2015-12-07 06:15:28 UTC (rev 193612)
</span><span class="lines">@@ -76,18 +76,21 @@
</span><span class="cx"> 
</span><span class="cx">     set classNames(x)
</span><span class="cx">     {
</span><del>-        if (this._listItemNode &amp;&amp; this._classNames) {
-            this._listItemNode.classList.remove(...this._classNames);
-        }
</del><ins>+        x = x || [];
</ins><span class="cx"> 
</span><span class="cx">         if (typeof x === &quot;string&quot;)
</span><span class="cx">             x = [x];
</span><span class="cx"> 
</span><del>-        this._classNames = x || [];
</del><ins>+        if (Object.shallowEqual(this._classNames, x))
+            return;
</ins><span class="cx"> 
</span><del>-        if (this._listItemNode) {
</del><ins>+        if (this._listItemNode &amp;&amp; this._classNames)
+            this._listItemNode.classList.remove(...this._classNames);
+
+        this._classNames = x;
+
+        if (this._listItemNode)
</ins><span class="cx">             this._listItemNode.classList.add(...this._classNames);
</span><del>-        }
</del><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     addClassName(className)
</span><span class="lines">@@ -153,7 +156,12 @@
</span><span class="cx"> 
</span><span class="cx">     set mainTitle(x)
</span><span class="cx">     {
</span><del>-        this._mainTitle = x || &quot;&quot;;
</del><ins>+        x = x || &quot;&quot;;
+
+        if (this._mainTitle === x)
+            return;
+
+        this._mainTitle = x;
</ins><span class="cx">         this._updateTitleElements();
</span><span class="cx">         this.didChange();
</span><span class="cx">         this.dispatchEventToListeners(WebInspector.GeneralTreeElement.Event.MainTitleDidChange);
</span><span class="lines">@@ -166,7 +174,12 @@
</span><span class="cx"> 
</span><span class="cx">     set subtitle(x)
</span><span class="cx">     {
</span><del>-        this._subtitle = x || &quot;&quot;;
</del><ins>+        x = x || &quot;&quot;;
+
+        if (this._subtitle === x)
+            return;
+
+        this._subtitle = x;
</ins><span class="cx">         this._updateTitleElements();
</span><span class="cx">         this.didChange();
</span><span class="cx">     }
</span><span class="lines">@@ -178,6 +191,8 @@
</span><span class="cx"> 
</span><span class="cx">     set status(x)
</span><span class="cx">     {
</span><ins>+        x = x || &quot;&quot;;
+
</ins><span class="cx">         if (this._status === x)
</span><span class="cx">             return;
</span><span class="cx"> 
</span><span class="lines">@@ -186,7 +201,7 @@
</span><span class="cx">             this._statusElement.className = WebInspector.GeneralTreeElement.StatusElementStyleClassName;
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        this._status = x || &quot;&quot;;
</del><ins>+        this._status = x;
</ins><span class="cx">         this._updateStatusElement();
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -202,7 +217,7 @@
</span><span class="cx"> 
</span><span class="cx">     set tooltipHandledSeparately(x)
</span><span class="cx">     {
</span><del>-        this._tooltipHandledSeparately = x || false;
</del><ins>+        this._tooltipHandledSeparately = !!x;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     // Overrides from TreeElement (Private)
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsTimelineOverviewjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/TimelineOverview.js (193611 => 193612)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/TimelineOverview.js        2015-12-07 06:13:26 UTC (rev 193611)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TimelineOverview.js        2015-12-07 06:15:28 UTC (rev 193612)
</span><span class="lines">@@ -106,10 +106,12 @@
</span><span class="cx"> 
</span><span class="cx">     set startTime(x)
</span><span class="cx">     {
</span><ins>+        x = x || 0;
+
</ins><span class="cx">         if (this._startTime === x)
</span><span class="cx">             return;
</span><span class="cx"> 
</span><del>-        this._startTime = x || 0;
</del><ins>+        this._startTime = x;
</ins><span class="cx"> 
</span><span class="cx">         this.needsLayout();
</span><span class="cx">     }
</span><span class="lines">@@ -121,10 +123,12 @@
</span><span class="cx"> 
</span><span class="cx">     set currentTime(x)
</span><span class="cx">     {
</span><ins>+        x = x || 0;
+
</ins><span class="cx">         if (this._currentTime === x)
</span><span class="cx">             return;
</span><span class="cx"> 
</span><del>-        this._currentTime = x || 0;
</del><ins>+        this._currentTime = x;
</ins><span class="cx">         this._revealCurrentTime = true;
</span><span class="cx"> 
</span><span class="cx">         this.needsLayout();
</span><span class="lines">@@ -177,10 +181,12 @@
</span><span class="cx"> 
</span><span class="cx">     set endTime(x)
</span><span class="cx">     {
</span><ins>+        x = x || 0;
+
</ins><span class="cx">         if (this._endTime === x)
</span><span class="cx">             return;
</span><span class="cx"> 
</span><del>-        this._endTime = x || 0;
</del><ins>+        this._endTime = x;
</ins><span class="cx"> 
</span><span class="cx">         this.needsLayout();
</span><span class="cx">     }
</span><span class="lines">@@ -192,10 +198,12 @@
</span><span class="cx"> 
</span><span class="cx">     set scrollStartTime(x)
</span><span class="cx">     {
</span><ins>+        x = x || 0;
+
</ins><span class="cx">         if (this._scrollStartTime === x)
</span><span class="cx">             return;
</span><span class="cx"> 
</span><del>-        this._scrollStartTime = x || 0;
</del><ins>+        this._scrollStartTime = x;
</ins><span class="cx"> 
</span><span class="cx">         this.needsLayout();
</span><span class="cx">     }
</span><span class="lines">@@ -220,7 +228,10 @@
</span><span class="cx">     {
</span><span class="cx">         x = x || 0;
</span><span class="cx"> 
</span><del>-        var selectionDuration = this.selectionDuration;
</del><ins>+        if (this._timelineRuler.selectionStartTime === x)
+            return;
+
+        let selectionDuration = this.selectionDuration;
</ins><span class="cx">         this._timelineRuler.selectionStartTime = x;
</span><span class="cx">         this._timelineRuler.selectionEndTime = x + selectionDuration;
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsTimelineOverviewGraphjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/TimelineOverviewGraph.js (193611 => 193612)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/TimelineOverviewGraph.js        2015-12-07 06:13:26 UTC (rev 193611)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TimelineOverviewGraph.js        2015-12-07 06:15:28 UTC (rev 193612)
</span><span class="lines">@@ -71,10 +71,12 @@
</span><span class="cx"> 
</span><span class="cx">     set zeroTime(x)
</span><span class="cx">     {
</span><ins>+        x = x || 0;
+
</ins><span class="cx">         if (this._zeroTime === x)
</span><span class="cx">             return;
</span><span class="cx"> 
</span><del>-        this._zeroTime = x || 0;
</del><ins>+        this._zeroTime = x;
</ins><span class="cx"> 
</span><span class="cx">         this.needsLayout();
</span><span class="cx">     }
</span><span class="lines">@@ -86,10 +88,12 @@
</span><span class="cx"> 
</span><span class="cx">     set startTime(x)
</span><span class="cx">     {
</span><ins>+        x = x || 0;
+
</ins><span class="cx">         if (this._startTime === x)
</span><span class="cx">             return;
</span><span class="cx"> 
</span><del>-        this._startTime = x || 0;
</del><ins>+        this._startTime = x;
</ins><span class="cx"> 
</span><span class="cx">         this.needsLayout();
</span><span class="cx">     }
</span><span class="lines">@@ -101,10 +105,12 @@
</span><span class="cx"> 
</span><span class="cx">     set endTime(x)
</span><span class="cx">     {
</span><ins>+        x = x || 0;
+
</ins><span class="cx">         if (this._endTime === x)
</span><span class="cx">             return;
</span><span class="cx"> 
</span><del>-        this._endTime = x || 0;
</del><ins>+        this._endTime = x;
</ins><span class="cx"> 
</span><span class="cx">         this.needsLayout();
</span><span class="cx">     }
</span><span class="lines">@@ -116,12 +122,14 @@
</span><span class="cx"> 
</span><span class="cx">     set currentTime(x)
</span><span class="cx">     {
</span><ins>+        x = x || 0;
+
</ins><span class="cx">         if (this._currentTime === x)
</span><span class="cx">             return;
</span><span class="cx"> 
</span><del>-        var oldCurrentTime = this._currentTime;
</del><ins>+        let oldCurrentTime = this._currentTime;
</ins><span class="cx"> 
</span><del>-        this._currentTime = x || 0;
</del><ins>+        this._currentTime = x;
</ins><span class="cx"> 
</span><span class="cx">         if ((this._startTime &lt;= oldCurrentTime &amp;&amp; oldCurrentTime &lt;= this._endTime) || (this._startTime &lt;= this._currentTime &amp;&amp; this._currentTime &lt;= this._endTime))
</span><span class="cx">             this.needsLayout();
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsTimelineRulerjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRuler.js (193611 => 193612)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRuler.js        2015-12-07 06:13:26 UTC (rev 193611)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRuler.js        2015-12-07 06:15:28 UTC (rev 193612)
</span><span class="lines">@@ -47,6 +47,7 @@
</span><span class="cx">         this._selectionStartTime = 0;
</span><span class="cx">         this._selectionEndTime = Infinity;
</span><span class="cx">         this._endTimePinned = false;
</span><ins>+        this._snapInterval = 0;
</ins><span class="cx">         this._allowsClippedLabels = false;
</span><span class="cx">         this._allowsTimeRangeSelection = false;
</span><span class="cx">         this._minimumSelectionDuration = 0.01;
</span><span class="lines">@@ -65,10 +66,12 @@
</span><span class="cx"> 
</span><span class="cx">     set allowsClippedLabels(x)
</span><span class="cx">     {
</span><ins>+        x = !!x;
+
</ins><span class="cx">         if (this._allowsClippedLabels === x)
</span><span class="cx">             return;
</span><span class="cx"> 
</span><del>-        this._allowsClippedLabels = x || false;
</del><ins>+        this._allowsClippedLabels = x;
</ins><span class="cx"> 
</span><span class="cx">         this.needsLayout();
</span><span class="cx">     }
</span><span class="lines">@@ -77,10 +80,12 @@
</span><span class="cx">     {
</span><span class="cx">         console.assert(typeof x === &quot;function&quot; || !x, x);
</span><span class="cx"> 
</span><ins>+        x = x || null;
+
</ins><span class="cx">         if (this._formatLabelCallback === x)
</span><span class="cx">             return;
</span><span class="cx"> 
</span><del>-        this._formatLabelCallback = x || null;
</del><ins>+        this._formatLabelCallback = x;
</ins><span class="cx"> 
</span><span class="cx">         this.needsLayout();
</span><span class="cx">     }
</span><span class="lines">@@ -92,10 +97,12 @@
</span><span class="cx"> 
</span><span class="cx">     set allowsTimeRangeSelection(x)
</span><span class="cx">     {
</span><ins>+        x = !!x;
+
</ins><span class="cx">         if (this._allowsTimeRangeSelection === x)
</span><span class="cx">             return;
</span><span class="cx"> 
</span><del>-        this._allowsTimeRangeSelection = x || false;
</del><ins>+        this._allowsTimeRangeSelection = x;
</ins><span class="cx"> 
</span><span class="cx">         if (x) {
</span><span class="cx">             this._mouseDownEventListener = this._handleMouseDown.bind(this);
</span><span class="lines">@@ -158,10 +165,12 @@
</span><span class="cx"> 
</span><span class="cx">     set zeroTime(x)
</span><span class="cx">     {
</span><ins>+        x = x || 0;
+
</ins><span class="cx">         if (this._zeroTime === x)
</span><span class="cx">             return;
</span><span class="cx"> 
</span><del>-        this._zeroTime = x || 0;
</del><ins>+        this._zeroTime = x;
</ins><span class="cx"> 
</span><span class="cx">         this.needsLayout();
</span><span class="cx">     }
</span><span class="lines">@@ -173,10 +182,12 @@
</span><span class="cx"> 
</span><span class="cx">     set startTime(x)
</span><span class="cx">     {
</span><ins>+        x = x || 0;
+
</ins><span class="cx">         if (this._startTime === x)
</span><span class="cx">             return;
</span><span class="cx"> 
</span><del>-        this._startTime = x || 0;
</del><ins>+        this._startTime = x;
</ins><span class="cx"> 
</span><span class="cx">         if (!isNaN(this._duration))
</span><span class="cx">             this._endTime = this._startTime + this._duration;
</span><span class="lines">@@ -191,22 +202,6 @@
</span><span class="cx">         return this.endTime - this.startTime;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    set duration(x)
-    {
-        if (this._duration === x)
-            return;
-
-        this._duration = x || NaN;
-
-        if (!isNaN(this._duration)) {
-            this._endTime = this._startTime + this._duration;
-            this._endTimePinned = true;
-        } else
-            this._endTimePinned = false;
-
-        this.needsLayout();
-    }
-
</del><span class="cx">     get endTime()
</span><span class="cx">     {
</span><span class="cx">         if (!this._endTimePinned &amp;&amp; this.layoutPending)
</span><span class="lines">@@ -216,10 +211,12 @@
</span><span class="cx"> 
</span><span class="cx">     set endTime(x)
</span><span class="cx">     {
</span><ins>+        x = x || 0;
+
</ins><span class="cx">         if (this._endTime === x)
</span><span class="cx">             return;
</span><span class="cx"> 
</span><del>-        this._endTime = x || 0;
</del><ins>+        this._endTime = x;
</ins><span class="cx">         this._endTimePinned = true;
</span><span class="cx"> 
</span><span class="cx">         this.needsLayout();
</span><span class="lines">@@ -234,10 +231,12 @@
</span><span class="cx"> 
</span><span class="cx">     set secondsPerPixel(x)
</span><span class="cx">     {
</span><ins>+        x = x || 0;
+
</ins><span class="cx">         if (this._secondsPerPixel === x)
</span><span class="cx">             return;
</span><span class="cx"> 
</span><del>-        this._secondsPerPixel = x || 0;
</del><ins>+        this._secondsPerPixel = x;
</ins><span class="cx">         this._endTimePinned = false;
</span><span class="cx">         this._currentSliceTime = 0;
</span><span class="cx"> 
</span><span class="lines">@@ -264,11 +263,12 @@
</span><span class="cx"> 
</span><span class="cx">     set selectionStartTime(x)
</span><span class="cx">     {
</span><del>-        x = this._snapValue(x);
</del><ins>+        x = this._snapValue(x) || 0;
+
</ins><span class="cx">         if (this._selectionStartTime === x)
</span><span class="cx">             return;
</span><span class="cx"> 
</span><del>-        this._selectionStartTime = x || 0;
</del><ins>+        this._selectionStartTime = x;
</ins><span class="cx">         this._timeRangeSelectionChanged = true;
</span><span class="cx"> 
</span><span class="cx">         this._needsSelectionLayout();
</span><span class="lines">@@ -281,11 +281,12 @@
</span><span class="cx"> 
</span><span class="cx">     set selectionEndTime(x)
</span><span class="cx">     {
</span><del>-        x = this._snapValue(x);
</del><ins>+        x = this._snapValue(x) || 0;
+
</ins><span class="cx">         if (this._selectionEndTime === x)
</span><span class="cx">             return;
</span><span class="cx"> 
</span><del>-        this._selectionEndTime = x || 0;
</del><ins>+        this._selectionEndTime = x;
</ins><span class="cx">         this._timeRangeSelectionChanged = true;
</span><span class="cx"> 
</span><span class="cx">         this._needsSelectionLayout();
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsTimelineViewjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/TimelineView.js (193611 => 193612)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/TimelineView.js        2015-12-07 06:13:26 UTC (rev 193611)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TimelineView.js        2015-12-07 06:15:28 UTC (rev 193612)
</span><span class="lines">@@ -90,10 +90,12 @@
</span><span class="cx"> 
</span><span class="cx">     set zeroTime(x)
</span><span class="cx">     {
</span><ins>+        x = x || 0;
+
</ins><span class="cx">         if (this._zeroTime === x)
</span><span class="cx">             return;
</span><span class="cx"> 
</span><del>-        this._zeroTime = x || 0;
</del><ins>+        this._zeroTime = x;
</ins><span class="cx"> 
</span><span class="cx">         this.needsLayout();
</span><span class="cx">     }
</span><span class="lines">@@ -105,10 +107,12 @@
</span><span class="cx"> 
</span><span class="cx">     set startTime(x)
</span><span class="cx">     {
</span><ins>+        x = x || 0;
+
</ins><span class="cx">         if (this._startTime === x)
</span><span class="cx">             return;
</span><span class="cx"> 
</span><del>-        this._startTime = x || 0;
</del><ins>+        this._startTime = x;
</ins><span class="cx"> 
</span><span class="cx">         this.needsLayout();
</span><span class="cx">     }
</span><span class="lines">@@ -120,10 +124,12 @@
</span><span class="cx"> 
</span><span class="cx">     set endTime(x)
</span><span class="cx">     {
</span><ins>+        x = x || 0;
+
</ins><span class="cx">         if (this._endTime === x)
</span><span class="cx">             return;
</span><span class="cx"> 
</span><del>-        this._endTime = x || 0;
</del><ins>+        this._endTime = x;
</ins><span class="cx"> 
</span><span class="cx">         this.needsLayout();
</span><span class="cx">     }
</span><span class="lines">@@ -135,12 +141,14 @@
</span><span class="cx"> 
</span><span class="cx">     set currentTime(x)
</span><span class="cx">     {
</span><ins>+        x = x || 0;
+
</ins><span class="cx">         if (this._currentTime === x)
</span><span class="cx">             return;
</span><span class="cx"> 
</span><del>-        var oldCurrentTime = this._currentTime;
</del><ins>+        let oldCurrentTime = this._currentTime;
</ins><span class="cx"> 
</span><del>-        this._currentTime = x || 0;
</del><ins>+        this._currentTime = x;
</ins><span class="cx"> 
</span><span class="cx">         function checkIfLayoutIsNeeded(currentTime)
</span><span class="cx">         {
</span></span></pre>
</div>
</div>

</body>
</html>