Title: [197080] releases/WebKitGTK/webkit-2.12/Source/WebInspectorUI
Revision
197080
Author
carlo...@webkit.org
Date
2016-02-25 02:04:13 -0800 (Thu, 25 Feb 2016)

Log Message

Merge r196869 - Web Inspector: Opacity slider thumb sometimes goes past the bar in Visual Styles sidebar
https://bugs.webkit.org/show_bug.cgi?id=154497

Patch by Devin Rousso <dcrousso+web...@gmail.com> on 2016-02-20
Reviewed by Timothy Hatcher.

Since WebInspector.Slider uses CSS transforms to move the slider knob
along the track, if the width of the track changes then the position
of the knob would stay the same since it was translated instead of
adjusting its position relative to the new width.

* UserInterface/Views/Slider.js:
(WebInspector.Slider.prototype.recalculateKnobX):
Resets the maxX value to 0 to ensure that a new maxX is calculated with
the current width.

* UserInterface/Views/VisualStyleCommaSeparatedKeywordEditor.js:
(WebInspector.VisualStyleCommaSeparatedKeywordEditor.prototype.set specifiedWidth): Deleted.
(WebInspector.VisualStyleCommaSeparatedKeywordEditor.prototype.recalculateWidth):

* UserInterface/Views/VisualStyleDetailsPanel.js:
(WebInspector.VisualStyleDetailsPanel.prototype.widthDidChange):
(WebInspector.VisualStyleDetailsPanel.prototype._updateProperties):
(WebInspector.VisualStyleDetailsPanel.prototype._populateDisplaySection):

* UserInterface/Views/VisualStyleUnitSlider.js:
(WebInspector.VisualStyleUnitSlider.prototype.recalculateWidth):

Modified Paths

Diff

Modified: releases/WebKitGTK/webkit-2.12/Source/WebInspectorUI/ChangeLog (197079 => 197080)


--- releases/WebKitGTK/webkit-2.12/Source/WebInspectorUI/ChangeLog	2016-02-25 10:02:13 UTC (rev 197079)
+++ releases/WebKitGTK/webkit-2.12/Source/WebInspectorUI/ChangeLog	2016-02-25 10:04:13 UTC (rev 197080)
@@ -1,5 +1,34 @@
 2016-02-20  Devin Rousso  <dcrousso+web...@gmail.com>
 
+        Web Inspector: Opacity slider thumb sometimes goes past the bar in Visual Styles sidebar
+        https://bugs.webkit.org/show_bug.cgi?id=154497
+
+        Reviewed by Timothy Hatcher.
+
+        Since WebInspector.Slider uses CSS transforms to move the slider knob
+        along the track, if the width of the track changes then the position
+        of the knob would stay the same since it was translated instead of
+        adjusting its position relative to the new width.
+
+        * UserInterface/Views/Slider.js:
+        (WebInspector.Slider.prototype.recalculateKnobX):
+        Resets the maxX value to 0 to ensure that a new maxX is calculated with
+        the current width.
+
+        * UserInterface/Views/VisualStyleCommaSeparatedKeywordEditor.js:
+        (WebInspector.VisualStyleCommaSeparatedKeywordEditor.prototype.set specifiedWidth): Deleted.
+        (WebInspector.VisualStyleCommaSeparatedKeywordEditor.prototype.recalculateWidth):
+
+        * UserInterface/Views/VisualStyleDetailsPanel.js:
+        (WebInspector.VisualStyleDetailsPanel.prototype.widthDidChange):
+        (WebInspector.VisualStyleDetailsPanel.prototype._updateProperties):
+        (WebInspector.VisualStyleDetailsPanel.prototype._populateDisplaySection):
+
+        * UserInterface/Views/VisualStyleUnitSlider.js:
+        (WebInspector.VisualStyleUnitSlider.prototype.recalculateWidth):
+
+2016-02-20  Devin Rousso  <dcrousso+web...@gmail.com>
+
         Web Inspector: Visual Styles: Modifying background expands Font section
         https://bugs.webkit.org/show_bug.cgi?id=154491
         <rdar://problem/24755440>

Modified: releases/WebKitGTK/webkit-2.12/Source/WebInspectorUI/UserInterface/Views/Slider.js (197079 => 197080)


