Title: [250955] trunk/Source/WebInspectorUI
Revision
250955
Author
[email protected]
Date
2019-10-09 22:12:58 -0700 (Wed, 09 Oct 2019)

Log Message

REGRESSION(r250948): Web Inspector: Styles: CSS selector becomes gray after stopping editing without modifying it
https://bugs.webkit.org/show_bug.cgi?id=202781

Reviewed by Matt Baker.

When not editing, CSS selectors that match the selected node are highlighted (black in the light mode,
white in the dark mode). When editing starts, span elements that provide highlighting get removed.
When editing stops, active selectors should get highlighted.

r250948 stopped calling `_renderSelector` when selector wasn't modified.

* UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js:
(WI.SpreadsheetCSSStyleDeclarationSection.prototype.spreadsheetSelectorFieldDidCommit):
* UserInterface/Views/SpreadsheetSelectorField.js:
(WI.SpreadsheetSelectorField.prototype._handleBlur):

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (250954 => 250955)


--- trunk/Source/WebInspectorUI/ChangeLog	2019-10-10 03:08:32 UTC (rev 250954)
+++ trunk/Source/WebInspectorUI/ChangeLog	2019-10-10 05:12:58 UTC (rev 250955)
@@ -1,5 +1,23 @@
 2019-10-09  Nikita Vasilyev  <[email protected]>
 
+        REGRESSION(r250948): Web Inspector: Styles: CSS selector becomes gray after stopping editing without modifying it
+        https://bugs.webkit.org/show_bug.cgi?id=202781
+
+        Reviewed by Matt Baker.
+
+        When not editing, CSS selectors that match the selected node are highlighted (black in the light mode,
+        white in the dark mode). When editing starts, span elements that provide highlighting get removed.
+        When editing stops, active selectors should get highlighted.
+
+        r250948 stopped calling `_renderSelector` when selector wasn't modified.
+
+        * UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js:
+        (WI.SpreadsheetCSSStyleDeclarationSection.prototype.spreadsheetSelectorFieldDidCommit):
+        * UserInterface/Views/SpreadsheetSelectorField.js:
+        (WI.SpreadsheetSelectorField.prototype._handleBlur):
+
+2019-10-09  Nikita Vasilyev  <[email protected]>
+
         Web Inspector: Modifying CSS selector by pressing Enter or Tab causes 2 CSS.setRuleSelector backend calls
         https://bugs.webkit.org/show_bug.cgi?id=202769
         <rdar://problem/56132166>

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js (250954 => 250955)


--- trunk/Source/WebInspectorUI/UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js	2019-10-10 03:08:32 UTC (rev 250954)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js	2019-10-10 05:12:58 UTC (rev 250955)
@@ -226,10 +226,10 @@
 
     // SpreadsheetSelectorField delegate
 
-    spreadsheetSelectorFieldDidCommit()
+    spreadsheetSelectorFieldDidCommit(changed)
     {
         let selectorText = this._selectorElement.textContent.trim();
-        if (selectorText) {
+        if (selectorText && changed) {
             this.dispatchEventToListeners(WI.SpreadsheetCSSStyleDeclarationSection.Event.SelectorWillChange);
             this._style.ownerRule.singleFireEventListener(WI.CSSRule.Event.SelectorChanged, this._renderSelector, this);
             this._style.ownerRule.selectorText = selectorText;

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/SpreadsheetSelectorField.js (250954 => 250955)


--- trunk/Source/WebInspectorUI/UserInterface/Views/SpreadsheetSelectorField.js	2019-10-10 03:08:32 UTC (rev 250954)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/SpreadsheetSelectorField.js	2019-10-10 05:12:58 UTC (rev 250955)
@@ -111,8 +111,8 @@
             return;
 
         if (this._delegate && typeof this._delegate.spreadsheetSelectorFieldDidCommit === "function") {
-            if (this._element.textContent !== this._valueBeforeEditing)
-                this._delegate.spreadsheetSelectorFieldDidCommit();
+            let changed = this._element.textContent !== this._valueBeforeEditing;
+            this._delegate.spreadsheetSelectorFieldDidCommit(changed);
         }
 
         this.stopEditing();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to