Web Inspector: Canvas: WebGL action icon shouldn't invert when selected
authordrousso@apple.com <drousso@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 24 Mar 2019 20:23:32 +0000 (20:23 +0000)
committerdrousso@apple.com <drousso@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 24 Mar 2019 20:23:32 +0000 (20:23 +0000)
https://bugs.webkit.org/show_bug.cgi?id=196135

Reviewed by Timothy Hatcher.

* UserInterface/Views/RecordingActionTreeElement.js:
(WI.RecordingActionTreeElement._classNameForAction):
(WI.RecordingActionTreeElement._classNameForAction.classNameForActionName): Deleted.
Remove unnecessary logging and memoization.

* UserInterface/Views/RecordingActionTreeElement.css:
(.tree-outline:focus .item.recording-action.selected:not(.invalid, .initial-state, .has-context-replacer, .name-unknown) > .icon): Added.
(@media (prefers-color-scheme: dark)):
(.item.recording-action:not(.invalid, .initial-state, .has-context-replacer, .name-unknown) > .icon): Added.
(.tree-outline:focus .item.recording-action.selected:not(.invalid, .initial-state, .has-context-replacer) > .icon): Deleted.
(.item.recording-action.has-context-replacer > .icon): Deleted.
(.item.recording-action:not(.invalid, .initial-state, .has-context-replacer) > .icon): Deleted.
Simplify styles between light and dark mode.

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

Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Views/RecordingActionTreeElement.css
Source/WebInspectorUI/UserInterface/Views/RecordingActionTreeElement.js

index 7b58702..9a8b2ae 100644 (file)
@@ -1,3 +1,24 @@
+2019-03-24  Devin Rousso  <drousso@apple.com>
+
+        Web Inspector: Canvas: WebGL action icon shouldn't invert when selected
+        https://bugs.webkit.org/show_bug.cgi?id=196135
+
+        Reviewed by Timothy Hatcher.
+
+        * UserInterface/Views/RecordingActionTreeElement.js:
+        (WI.RecordingActionTreeElement._classNameForAction):
+        (WI.RecordingActionTreeElement._classNameForAction.classNameForActionName): Deleted.
+        Remove unnecessary logging and memoization.
+
+        * UserInterface/Views/RecordingActionTreeElement.css:
+        (.tree-outline:focus .item.recording-action.selected:not(.invalid, .initial-state, .has-context-replacer, .name-unknown) > .icon): Added.
+        (@media (prefers-color-scheme: dark)):
+        (.item.recording-action:not(.invalid, .initial-state, .has-context-replacer, .name-unknown) > .icon): Added.
+        (.tree-outline:focus .item.recording-action.selected:not(.invalid, .initial-state, .has-context-replacer) > .icon): Deleted.
+        (.item.recording-action.has-context-replacer > .icon): Deleted.
+        (.item.recording-action:not(.invalid, .initial-state, .has-context-replacer) > .icon): Deleted.
+        Simplify styles between light and dark mode.
+
 2019-03-24  Simon Welsh  <simon@welsh-au.com>
 
         Web Inspector: testCellRoleForRequiredChidren accessibility audit checks for rows in cells
index 6483b48..f350b26 100644 (file)
@@ -50,7 +50,7 @@ body[dir=rtl] .item.recording-action::before {
     float: right;
 }
 
-.tree-outline:focus .item.recording-action.selected:not(.invalid, .initial-state, .has-context-replacer) > .icon {
+.tree-outline:focus .item.recording-action.selected:not(.invalid, .initial-state, .has-context-replacer, .name-unknown) > .icon {
     filter: invert();
     opacity: 1;
 }
@@ -131,10 +131,6 @@ body:not(.window-inactive, .window-docked-inactive) .tree-outline:focus .item.re
     vertical-align: -1px;
 }
 
-.item.recording-action.has-context-replacer > .icon {
-    content: url("../Images/Source.svg");
-}
-
 .item.recording-action.composite > .icon {
     content: url(../Images/Composite.svg);
 }
