Web Inspector: Changes are not applied in CSS sidebar when switching to Resources...
authordrousso@apple.com <drousso@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 23 May 2017 04:59:53 +0000 (04:59 +0000)
committerdrousso@apple.com <drousso@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 23 May 2017 04:59:53 +0000 (04:59 +0000)
https://bugs.webkit.org/show_bug.cgi?id=172388

Reviewed by Joseph Pecoraro.

* UserInterface/Views/CSSStyleDeclarationSection.js:
(WebInspector.CSSStyleDeclarationSection.prototype.refreshEditor):
* UserInterface/Views/RulesStyleDetailsPanel.js:
(WebInspector.RulesStyleDetailsPanel.prototype.cssStyleDeclarationSectionEditorFocused):
(WebInspector.RulesStyleDetailsPanel.prototype.shown):
When showing the StyleDetailsPanel, if there is an active editor, which is now saved each
time one becomes focused, force an update of that editor's content.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217266 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationSection.js
Source/WebInspectorUI/UserInterface/Views/RulesStyleDetailsPanel.js

index 3022ad2..c67a173 100644 (file)
@@ -1,3 +1,18 @@
+2017-05-22  Devin Rousso  <drousso@apple.com>
+
+        Web Inspector: Changes are not applied in CSS sidebar when switching to Resources tab without blurring editor
+        https://bugs.webkit.org/show_bug.cgi?id=172388
+
+        Reviewed by Joseph Pecoraro.
+
+        * UserInterface/Views/CSSStyleDeclarationSection.js:
+        (WebInspector.CSSStyleDeclarationSection.prototype.refreshEditor):
+        * UserInterface/Views/RulesStyleDetailsPanel.js:
+        (WebInspector.RulesStyleDetailsPanel.prototype.cssStyleDeclarationSectionEditorFocused):
+        (WebInspector.RulesStyleDetailsPanel.prototype.shown):
+        When showing the StyleDetailsPanel, if there is an active editor, which is now saved each
+        time one becomes focused, force an update of that editor's content.
+
 2017-05-22  Joseph Pecoraro  <pecoraro@apple.com>
 
         Web Inspector: New Tab contents not centered vertically
index edc9444..d0c4a84 100644 (file)
@@ -303,6 +303,11 @@ WebInspector.CSSStyleDeclarationSection = class CSSStyleDeclarationSection exten
             this._selectorInput.value = this._selectorElement.textContent;
     }
 
+    refreshEditor()
+    {
+        this._propertiesTextEditor.refresh();
+    }
+
     highlightProperty(property)
     {
         if (this._propertiesTextEditor.highlightProperty(property)) {
index 8747704..028d6e5 100644 (file)
@@ -320,6 +320,8 @@ WebInspector.RulesStyleDetailsPanel = class RulesStyleDetailsPanel extends WebIn
             if (section !== focusedSection)
                 section.clearSelection();
         }
+
+        this._sectionWithActiveEditor = focusedSection;
     }
 
     cssStyleDeclarationSectionEditorNextRule(currentSection)
@@ -433,6 +435,11 @@ WebInspector.RulesStyleDetailsPanel = class RulesStyleDetailsPanel extends WebIn
             section.style.__rulesSection = section;
             section.updateLayout();
         }
+
+        // If there was an active section and the panel was hidden, refresh the section in case
+        // changes were made to the underlying resource.
+        if (this._sectionWithActiveEditor)
+            this._sectionWithActiveEditor.refreshEditor();
     }
 
     hidden()