<!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>[164540] 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/164540">164540</a></dd>
<dt>Author</dt> <dd>graouts@webkit.org</dd>
<dt>Date</dt> <dd>2014-02-22 07:29:13 -0800 (Sat, 22 Feb 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Web Inspector: allow drag-to-adjust on angle input of gradients editor
https://bugs.webkit.org/show_bug.cgi?id=129095

Reviewed by Timothy Hatcher.

Rename CodeMirrorDragToAlterNumberController to CodeMirrorDragToAdjustNumberController and move
the core logic of a drag-to-adjust behavior out of it to a new generic class DragToAdjustController.
We use this new class from CodeMirrorGradientEditingController to provide drag-to-adjust behavior
in the angle input field of the gradient editor and also as a supporting object for the CodeMirror-
specific class.

* UserInterface/CodeMirrorDragToAdjustNumberController.css: Renamed from Source/WebInspectorUI/UserInterface/CodeMirrorDragToAlterNumberController.css.
(.CodeMirror.drag-to-adjust .CodeMirror-lines):

* UserInterface/CodeMirrorDragToAdjustNumberController.js: Added.
Removed the UI logic and use the new DragToAdjustController as a supporting object instead. We implement
the various DragToAdjustController delegate methods in order to customize its behavior to work within the
context of a CodeMirror editor, specifically to prevent activation when the editor is read-only and to
prevent adjustment when the hovered token isn't a number.

(WebInspector.CodeMirrorDragToAdjustNumberController):
(WebInspector.CodeMirrorDragToAdjustNumberController.prototype.get enabled):
(WebInspector.CodeMirrorDragToAdjustNumberController.prototype.set enabled):
(WebInspector.CodeMirrorDragToAdjustNumberController.prototype.dragToAdjustControllerActiveStateChanged):
(WebInspector.CodeMirrorDragToAdjustNumberController.prototype.dragToAdjustControllerCanBeActivated):
(WebInspector.CodeMirrorDragToAdjustNumberController.prototype.dragToAdjustControllerCanBeAdjusted):
(WebInspector.CodeMirrorDragToAdjustNumberController.prototype.dragToAdjustControllerWasAdjustedByAmount):
(WebInspector.CodeMirrorDragToAdjustNumberController.prototype.dragToAdjustControllerDidReset):
(WebInspector.CodeMirrorDragToAdjustNumberController.prototype.dragToAdjustControllerCanAdjustObjectAtPoint):

* UserInterface/CodeMirrorGradientEditingController.css:
(.gradient-editing-controller &gt; label.drag-to-adjust &gt; input):

* UserInterface/CodeMirrorGradientEditingController.js:
Adopt the new DragToAdjustController to make the angle input field value adjustable by dragging.

(WebInspector.CodeMirrorGradientEditingController.prototype.popoverWillPresent):
(WebInspector.CodeMirrorGradientEditingController.prototype.dragToAdjustControllerWasAdjustedByAmount):
(WebInspector.CodeMirrorGradientEditingController.prototype._handleInputEvent):
(WebInspector.CodeMirrorGradientEditingController.prototype._angleInputValueDidChange):

* UserInterface/DragToAdjustController.js: Renamed from Source/WebInspectorUI/UserInterface/CodeMirrorDragToAlterNumberController.js.
New DragToAdjustController class exposing only the core UI logic of a drag-to-adjust behavior in the context
of a DOM element, exposing a few delegation methods to customize the controller's behavior:

- dragToAdjustControllerActiveStateChanged() notifies that the .active property has changed, allowing bringup
and cleanup work to be performed.

- dragToAdjustControllerDidReset() notifies that the various tracking states of the controller have been reset
allowing other state objects used by clients to be cleared.

- dragToAdjustControllerCanBeActivated() is used to check whether the controller may enter the active state upon
first hovering the target element.

- dragToAdjustControllerCanBeAdjusted() is used to check whether adjustment can be performed at the moment when
the user actually is about to engage in a drag-to-adjust interaction.

- dragToAdjustControllerCanAdjustObjectAtPoint() is used to check whether the object at the provided point (mouse
location) is an adjustable value.

- dragToAdjustControllerWasAdjustedByAmount() notifies that there is a new amount to add to the current value
following a drag-to-adjust interaction.

(WebInspector.DragToAdjustController):
(WebInspector.DragToAdjustController.prototype.get element):
(WebInspector.DragToAdjustController.prototype.set element):
(WebInspector.DragToAdjustController.prototype.set enabled):
(WebInspector.DragToAdjustController.prototype.get active):
(WebInspector.DragToAdjustController.prototype.set active):
(WebInspector.DragToAdjustController.prototype.reset):
(WebInspector.DragToAdjustController.prototype.handleEvent):
(WebInspector.DragToAdjustController.prototype._setDragging):
(WebInspector.DragToAdjustController.prototype._setTracksMouseClickAndDrag):
(WebInspector.DragToAdjustController.prototype._modifiersDidChange):
(WebInspector.DragToAdjustController.prototype._mouseMoved):
(WebInspector.DragToAdjustController.prototype._mouseWasPressed):
(WebInspector.DragToAdjustController.prototype._mouseWasDragged):
(WebInspector.DragToAdjustController.prototype._mouseWasReleased):

* UserInterface/Main.html:
Link in new source files.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebInspectorUIChangeLog">trunk/Source/WebInspectorUI/ChangeLog</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceCodeMirrorGradientEditingControllercss">trunk/Source/WebInspectorUI/UserInterface/CodeMirrorGradientEditingController.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceCodeMirrorGradientEditingControllerjs">trunk/Source/WebInspectorUI/UserInterface/CodeMirrorGradientEditingController.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceMainhtml">trunk/Source/WebInspectorUI/UserInterface/Main.html</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceCodeMirrorDragToAdjustNumberControllercss">trunk/Source/WebInspectorUI/UserInterface/CodeMirrorDragToAdjustNumberController.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceCodeMirrorDragToAdjustNumberControllerjs">trunk/Source/WebInspectorUI/UserInterface/CodeMirrorDragToAdjustNumberController.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceDragToAdjustControllerjs">trunk/Source/WebInspectorUI/UserInterface/DragToAdjustController.js</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceCodeMirrorDragToAlterNumberControllercss">trunk/Source/WebInspectorUI/UserInterface/CodeMirrorDragToAlterNumberController.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceCodeMirrorDragToAlterNumberControllerjs">trunk/Source/WebInspectorUI/UserInterface/CodeMirrorDragToAlterNumberController.js</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebInspectorUIChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/ChangeLog (164539 => 164540)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/ChangeLog        2014-02-22 13:58:51 UTC (rev 164539)
+++ trunk/Source/WebInspectorUI/ChangeLog        2014-02-22 15:29:13 UTC (rev 164540)
</span><span class="lines">@@ -1,3 +1,87 @@
</span><ins>+2014-02-22  Antoine Quint  &lt;graouts@webkit.org&gt;
+
+        Web Inspector: allow drag-to-adjust on angle input of gradients editor
+        https://bugs.webkit.org/show_bug.cgi?id=129095
+
+        Reviewed by Timothy Hatcher.
+
+        Rename CodeMirrorDragToAlterNumberController to CodeMirrorDragToAdjustNumberController and move
+        the core logic of a drag-to-adjust behavior out of it to a new generic class DragToAdjustController.
+        We use this new class from CodeMirrorGradientEditingController to provide drag-to-adjust behavior
+        in the angle input field of the gradient editor and also as a supporting object for the CodeMirror-
+        specific class.
+
+        * UserInterface/CodeMirrorDragToAdjustNumberController.css: Renamed from Source/WebInspectorUI/UserInterface/CodeMirrorDragToAlterNumberController.css.
+        (.CodeMirror.drag-to-adjust .CodeMirror-lines):
+
+        * UserInterface/CodeMirrorDragToAdjustNumberController.js: Added.
+        Removed the UI logic and use the new DragToAdjustController as a supporting object instead. We implement
+        the various DragToAdjustController delegate methods in order to customize its behavior to work within the
+        context of a CodeMirror editor, specifically to prevent activation when the editor is read-only and to
+        prevent adjustment when the hovered token isn't a number.
+
+        (WebInspector.CodeMirrorDragToAdjustNumberController):
+        (WebInspector.CodeMirrorDragToAdjustNumberController.prototype.get enabled):
+        (WebInspector.CodeMirrorDragToAdjustNumberController.prototype.set enabled):
+        (WebInspector.CodeMirrorDragToAdjustNumberController.prototype.dragToAdjustControllerActiveStateChanged):
+        (WebInspector.CodeMirrorDragToAdjustNumberController.prototype.dragToAdjustControllerCanBeActivated):
+        (WebInspector.CodeMirrorDragToAdjustNumberController.prototype.dragToAdjustControllerCanBeAdjusted):
+        (WebInspector.CodeMirrorDragToAdjustNumberController.prototype.dragToAdjustControllerWasAdjustedByAmount):
+        (WebInspector.CodeMirrorDragToAdjustNumberController.prototype.dragToAdjustControllerDidReset):
+        (WebInspector.CodeMirrorDragToAdjustNumberController.prototype.dragToAdjustControllerCanAdjustObjectAtPoint):
+
+        * UserInterface/CodeMirrorGradientEditingController.css:
+        (.gradient-editing-controller &gt; label.drag-to-adjust &gt; input):
+
+        * UserInterface/CodeMirrorGradientEditingController.js:
+        Adopt the new DragToAdjustController to make the angle input field value adjustable by dragging.
+
+        (WebInspector.CodeMirrorGradientEditingController.prototype.popoverWillPresent):
+        (WebInspector.CodeMirrorGradientEditingController.prototype.dragToAdjustControllerWasAdjustedByAmount):
+        (WebInspector.CodeMirrorGradientEditingController.prototype._handleInputEvent):
+        (WebInspector.CodeMirrorGradientEditingController.prototype._angleInputValueDidChange):
+
+        * UserInterface/DragToAdjustController.js: Renamed from Source/WebInspectorUI/UserInterface/CodeMirrorDragToAlterNumberController.js.
+        New DragToAdjustController class exposing only the core UI logic of a drag-to-adjust behavior in the context
+        of a DOM element, exposing a few delegation methods to customize the controller's behavior:
+
+        - dragToAdjustControllerActiveStateChanged() notifies that the .active property has changed, allowing bringup
+        and cleanup work to be performed.
+
+        - dragToAdjustControllerDidReset() notifies that the various tracking states of the controller have been reset
+        allowing other state objects used by clients to be cleared.
+
+        - dragToAdjustControllerCanBeActivated() is used to check whether the controller may enter the active state upon
+        first hovering the target element.
+
+        - dragToAdjustControllerCanBeAdjusted() is used to check whether adjustment can be performed at the moment when
+        the user actually is about to engage in a drag-to-adjust interaction.
+
+        - dragToAdjustControllerCanAdjustObjectAtPoint() is used to check whether the object at the provided point (mouse
+        location) is an adjustable value.
+
+        - dragToAdjustControllerWasAdjustedByAmount() notifies that there is a new amount to add to the current value
+        following a drag-to-adjust interaction.
+
+        (WebInspector.DragToAdjustController):
+        (WebInspector.DragToAdjustController.prototype.get element):
+        (WebInspector.DragToAdjustController.prototype.set element):
+        (WebInspector.DragToAdjustController.prototype.set enabled):
+        (WebInspector.DragToAdjustController.prototype.get active):
+        (WebInspector.DragToAdjustController.prototype.set active):
+        (WebInspector.DragToAdjustController.prototype.reset):
+        (WebInspector.DragToAdjustController.prototype.handleEvent):
+        (WebInspector.DragToAdjustController.prototype._setDragging):
+        (WebInspector.DragToAdjustController.prototype._setTracksMouseClickAndDrag):
+        (WebInspector.DragToAdjustController.prototype._modifiersDidChange):
+        (WebInspector.DragToAdjustController.prototype._mouseMoved):
+        (WebInspector.DragToAdjustController.prototype._mouseWasPressed):
+        (WebInspector.DragToAdjustController.prototype._mouseWasDragged):
+        (WebInspector.DragToAdjustController.prototype._mouseWasReleased):
+
+        * UserInterface/Main.html:
+        Link in new source files.
+
</ins><span class="cx"> 2014-02-21  Chi Wai Lau  &lt;clau@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Web Inspector: Replace binarySearch with lowerBound and upperBound functions
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceCodeMirrorDragToAdjustNumberControllercssfromrev164539trunkSourceWebInspectorUIUserInterfaceCodeMirrorDragToAlterNumberControllercss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/CodeMirrorDragToAdjustNumberController.css (from rev 164539, trunk/Source/WebInspectorUI/UserInterface/CodeMirrorDragToAlterNumberController.css) (0 => 164540)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/CodeMirrorDragToAdjustNumberController.css                                (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/CodeMirrorDragToAdjustNumberController.css        2014-02-22 15:29:13 UTC (rev 164540)
</span><span class="lines">@@ -0,0 +1,28 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+.CodeMirror.drag-to-adjust .CodeMirror-lines {
+    cursor: col-resize;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceCodeMirrorDragToAdjustNumberControllerjs"></a>
<div class="addfile"><h4>Added: trunk/Source/WebInspectorUI/UserInterface/CodeMirrorDragToAdjustNumberController.js (0 => 164540)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/CodeMirrorDragToAdjustNumberController.js                                (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/CodeMirrorDragToAdjustNumberController.js        2014-02-22 15:29:13 UTC (rev 164540)
</span><span class="lines">@@ -0,0 +1,120 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+WebInspector.CodeMirrorDragToAdjustNumberController = function(codeMirror)
+{
+    this._codeMirror = codeMirror;
+
+    this._dragToAdjustController = new WebInspector.DragToAdjustController(this);
+};
+
+WebInspector.CodeMirrorDragToAdjustNumberController.prototype = {
+    constructor: WebInspector.CodeMirrorDragToAdjustNumberController,
+
+    // Public
+
+    get enabled()
+    {
+        return this._dragToAdjustController.enabled;
+    },
+
+    set enabled(enabled)
+    {
+        if (this.enabled === enabled)
+            return;
+        
+        this._dragToAdjustController.element = this._codeMirror.getWrapperElement();
+        this._dragToAdjustController.enabled = enabled;
+    },
+
+    // Protected
+
+    dragToAdjustControllerActiveStateChanged: function(dragToAdjustController)
+    {
+        if (!dragToAdjustController.active)
+            this._hoveredTokenInfo = null;
+    },
+
+    dragToAdjustControllerCanBeActivated: function(dragToAdjustController)
+    {
+        return !this._codeMirror.getOption(&quot;readOnly&quot;);
+    },
+
+    dragToAdjustControllerCanBeAdjusted: function(dragToAdjustController)
+    {
+
+        return this._hoveredTokenInfo &amp;&amp; this._hoveredTokenInfo.containsNumber;
+    },
+
+    dragToAdjustControllerWasAdjustedByAmount: function(dragToAdjustController, amount)
+    {
+        this._codeMirror.alterNumberInRange(amount, this._hoveredTokenInfo.startPosition, this._hoveredTokenInfo.endPosition, false);
+    },
+
+    dragToAdjustControllerDidReset: function(dragToAdjustController)
+    {
+        this._hoveredTokenInfo = null;
+    },
+
+    dragToAdjustControllerCanAdjustObjectAtPoint: function(dragToAdjustController, point)
+    {
+        var position = this._codeMirror.coordsChar({left: point.x, top: point.y});
+        var token = this._codeMirror.getTokenAt(position);
+
+        if (!token || !token.type || !token.string) {
+            if (this._hoveredTokenInfo)
+                dragToAdjustController.reset();
+            return false;
+        }
+
+        // Stop right here if we're hovering the same token as we were last time.
+        if (this._hoveredTokenInfo &amp;&amp; this._hoveredTokenInfo.line === position.line &amp;&amp;
+            this._hoveredTokenInfo.token.start === token.start &amp;&amp; this._hoveredTokenInfo.token.end === token.end)
+            return this._hoveredTokenInfo.token.type.indexOf(&quot;number&quot;) !== -1;
+
+        var containsNumber = token.type.indexOf(&quot;number&quot;) !== -1;
+        this._hoveredTokenInfo = {
+            token: token,
+            line: position.line,
+            containsNumber: containsNumber,
+            startPosition: {
+                ch: token.start,
+                line: position.line
+            },
+            endPosition: {
+                ch: token.end,
+                line: position.line
+            }
+        };
+        
+        return containsNumber;
+    }
+};
+
+CodeMirror.defineOption(&quot;dragToAdjustNumbers&quot;, true, function(codeMirror, value, oldValue) {
+    if (!codeMirror.dragToAdjustNumberController)
+        codeMirror.dragToAdjustNumberController = new WebInspector.CodeMirrorDragToAdjustNumberController(codeMirror);
+    codeMirror.dragToAdjustNumberController.enabled = value;
+});
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceCodeMirrorDragToAlterNumberControllercss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/CodeMirrorDragToAlterNumberController.css (164539 => 164540)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/CodeMirrorDragToAlterNumberController.css        2014-02-22 13:58:51 UTC (rev 164539)
+++ trunk/Source/WebInspectorUI/UserInterface/CodeMirrorDragToAlterNumberController.css        2014-02-22 15:29:13 UTC (rev 164540)
</span><span class="lines">@@ -1,28 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-.CodeMirror.drag-to-adjust .CodeMirror-lines {
-    cursor: col-resize;
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceCodeMirrorDragToAlterNumberControllerjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/CodeMirrorDragToAlterNumberController.js (164539 => 164540)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/CodeMirrorDragToAlterNumberController.js        2014-02-22 13:58:51 UTC (rev 164539)
+++ trunk/Source/WebInspectorUI/UserInterface/CodeMirrorDragToAlterNumberController.js        2014-02-22 15:29:13 UTC (rev 164540)
</span><span class="lines">@@ -1,234 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-WebInspector.CodeMirrorDragToAlterNumberController = function(codeMirror)
-{
-    this._codeMirror = codeMirror;
-    this._active = false;
-    this._dragging = false;
-    this._enabled = false;
-    this._tracksMouseClickAndDrag = false;
-};
-
-WebInspector.CodeMirrorDragToAlterNumberController.StyleClassName = &quot;drag-to-adjust&quot;;
-
-WebInspector.CodeMirrorDragToAlterNumberController.prototype = {
-    constructor: WebInspector.CodeMirrorDragToAlterNumberController,
-
-    // Public
-
-    set enabled(enabled)
-    {
-        if (this._enabled === enabled)
-            return;
-
-        this._element = this._codeMirror.getWrapperElement();
-
-        if (enabled) {
-            this._element.addEventListener(&quot;mouseenter&quot;, this);
-            this._element.addEventListener(&quot;mouseleave&quot;, this);
-        } else {
-            this._element.removeEventListener(&quot;mouseenter&quot;, this);
-            this._element.removeEventListener(&quot;mouseleave&quot;, this);
-        }
-    },
-
-    // Protected
-
-    handleEvent: function(event)
-    {
-        switch(event.type) {
-        case &quot;mouseenter&quot;:
-            if (!this._dragging)
-                this._setActive(true);
-            break;
-        case &quot;mouseleave&quot;:
-            if (!this._dragging)
-                this._setActive(false);
-            break;
-        case &quot;mousemove&quot;:
-            if (this._dragging)
-                this._mouseWasDragged(event);
-            else
-                this._mouseMoved(event);
-            break;
-        case &quot;mousedown&quot;:
-            this._mouseWasPressed(event);
-            break;
-        case &quot;mouseup&quot;:
-            this._mouseWasReleased(event);
-            break;
-        case &quot;contextmenu&quot;:
-            event.preventDefault();
-            break;
-        }
-    },
-
-    // Private
-
-    _setActive: function(active)
-    {
-        if (this._active === active || this._codeMirror.getOption(&quot;readOnly&quot;))
-            return;
-
-        if (active) {
-            WebInspector.notifications.addEventListener(WebInspector.Notification.GlobalModifierKeysDidChange, this._modifiersDidChange, this);
-            this._element.addEventListener(&quot;mousemove&quot;, this);
-        } else {
-            WebInspector.notifications.removeEventListener(WebInspector.Notification.GlobalModifierKeysDidChange, this._modifiersDidChange, this);
-            this._element.removeEventListener(&quot;mousemove&quot;, this);
-            this._hoveredTokenInfo = null;
-            this._setTracksMouseClickAndDrag(false);
-        }
-
-        this._active = active;
-    },
-
-    _setDragging: function(dragging)
-    {
-        if (this._dragging === dragging)
-            return;
-        
-        console.assert(window.event);
-        if (dragging)
-            WebInspector.elementDragStart(this._element, this, this, window.event, &quot;col-resize&quot;, window);
-        else
-            WebInspector.elementDragEnd(window.event);
-
-        this._dragging = dragging;
-    },
-
-    _setTracksMouseClickAndDrag: function(tracksMouseClickAndDrag)
-    {
-        if (this._tracksMouseClickAndDrag === tracksMouseClickAndDrag)
-            return;
-        
-        if (tracksMouseClickAndDrag) {
-            this._element.classList.add(WebInspector.CodeMirrorDragToAlterNumberController.StyleClassName);
-            window.addEventListener(&quot;mousedown&quot;, this, true);
-            window.addEventListener(&quot;contextmenu&quot;, this, true);
-        } else {
-            this._element.classList.remove(WebInspector.CodeMirrorDragToAlterNumberController.StyleClassName);
-            window.removeEventListener(&quot;mousedown&quot;, this, true);
-            window.removeEventListener(&quot;contextmenu&quot;, this, true);
-            this._setDragging(false);
-        }
-        
-        this._tracksMouseClickAndDrag = tracksMouseClickAndDrag;
-    },
-
-    _modifiersDidChange: function(event)
-    {
-        this._setTracksMouseClickAndDrag(this._hoveredTokenInfo &amp;&amp; this._hoveredTokenInfo.containsNumber &amp;&amp; WebInspector.modifierKeys.altKey);
-    },
-    
-    _mouseMoved: function(event)
-    {
-        var position = this._codeMirror.coordsChar({left: event.pageX, top: event.pageY});
-        var token = this._codeMirror.getTokenAt(position);
-
-        if (!token || !token.type || !token.string) {
-            if (this._hoveredTokenInfo)
-                this._reset();
-            return;
-        }
-
-        // Stop right here if we're hovering the same token as we were last time.
-        if (this._hoveredTokenInfo &amp;&amp; this._hoveredTokenInfo.line === position.line &amp;&amp;
-            this._hoveredTokenInfo.token.start === token.start &amp;&amp; this._hoveredTokenInfo.token.end === token.end)
-            return;
-
-        var containsNumber = token.type.indexOf(&quot;number&quot;) !== -1;
-        this._hoveredTokenInfo = {
-            token: token,
-            line: position.line,
-            containsNumber: containsNumber,
-            startPosition: {
-                ch: token.start,
-                line: position.line
-            },
-            endPosition: {
-                ch: token.end,
-                line: position.line
-            }
-        };
-
-        this._setTracksMouseClickAndDrag(containsNumber &amp;&amp; event.altKey);
-    },
-    
-    _mouseWasPressed: function(event)
-    {
-        this._lastX = event.screenX;
-
-        this._setDragging(true);
-
-        event.preventDefault();
-        event.stopPropagation();
-    },
-
-    _mouseWasDragged: function(event)
-    {
-        var x = event.screenX;
-        var amount = x - this._lastX;
-
-        if (Math.abs(amount) &lt; 1)
-            return;
-
-        this._lastX = x;
-
-        if (event.ctrlKey)
-            amount /= 10;
-        else if (event.shiftKey)
-            amount *= 10;
-
-        this._codeMirror.alterNumberInRange(amount, this._hoveredTokenInfo.startPosition, this._hoveredTokenInfo.endPosition, false);
-
-        event.preventDefault();
-        event.stopPropagation();
-    },
-
-    _mouseWasReleased: function(event)
-    {
-        this._setDragging(false);
-
-        event.preventDefault();
-        event.stopPropagation();
-
-        this._reset();
-    },
-    
-    _reset: function()
-    {
-        this._hoveredTokenInfo = null;
-        this._setTracksMouseClickAndDrag(false);
-        this._element.classList.remove(WebInspector.CodeMirrorDragToAlterNumberController.StyleClassName);
-    }
-};
-
-CodeMirror.defineOption(&quot;dragToAdjustNumbers&quot;, true, function(codeMirror, value, oldValue) {
-    if (!codeMirror.dragToAlterNumberController)
-        codeMirror.dragToAlterNumberController = new WebInspector.CodeMirrorDragToAlterNumberController(codeMirror);
-    codeMirror.dragToAlterNumberController.enabled = value;
-});
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceCodeMirrorGradientEditingControllercss"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/CodeMirrorGradientEditingController.css (164539 => 164540)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/CodeMirrorGradientEditingController.css        2014-02-22 13:58:51 UTC (rev 164539)
+++ trunk/Source/WebInspectorUI/UserInterface/CodeMirrorGradientEditingController.css        2014-02-22 15:29:13 UTC (rev 164540)
</span><span class="lines">@@ -112,3 +112,8 @@
</span><span class="cx">     font-size: 13px;
</span><span class="cx">     text-align: right;
</span><span class="cx"> }
</span><ins>+
+.gradient-editing-controller &gt; label.drag-to-adjust,
+.gradient-editing-controller &gt; label.drag-to-adjust &gt; input {
+    cursor: col-resize;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceCodeMirrorGradientEditingControllerjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/CodeMirrorGradientEditingController.js (164539 => 164540)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/CodeMirrorGradientEditingController.js        2014-02-22 13:58:51 UTC (rev 164539)
+++ trunk/Source/WebInspectorUI/UserInterface/CodeMirrorGradientEditingController.js        2014-02-22 15:29:13 UTC (rev 164540)
</span><span class="lines">@@ -114,6 +114,10 @@
</span><span class="cx">         this._angleInput.addEventListener(&quot;input&quot;, this);
</span><span class="cx">         angleLabel.appendChild(this._angleInput);
</span><span class="cx"> 
</span><ins>+        var dragToAdjustController = new WebInspector.DragToAdjustController(this);
+        dragToAdjustController.element = angleLabel;
+        dragToAdjustController.enabled = true;
+
</ins><span class="cx">         this._updateCSSClassForGradientType();
</span><span class="cx"> 
</span><span class="cx">         popover.content = this._container;
</span><span class="lines">@@ -167,6 +171,16 @@
</span><span class="cx">         this.popover.update();
</span><span class="cx">     },
</span><span class="cx"> 
</span><ins>+    dragToAdjustControllerWasAdjustedByAmount: function(dragToAdjustController, amount)
+    {
+        var angle = parseFloat(this._angleInput.value) + amount;
+        if (Math.round(angle) !== angle)
+            angle = angle.toFixed(1);
+
+        this._angleInput.value = angle;
+        this._angleInputValueDidChange(angle);
+    },
+
</ins><span class="cx">     // Private
</span><span class="cx"> 
</span><span class="cx">     _handleInputEvent: function(event)
</span><span class="lines">@@ -175,6 +189,11 @@
</span><span class="cx">         if (isNaN(angle))
</span><span class="cx">             return;
</span><span class="cx"> 
</span><ins>+        this._angleInputValueDidChange(angle);
+    },
+
+    _angleInputValueDidChange: function(angle)
+    {
</ins><span class="cx">         this.value.angle = angle;
</span><span class="cx">         this.text = this.value.toString();
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceDragToAdjustControllerjsfromrev164539trunkSourceWebInspectorUIUserInterfaceCodeMirrorDragToAlterNumberControllerjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/DragToAdjustController.js (from rev 164539, trunk/Source/WebInspectorUI/UserInterface/CodeMirrorDragToAlterNumberController.js) (0 => 164540)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/DragToAdjustController.js                                (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/DragToAdjustController.js        2014-02-22 15:29:13 UTC (rev 164540)
</span><span class="lines">@@ -0,0 +1,234 @@
</span><ins>+/*
+ * Copyright (C) 2014 Antoine Quint
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+WebInspector.DragToAdjustController = function(delegate)
+{
+    this._delegate = delegate;
+
+    this._element = null;
+    this._active = false;
+    this._enabled = false;
+    this._dragging = false;
+    this._tracksMouseClickAndDrag = false;
+};
+
+WebInspector.DragToAdjustController.StyleClassName = &quot;drag-to-adjust&quot;;
+
+WebInspector.DragToAdjustController.prototype = {
+    constructor: WebInspector.DragToAdjustController,
+
+    // Public
+
+    get element()
+    {
+        return this._element;
+    },
+
+    set element(element)
+    {
+        this._element = element;
+    },
+
+    set enabled(enabled)
+    {
+        if (this._enabled === enabled)
+            return;
+
+        if (enabled) {
+            this._element.addEventListener(&quot;mouseenter&quot;, this);
+            this._element.addEventListener(&quot;mouseleave&quot;, this);
+        } else {
+            this._element.removeEventListener(&quot;mouseenter&quot;, this);
+            this._element.removeEventListener(&quot;mouseleave&quot;, this);
+        }
+    },
+
+    get active()
+    {
+        return this._active;
+    },
+
+    set active(active)
+    {
+        if (!this._element)
+            return;
+        
+        if (this._active === active)
+            return;
+
+        if (active) {
+            WebInspector.notifications.addEventListener(WebInspector.Notification.GlobalModifierKeysDidChange, this._modifiersDidChange, this);
+            this._element.addEventListener(&quot;mousemove&quot;, this);
+        } else {
+            WebInspector.notifications.removeEventListener(WebInspector.Notification.GlobalModifierKeysDidChange, this._modifiersDidChange, this);
+            this._element.removeEventListener(&quot;mousemove&quot;, this);
+            this._setTracksMouseClickAndDrag(false);
+        }
+
+        this._active = active;
+
+        if (this._delegate &amp;&amp; typeof this._delegate.dragToAdjustControllerActiveStateChanged === &quot;function&quot;)
+            this._delegate.dragToAdjustControllerActiveStateChanged(this);
+    },
+
+    reset: function()
+    {
+        this._setTracksMouseClickAndDrag(false);
+        this._element.classList.remove(WebInspector.DragToAdjustController.StyleClassName);
+
+        if (this._delegate &amp;&amp; typeof this._delegate.dragToAdjustControllerDidReset === &quot;function&quot;)
+            this._delegate.dragToAdjustControllerDidReset(this);
+    },
+
+    // Protected
+
+    handleEvent: function(event)
+    {
+        switch(event.type) {
+        case &quot;mouseenter&quot;:
+            if (!this._dragging) {
+                if (this._delegate &amp;&amp; typeof this._delegate.dragToAdjustControllerCanBeActivated === &quot;function&quot;)
+                    this.active = this._delegate.dragToAdjustControllerCanBeActivated(this);
+                else
+                    this.active = true;
+            }
+            break;
+        case &quot;mouseleave&quot;:
+            if (!this._dragging)
+                this.active = false;
+            break;
+        case &quot;mousemove&quot;:
+            if (this._dragging)
+                this._mouseWasDragged(event);
+            else
+                this._mouseMoved(event);
+            break;
+        case &quot;mousedown&quot;:
+            this._mouseWasPressed(event);
+            break;
+        case &quot;mouseup&quot;:
+            this._mouseWasReleased(event);
+            break;
+        case &quot;contextmenu&quot;:
+            event.preventDefault();
+            break;
+        }
+    },
+
+    // Private
+
+    _setDragging: function(dragging)
+    {
+        if (this._dragging === dragging)
+            return;
+        
+        console.assert(window.event);
+        if (dragging)
+            WebInspector.elementDragStart(this._element, this, this, window.event, &quot;col-resize&quot;, window);
+        else
+            WebInspector.elementDragEnd(window.event);
+
+        this._dragging = dragging;
+    },
+
+    _setTracksMouseClickAndDrag: function(tracksMouseClickAndDrag)
+    {
+        if (this._tracksMouseClickAndDrag === tracksMouseClickAndDrag)
+            return;
+        
+        if (tracksMouseClickAndDrag) {
+            this._element.classList.add(WebInspector.DragToAdjustController.StyleClassName);
+            window.addEventListener(&quot;mousedown&quot;, this, true);
+            window.addEventListener(&quot;contextmenu&quot;, this, true);
+        } else {
+            this._element.classList.remove(WebInspector.DragToAdjustController.StyleClassName);
+            window.removeEventListener(&quot;mousedown&quot;, this, true);
+            window.removeEventListener(&quot;contextmenu&quot;, this, true);
+            this._setDragging(false);
+        }
+        
+        this._tracksMouseClickAndDrag = tracksMouseClickAndDrag;
+    },
+
+    _modifiersDidChange: function(event)
+    {
+        var canBeAdjusted = WebInspector.modifierKeys.altKey;
+        if (canBeAdjusted &amp;&amp; this._delegate &amp;&amp; typeof this._delegate.dragToAdjustControllerCanBeAdjusted === &quot;function&quot;)
+            canBeAdjusted = this._delegate.dragToAdjustControllerCanBeAdjusted(this);
+
+        this._setTracksMouseClickAndDrag(canBeAdjusted);
+    },
+    
+    _mouseMoved: function(event)
+    {
+        var canBeAdjusted = event.altKey;
+        if (canBeAdjusted &amp;&amp; this._delegate &amp;&amp; typeof this._delegate.dragToAdjustControllerCanAdjustObjectAtPoint === &quot;function&quot;)
+            canBeAdjusted = this._delegate.dragToAdjustControllerCanAdjustObjectAtPoint(this, WebInspector.Point.fromEvent(event));
+
+        this._setTracksMouseClickAndDrag(canBeAdjusted);
+    },
+    
+    _mouseWasPressed: function(event)
+    {
+        this._lastX = event.screenX;
+
+        this._setDragging(true);
+
+        event.preventDefault();
+        event.stopPropagation();
+    },
+
+    _mouseWasDragged: function(event)
+    {
+        var x = event.screenX;
+        var amount = x - this._lastX;
+
+        if (Math.abs(amount) &lt; 1)
+            return;
+
+        this._lastX = x;
+
+        if (event.ctrlKey)
+            amount /= 10;
+        else if (event.shiftKey)
+            amount *= 10;
+
+        if (this._delegate &amp;&amp; typeof this._delegate.dragToAdjustControllerWasAdjustedByAmount === &quot;function&quot;)
+            this._delegate.dragToAdjustControllerWasAdjustedByAmount(this, amount);
+
+        event.preventDefault();
+        event.stopPropagation();
+    },
+
+    _mouseWasReleased: function(event)
+    {
+        this._setDragging(false);
+
+        event.preventDefault();
+        event.stopPropagation();
+
+        this.reset();
+    }
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceMainhtml"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Main.html (164539 => 164540)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Main.html        2014-02-22 13:58:51 UTC (rev 164539)
+++ trunk/Source/WebInspectorUI/UserInterface/Main.html        2014-02-22 15:29:13 UTC (rev 164540)
</span><span class="lines">@@ -129,7 +129,7 @@
</span><span class="cx">     &lt;link rel=&quot;stylesheet&quot; href=&quot;ColorPicker.css&quot;&gt;
</span><span class="cx">     &lt;link rel=&quot;stylesheet&quot; href=&quot;GradientSlider.css&quot;&gt;
</span><span class="cx">     &lt;link rel=&quot;stylesheet&quot; href=&quot;CodeMirrorGradientEditingController.css&quot;&gt;
</span><del>-    &lt;link rel=&quot;stylesheet&quot; href=&quot;CodeMirrorDragToAlterNumberController.css&quot;&gt;
</del><ins>+    &lt;link rel=&quot;stylesheet&quot; href=&quot;CodeMirrorDragToAdjustNumberController.css&quot;&gt;
</ins><span class="cx">     &lt;link rel=&quot;stylesheet&quot; href=&quot;GoToLineDialog.css&quot;&gt;
</span><span class="cx">     &lt;link rel=&quot;stylesheet&quot; href=&quot;HoverMenu.css&quot;&gt;
</span><span class="cx">     &lt;link rel=&quot;stylesheet&quot; href=&quot;ComputedStyleDetailsPanel.css&quot;&gt;
</span><span class="lines">@@ -160,7 +160,8 @@
</span><span class="cx">     &lt;script src=&quot;URLUtilities.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;MessageDispatcher.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Object.js&quot;&gt;&lt;/script&gt;
</span><del>-    &lt;script src=&quot;CodeMirrorDragToAlterNumberController.js&quot;&gt;&lt;/script&gt;
</del><ins>+    &lt;script src=&quot;DragToAdjustController.js&quot;&gt;&lt;/script&gt;
+    &lt;script src=&quot;CodeMirrorDragToAdjustNumberController.js&quot;&gt;&lt;/script&gt;
</ins><span class="cx">     &lt;script src=&quot;CodeMirrorAdditions.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;Setting.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;InspectorBackend.js&quot;&gt;&lt;/script&gt;
</span></span></pre>
</div>
</div>

</body>
</html>