Title: [196863] trunk/Source/WebInspectorUI
Revision
196863
Author
[email protected]
Date
2016-02-20 10:16:37 -0800 (Sat, 20 Feb 2016)

Log Message

Web Inspector: Text Align segmented control blinks while editing other properties in Visual Styles sidebar
https://bugs.webkit.org/show_bug.cgi?id=154487
<rdar://problem/24754703>

Patch by Devin Rousso <[email protected]> on 2016-02-20
Reviewed by Timothy Hatcher.

The icon list property editor blinking issue was caused by the fact that
the selected value was toggled on/off each time the value was set on the
editor. In order to prevent this, the logic for the setter value() was
modified to just match a keyword icon to the given value and select it.

* UserInterface/Views/VisualStyleKeywordIconList.js:
(WebInspector.VisualStyleKeywordIconList.prototype.set value):
(WebInspector.VisualStyleKeywordIconList.prototype._handleKeywordChanged):

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (196862 => 196863)


--- trunk/Source/WebInspectorUI/ChangeLog	2016-02-20 17:02:16 UTC (rev 196862)
+++ trunk/Source/WebInspectorUI/ChangeLog	2016-02-20 18:16:37 UTC (rev 196863)
@@ -1,3 +1,20 @@
+2016-02-20  Devin Rousso  <[email protected]>
+
+        Web Inspector: Text Align segmented control blinks while editing other properties in Visual Styles sidebar
+        https://bugs.webkit.org/show_bug.cgi?id=154487
+        <rdar://problem/24754703>
+
+        Reviewed by Timothy Hatcher.
+
+        The icon list property editor blinking issue was caused by the fact that
+        the selected value was toggled on/off each time the value was set on the
+        editor. In order to prevent this, the logic for the setter value() was
+        modified to just match a keyword icon to the given value and select it.
+
+        * UserInterface/Views/VisualStyleKeywordIconList.js:
+        (WebInspector.VisualStyleKeywordIconList.prototype.set value):
+        (WebInspector.VisualStyleKeywordIconList.prototype._handleKeywordChanged):
+
 2016-02-20  Nikita Vasilyev  <[email protected]>
 
         Web Inspector: Placeholder text in Visual Styles sidebar table row should be white

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/VisualStyleKeywordIconList.js (196862 => 196863)


--- trunk/Source/WebInspectorUI/UserInterface/Views/VisualStyleKeywordIconList.js	2016-02-20 17:02:16 UTC (rev 196862)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/VisualStyleKeywordIconList.js	2016-02-20 18:16:37 UTC (rev 196863)
@@ -75,24 +75,22 @@
         this._computedIcon = null;
         this._selectedIcon = null;
         for (let icon of this._iconElements) {
+            icon.classList.remove("selected", "computed");
+
             if (icon.id === this._updatedValues.placeholder)
                 this._computedIcon = icon;
 
             if (icon.id === value && !this._propertyMissing)
                 this._selectedIcon = icon;
-            else
-                icon.classList.remove("selected", "computed");
         }
 
         if (!this._computedIcon)
             this._computedIcon = this._iconElements[0];
 
-        let iconIsSelected = this._selectedIcon && this._selectedIcon.classList.toggle("selected");
-        if (!iconIsSelected) {
-            this._selectedIcon = null;
-            this._propertyMissing = true;
+        if (this._selectedIcon)
+            this._selectedIcon.classList.add("selected");
+        else
             this._computedIcon.classList.add("computed");
-        }
     }
 
     get synthesizedValue()
@@ -104,8 +102,9 @@
 
     _handleKeywordChanged(event)
     {
-        this._propertyMissing = false;
-        this.value = event.target.id;
+        let toggleOff = this.value === event.target.id;
+        this._propertyMissing = toggleOff;
+        this.value = toggleOff ? null : event.target.id;
         this._valueDidChange();
     }
 };
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to