Title: [186537] trunk/Source/WebInspectorUI
Revision
186537
Author
drou...@apple.com
Date
2015-07-08 16:46:11 -0700 (Wed, 08 Jul 2015)

Log Message

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.

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (186536 => 186537)


--- trunk/Source/WebInspectorUI/ChangeLog	2015-07-08 23:44:40 UTC (rev 186536)
+++ trunk/Source/WebInspectorUI/ChangeLog	2015-07-08 23:46:11 UTC (rev 186537)
@@ -1,5 +1,17 @@
 2015-07-08  Devin Rousso  <drou...@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  <drou...@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
 

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationTextEditor.js (186536 => 186537)


--- trunk/Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationTextEditor.js	2015-07-08 23:44:40 UTC (rev 186536)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationTextEditor.js	2015-07-08 23:46:11 UTC (rev 186537)
@@ -1523,7 +1523,13 @@
             // 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 @@
             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));
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to