Web Inspector: Confusingly crossed out properties in .sidebar > .panel.navigation...
authordrousso@apple.com <drousso@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 8 Jul 2015 23:46:11 +0000 (23:46 +0000)
committerdrousso@apple.com <drousso@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 8 Jul 2015 23:46:11 +0000 (23:46 +0000)
https://bugs.webkit.org/show_bug.cgi?id=146727

Reviewed by Timothy Hatcher.

* UserInterface/Views/CSSStyleDeclarationTextEditor.js:
(WebInspector.CSSStyleDeclarationTextEditor.prototype._resetContent.update):
The properties map used for refreshing each property now holds a list of properties for each line to ensure that
if a duplicate property exists, it also gets refreshed.

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

Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationTextEditor.js

index 2df1820..f2c57cc 100644 (file)
@@ -1,5 +1,17 @@
 2015-07-08  Devin Rousso  <drousso@apple.com>
 
+        Web Inspector: Confusingly crossed out properties in .sidebar > .panel.navigation.timeline > .title-bar
+        https://bugs.webkit.org/show_bug.cgi?id=146727
+
+        Reviewed by Timothy Hatcher.
+
+        * UserInterface/Views/CSSStyleDeclarationTextEditor.js:
+        (WebInspector.CSSStyleDeclarationTextEditor.prototype._resetContent.update):
+        The properties map used for refreshing each property now holds a list of properties for each line to ensure that
+        if a duplicate property exists, it also gets refreshed.
+
+2015-07-08  Devin Rousso  <drousso@apple.com>
+
         Web Inspector: Can't select last row in the timeline because it's covered by filter selector
         https://bugs.webkit.org/show_bug.cgi?id=146603
 
index 1aabaac..235bafb 100644 (file)
@@ -1523,7 +1523,13 @@ WebInspector.CSSStyleDeclarationTextEditor = class CSSStyleDeclarationTextEditor
             // 2) `_createTextMarkerForPropertyIfNeeded` relies on CSSProperty instances.
             var cssPropertiesMap = new Map();
             this._iterateOverProperties(false, function(cssProperty) {
-                cssPropertiesMap.set(cssProperty.text.replace(findWhitespace, ""), cssProperty);
+                cssProperty.__refreshedAfterBlur = false;
+
+                var propertyTextSansWhitespace = cssProperty.text.replace(findWhitespace, "");
+                var existingProperties = cssPropertiesMap.get(propertyTextSansWhitespace) || [];
+                existingProperties.push(cssProperty);
+
+                cssPropertiesMap.set(propertyTextSansWhitespace, existingProperties);
             });
 
             // Go through the Editor line by line and create TextMarker when a
@@ -1531,10 +1537,22 @@ WebInspector.CSSStyleDeclarationTextEditor = class CSSStyleDeclarationTextEditor
             this._codeMirror.eachLine(function(lineHandler) {
                 var lineNumber = lineHandler.lineNo();
                 var lineContentSansWhitespace = lineHandler.text.replace(findWhitespace, "");
-                if (cssPropertiesMap.has(lineContentSansWhitespace)) {
+                var properties = cssPropertiesMap.get(lineContentSansWhitespace);
+
+                if (!properties)
+                    return;
+
+                for (var property of properties) {
+                    if (property.__refreshedAfterBlur)
+                        continue;
+
                     var from = {line: lineNumber, ch: 0};
                     var to = {line: lineNumber};
-                    this._createTextMarkerForPropertyIfNeeded(from, to, cssPropertiesMap.get(lineContentSansWhitespace));
+
+                    this._createTextMarkerForPropertyIfNeeded(from, to, property);
+                    property.__refreshedAfterBlur = true;
+
+                    break;
                 }
             }.bind(this));