--- releases/WebKitGTK/webkit-2.12/Source/WebInspectorUI/UserInterface/Views/Slider.js	2016-02-25 10:02:13 UTC (rev 197079)
+++ releases/WebKitGTK/webkit-2.12/Source/WebInspectorUI/UserInterface/Views/Slider.js	2016-02-25 10:04:13 UTC (rev 197080)
@@ -81,6 +81,12 @@
         return this._maxX;
     }
 
+    recalculateKnobX()
+    {
+        this._maxX = 0;
+        this.knobX = this._value;
+    }
+
     // Protected
 
     handleEvent(event)

Modified: releases/WebKitGTK/webkit-2.12/Source/WebInspectorUI/UserInterface/Views/VisualStyleCommaSeparatedKeywordEditor.js (197079 => 197080)


--- releases/WebKitGTK/webkit-2.12/Source/WebInspectorUI/UserInterface/Views/VisualStyleCommaSeparatedKeywordEditor.js	2016-02-25 10:02:13 UTC (rev 197079)
+++ releases/WebKitGTK/webkit-2.12/Source/WebInspectorUI/UserInterface/Views/VisualStyleCommaSeparatedKeywordEditor.js	2016-02-25 10:04:13 UTC (rev 197080)
@@ -125,7 +125,7 @@
         return this.value || null;
     }
 
-    set specifiedWidth(value)
+    recalculateWidth(value)
     {
         if (this._titleElement) {
             // 55px width and 4px margin on left and right for title element,

Modified: releases/WebKitGTK/webkit-2.12/Source/WebInspectorUI/UserInterface/Views/VisualStyleDetailsPanel.js (197079 => 197080)


--- releases/WebKitGTK/webkit-2.12/Source/WebInspectorUI/UserInterface/Views/VisualStyleDetailsPanel.js	2016-02-25 10:02:13 UTC (rev 197079)
+++ releases/WebKitGTK/webkit-2.12/Source/WebInspectorUI/UserInterface/Views/VisualStyleDetailsPanel.js	2016-02-25 10:04:13 UTC (rev 197080)
@@ -118,14 +118,14 @@
     {
         super.widthDidChange();
 
-        let width = this.element.realOffsetWidth;
+        let sidebarWidth = this.element.realOffsetWidth;
         for (let key in this._groups) {
             let group = this._groups[key];
             if (!group.specifiedWidthProperties)
                 continue;
 
             for (let editor of group.specifiedWidthProperties)
-                editor.specifiedWidth = width;
+                editor.recalculateWidth(sidebarWidth);
         }
     }
 
@@ -221,9 +221,9 @@
         }
 
         if (group.specifiedWidthProperties) {
-            let width = this.element.realOffsetWidth;
+            let sidebarWidth = this.element.realOffsetWidth;
             for (let editor of group.specifiedWidthProperties)
-                editor.specifiedWidth = width;
+                editor.recalculateWidth(sidebarWidth);
         }
     }
 
@@ -350,6 +350,8 @@
         overflowRow.element.appendChild(properties.opacity.element);
         overflowRow.element.appendChild(properties.overflow.element);
 
+        group.specifiedWidthProperties = [properties.opacity];
+
         let displayGroup = new WebInspector.DetailsSectionGroup([displayRow, sizingRow, overflowRow]);
         this._populateSection(group, [displayGroup]);
     }

Modified: releases/WebKitGTK/webkit-2.12/Source/WebInspectorUI/UserInterface/Views/VisualStyleUnitSlider.js (197079 => 197080)


--- releases/WebKitGTK/webkit-2.12/Source/WebInspectorUI/UserInterface/Views/VisualStyleUnitSlider.js	2016-02-25 10:02:13 UTC (rev 197079)
+++ releases/WebKitGTK/webkit-2.12/Source/WebInspectorUI/UserInterface/Views/VisualStyleUnitSlider.js	2016-02-25 10:04:13 UTC (rev 197080)
@@ -55,6 +55,11 @@
         return this.value;
     }
 
+    recalculateWidth(value)
+    {
+        this._slider.recalculateKnobX();
+    }
+
     sliderValueDidChange(slider, value)
     {
         this._valueDidChange();
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to