@@ -229,16 +225,11 @@ body:not(.window-inactive, .window-docked-inactive) .tree-outline:focus .item.re
 }
 
 @media (prefers-color-scheme: dark) {
-    .item.recording-action:not(.initial-state)::before {
-        color: unset;
-        opacity: 0.4;
-    }
-
     .tree-outline .item.recording-action.visual:not(.selected, .invalid) {
         color: var(--green-highlight-text-color);
     }
 
-    .item.recording-action:not(.invalid, .initial-state, .has-context-replacer) > .icon {
+    .item.recording-action:not(.invalid, .initial-state, .has-context-replacer, .name-unknown) > .icon {
         filter: invert();
         opacity: 0.8;
     }
index 05fbc55..8ec1829 100644 (file)
@@ -254,130 +254,118 @@ WI.RecordingActionTreeElement = class RecordingActionTreeElement extends WI.Gene
         if (recordingAction.contextReplacer)
             return "has-context-replacer";
 
-        function classNameForActionName(name) {
-            switch (name) {
-            case "arc":
-            case "arcTo":
-                return "arc";
-
-            case "globalAlpha":
-            case "globalCompositeOperation":
-            case "setAlpha":
-            case "setGlobalAlpha":
-            case "setCompositeOperation":
-            case "setGlobalCompositeOperation":
-                return "composite";
-
-            case "bezierCurveTo":
-            case "quadraticCurveTo":
-                return "curve";
-
-            case "clearRect":
-            case "fill":
-            case "fillRect":
-            case "fillText":
-                return "fill";
-
-            case "createImageData":
-            case "drawFocusIfNeeded":
-            case "drawImage":
-            case "drawImageFromRect":
-            case "filter":
-            case "getImageData":
-            case "imageSmoothingEnabled":
-            case "imageSmoothingQuality":
-            case "putImageData":
-            case "transferFromImageBitmap":
-            case "webkitImageSmoothingEnabled":
-                return "image";
-
-            case "getLineDash":
-            case "lineCap":
-            case "lineDashOffset":
-            case "lineJoin":
-            case "lineWidth":
-            case "miterLimit":
-            case "setLineCap":
-            case "setLineDash":
-            case "setLineJoin":
-            case "setLineWidth":
-            case "setMiterLimit":
-            case "webkitLineDash":
-            case "webkitLineDashOffset":
-                return "line-style";
-
-            case "closePath":
-            case "lineTo":
-                return "line-to";
-
-            case "beginPath":
-            case "moveTo":
-                return "move-to";
-
-            case "isPointInPath":
-                return "point-in-path";
-
-            case "isPointInStroke":
-                return "point-in-stroke";
-
-            case "clearShadow":
-            case "setShadow":
-            case "shadowBlur":
-            case "shadowColor":
-            case "shadowOffsetX":
-            case "shadowOffsetY":
-                return "shadow";
-
-            case "createLinearGradient":
-            case "createPattern":
-            case "createRadialGradient":
-            case "fillStyle":
-            case "setFillColor":
-            case "setStrokeColor":
-            case "strokeStyle":
-                return "style";
-
-            case "stroke":
-            case "strokeRect":
-            case "strokeText":
-                return "stroke";
-
-            case "direction":
-            case "font":
-            case "measureText":
-            case "textAlign":
-            case "textBaseline":
-                return "text";
-
-            case "getTransform":
-            case "resetTransform":
-            case "rotate":
-            case "scale":
-            case "setTransform":
-            case "transform":
-            case "translate":
-                return "transform";
-
-            case "clip":
-            case "ellipse":
-            case "rect":
-            case "restore":
-            case "save":
-                return name;
-            }
-
-            console.warn("No class name for action " + name);
-            return "";
+        switch (recordingAction.name) {
+        case "arc":
+        case "arcTo":
+            return "arc";
+
+        case "globalAlpha":
+        case "globalCompositeOperation":
+        case "setAlpha":
+        case "setGlobalAlpha":
+        case "setCompositeOperation":
+        case "setGlobalCompositeOperation":
+            return "composite";
+
+        case "bezierCurveTo":
+        case "quadraticCurveTo":
+            return "curve";
+
+        case "clearRect":
+        case "fill":
+        case "fillRect":
+        case "fillText":
+            return "fill";
+
+        case "createImageData":
+        case "drawFocusIfNeeded":
+        case "drawImage":
+        case "drawImageFromRect":
+        case "filter":
+        case "getImageData":
+        case "imageSmoothingEnabled":
+        case "imageSmoothingQuality":
+        case "putImageData":
+        case "transferFromImageBitmap":
+        case "webkitImageSmoothingEnabled":
+            return "image";
+
+        case "getLineDash":
+        case "lineCap":
+        case "lineDashOffset":
+        case "lineJoin":
+        case "lineWidth":
+        case "miterLimit":
+        case "setLineCap":
+        case "setLineDash":
+        case "setLineJoin":
+        case "setLineWidth":
+        case "setMiterLimit":
+        case "webkitLineDash":
+        case "webkitLineDashOffset":
+            return "line-style";
+
+        case "closePath":
+        case "lineTo":
+            return "line-to";
+
+        case "beginPath":
+        case "moveTo":
+            return "move-to";
+
+        case "isPointInPath":
+            return "point-in-path";
+
+        case "isPointInStroke":
+            return "point-in-stroke";
+
+        case "clearShadow":
+        case "setShadow":
+        case "shadowBlur":
+        case "shadowColor":
+        case "shadowOffsetX":
+        case "shadowOffsetY":
+            return "shadow";
+
+        case "createLinearGradient":
+        case "createPattern":
+        case "createRadialGradient":
+        case "fillStyle":
+        case "setFillColor":
+        case "setStrokeColor":
+        case "strokeStyle":
+            return "style";
+
+        case "stroke":
+        case "strokeRect":
+        case "strokeText":
+            return "stroke";
+
+        case "direction":
+        case "font":
+        case "measureText":
+        case "textAlign":
+        case "textBaseline":
+            return "text";
+
+        case "getTransform":
+        case "resetTransform":
+        case "rotate":
+        case "scale":
+        case "setTransform":
+        case "transform":
+        case "translate":
+            return "transform";
+
+        case "clip":
+        case "ellipse":
+        case "rect":
+        case "restore":
+        case "save":
+            return recordingAction.name;
         }
 
-        const name = recordingAction.name;
-        let className = WI.RecordingActionTreeElement._memoizedActionClassNames.get(name);
-        if (!className) {
-            className = classNameForActionName(name);
-            WI.RecordingActionTreeElement._memoizedActionClassNames.set(name, className);
-        }
-
-        return className;
+        return "name-unknown";
     }
 
     // Public
@@ -464,5 +452,3 @@ WI.RecordingActionTreeElement = class RecordingActionTreeElement extends WI.Gene
         this.representedObject.removeEventListener(null, null, this);
     }
 };
-
-WI.RecordingActionTreeElement._memoizedActionClassNames = new Map;