Title: [242553] trunk/Source/WebInspectorUI
Revision
242553
Author
[email protected]
Date
2019-03-06 11:08:28 -0800 (Wed, 06 Mar 2019)

Log Message

Web Inspector: Canvas: color swatches aren't shown for valid inputs with leading/trailing whitespace
https://bugs.webkit.org/show_bug.cgi?id=195298

Reviewed by Timothy Hatcher.

* UserInterface/Views/RecordingActionTreeElement.js:
(WI.RecordingActionTreeElement._generateDOM):
(WI.RecordingActionTreeElement._createSwatchForColorParameters):
Trim the color string since it can be an arbitrary string, seeing as it is captured before
the <canvas> has a chance to parse/fix it.

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (242552 => 242553)


--- trunk/Source/WebInspectorUI/ChangeLog	2019-03-06 18:14:13 UTC (rev 242552)
+++ trunk/Source/WebInspectorUI/ChangeLog	2019-03-06 19:08:28 UTC (rev 242553)
@@ -1,3 +1,16 @@
+2019-03-06  Devin Rousso  <[email protected]>
+
+        Web Inspector: Canvas: color swatches aren't shown for valid inputs with leading/trailing whitespace
+        https://bugs.webkit.org/show_bug.cgi?id=195298
+
+        Reviewed by Timothy Hatcher.
+
+        * UserInterface/Views/RecordingActionTreeElement.js:
+        (WI.RecordingActionTreeElement._generateDOM):
+        (WI.RecordingActionTreeElement._createSwatchForColorParameters):
+        Trim the color string since it can be an arbitrary string, seeing as it is captured before
+        the <canvas> has a chance to parse/fix it.
+
 2019-03-05  Joseph Pecoraro  <[email protected]>
 
         Web Inspector: recordsInTimeRange sometimes does not get the expected record when includeRecordBeforeStart

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/RecordingActionTreeElement.js (242552 => 242553)


--- trunk/Source/WebInspectorUI/UserInterface/Views/RecordingActionTreeElement.js	2019-03-06 18:14:13 UTC (rev 242552)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/RecordingActionTreeElement.js	2019-03-06 19:08:28 UTC (rev 242553)
@@ -150,13 +150,7 @@
             let swatch = WI.RecordingActionTreeElement._createSwatchForColorParameters(colorParameters);
             if (swatch) {
                 let insertionIndex = recordingAction.parameters.indexOf(colorParameters[0]);
-                let parameterElement = parametersContainer.children[insertionIndex];
-                parametersContainer.insertBefore(swatch.element, parameterElement);
-
-                if (recordingAction.swizzleTypes[insertionIndex] === WI.Recording.Swizzle.String) {
-                    parameterElement.textContent = swatch.value.toString();
-                    parameterElement.classList.add("color");
-                }
+                parametersContainer.insertBefore(swatch.element, parametersContainer.children[insertionIndex]);
             }
         }
 
@@ -198,7 +192,7 @@
         case 1:
         case 2:
             if (typeof parameters[0] === "string")
-                color = WI.Color.fromString(parameters[0]);
+                color = WI.Color.fromString(parameters[0].trim());
             else if (!isNaN(parameters[0]))
                 rgb = WI.Color.normalized2rgb(parameters[0], parameters[0], parameters[0]);
             break;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to