Changeset 243426 in webkit


Ignore:
Timestamp:
Mar 24, 2019 1:23:32 PM (5 years ago)
Author:
Devin Rousso
Message:

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.

Location:
trunk/Source/WebInspectorUI
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r243425 r243426  
     12019-03-24  Devin Rousso  <drousso@apple.com>
     2
     3        Web Inspector: Canvas: WebGL action icon shouldn't invert when selected
     4        https://bugs.webkit.org/show_bug.cgi?id=196135
     5
     6        Reviewed by Timothy Hatcher.
     7
     8        * UserInterface/Views/RecordingActionTreeElement.js:
     9        (WI.RecordingActionTreeElement._classNameForAction):
     10        (WI.RecordingActionTreeElement._classNameForAction.classNameForActionName): Deleted.
     11        Remove unnecessary logging and memoization.
     12
     13        * UserInterface/Views/RecordingActionTreeElement.css:
     14        (.tree-outline:focus .item.recording-action.selected:not(.invalid, .initial-state, .has-context-replacer, .name-unknown) > .icon): Added.
     15        (@media (prefers-color-scheme: dark)):
     16        (.item.recording-action:not(.invalid, .initial-state, .has-context-replacer, .name-unknown) > .icon): Added.
     17        (.tree-outline:focus .item.recording-action.selected:not(.invalid, .initial-state, .has-context-replacer) > .icon): Deleted.
     18        (.item.recording-action.has-context-replacer > .icon): Deleted.
     19        (.item.recording-action:not(.invalid, .initial-state, .has-context-replacer) > .icon): Deleted.
     20        Simplify styles between light and dark mode.
     21
    1222019-03-24  Simon Welsh  <simon@welsh-au.com>
    223
  • trunk/Source/WebInspectorUI/UserInterface/Views/RecordingActionTreeElement.css

    r242768 r243426  
    5151}
    5252
    53 .tree-outline:focus .item.recording-action.selected:not(.invalid, .initial-state, .has-context-replacer) > .icon {
     53.tree-outline:focus .item.recording-action.selected:not(.invalid, .initial-state, .has-context-replacer, .name-unknown) > .icon {
    5454    filter: invert();
    5555    opacity: 1;
     
    130130.item.recording-action > .titles .parameters > .inline-swatch {
    131131    vertical-align: -1px;
    132 }
    133 
    134 .item.recording-action.has-context-replacer > .icon {
    135     content: url("../Images/Source.svg");
    136132}
    137133
     
    230226
    231227@media (prefers-color-scheme: dark) {
    232     .item.recording-action:not(.initial-state)::before {
    233         color: unset;
    234         opacity: 0.4;
    235     }
    236 
    237228    .tree-outline .item.recording-action.visual:not(.selected, .invalid) {
    238229        color: var(--green-highlight-text-color);
    239230    }
    240231
    241     .item.recording-action:not(.invalid, .initial-state, .has-context-replacer) > .icon {
     232    .item.recording-action:not(.invalid, .initial-state, .has-context-replacer, .name-unknown) > .icon {
    242233        filter: invert();
    243234        opacity: 0.8;
  • trunk/Source/WebInspectorUI/UserInterface/Views/RecordingActionTreeElement.js

    r243403 r243426  
    255255            return "has-context-replacer";
    256256
    257         function classNameForActionName(name) {
    258             switch (name) {
    259             case "arc":
    260             case "arcTo":
    261                 return "arc";
    262 
    263             case "globalAlpha":
    264             case "globalCompositeOperation":
    265             case "setAlpha":
    266             case "setGlobalAlpha":
    267             case "setCompositeOperation":
    268             case "setGlobalCompositeOperation":
    269                 return "composite";
    270 
    271             case "bezierCurveTo":
    272             case "quadraticCurveTo":
    273                 return "curve";
    274 
    275             case "clearRect":
    276             case "fill":
    277             case "fillRect":
    278             case "fillText":
    279                 return "fill";
    280 
    281             case "createImageData":
    282             case "drawFocusIfNeeded":
    283             case "drawImage":
    284             case "drawImageFromRect":
    285             case "filter":
    286             case "getImageData":
    287             case "imageSmoothingEnabled":
    288             case "imageSmoothingQuality":
    289             case "putImageData":
    290             case "transferFromImageBitmap":
    291             case "webkitImageSmoothingEnabled":
    292                 return "image";
    293 
    294             case "getLineDash":
    295             case "lineCap":
    296             case "lineDashOffset":
    297             case "lineJoin":
    298             case "lineWidth":
    299             case "miterLimit":
    300             case "setLineCap":
    301             case "setLineDash":
    302             case "setLineJoin":
    303             case "setLineWidth":
    304             case "setMiterLimit":
    305             case "webkitLineDash":
    306             case "webkitLineDashOffset":
    307                 return "line-style";
    308 
    309             case "closePath":
    310             case "lineTo":
    311                 return "line-to";
    312 
    313             case "beginPath":
    314             case "moveTo":
    315                 return "move-to";
    316 
    317             case "isPointInPath":
    318                 return "point-in-path";
    319 
    320             case "isPointInStroke":
    321                 return "point-in-stroke";
    322 
    323             case "clearShadow":
    324             case "setShadow":
    325             case "shadowBlur":
    326             case "shadowColor":
    327             case "shadowOffsetX":
    328             case "shadowOffsetY":
    329                 return "shadow";
    330 
    331             case "createLinearGradient":
    332             case "createPattern":
    333             case "createRadialGradient":
    334             case "fillStyle":
    335             case "setFillColor":
    336             case "setStrokeColor":
    337             case "strokeStyle":
    338                 return "style";
    339 
    340             case "stroke":
    341             case "strokeRect":
    342             case "strokeText":
    343                 return "stroke";
    344 
    345             case "direction":
    346             case "font":
    347             case "measureText":
    348             case "textAlign":
    349             case "textBaseline":
    350                 return "text";
    351 
    352             case "getTransform":
    353             case "resetTransform":
    354             case "rotate":
    355             case "scale":
    356             case "setTransform":
    357             case "transform":
    358             case "translate":
    359                 return "transform";
    360 
    361             case "clip":
    362             case "ellipse":
    363             case "rect":
    364             case "restore":
    365             case "save":
    366                 return name;
    367             }
    368 
    369             console.warn("No class name for action " + name);
    370             return "";
    371         }
    372 
    373         const name = recordingAction.name;
    374         let className = WI.RecordingActionTreeElement._memoizedActionClassNames.get(name);
    375         if (!className) {
    376             className = classNameForActionName(name);
    377             WI.RecordingActionTreeElement._memoizedActionClassNames.set(name, className);
    378         }
    379 
    380         return className;
     257        switch (recordingAction.name) {
     258        case "arc":
     259        case "arcTo":
     260            return "arc";
     261
     262        case "globalAlpha":
     263        case "globalCompositeOperation":
     264        case "setAlpha":
     265        case "setGlobalAlpha":
     266        case "setCompositeOperation":
     267        case "setGlobalCompositeOperation":
     268            return "composite";
     269
     270        case "bezierCurveTo":
     271        case "quadraticCurveTo":
     272            return "curve";
     273
     274        case "clearRect":
     275        case "fill":
     276        case "fillRect":
     277        case "fillText":
     278            return "fill";
     279
     280        case "createImageData":
     281        case "drawFocusIfNeeded":
     282        case "drawImage":
     283        case "drawImageFromRect":
     284        case "filter":
     285        case "getImageData":
     286        case "imageSmoothingEnabled":
     287        case "imageSmoothingQuality":
     288        case "putImageData":
     289        case "transferFromImageBitmap":
     290        case "webkitImageSmoothingEnabled":
     291            return "image";
     292
     293        case "getLineDash":
     294        case "lineCap":
     295        case "lineDashOffset":
     296        case "lineJoin":
     297        case "lineWidth":
     298        case "miterLimit":
     299        case "setLineCap":
     300        case "setLineDash":
     301        case "setLineJoin":
     302        case "setLineWidth":
     303        case "setMiterLimit":
     304        case "webkitLineDash":
     305        case "webkitLineDashOffset":
     306            return "line-style";
     307
     308        case "closePath":
     309        case "lineTo":
     310            return "line-to";
     311
     312        case "beginPath":
     313        case "moveTo":
     314            return "move-to";
     315
     316        case "isPointInPath":
     317            return "point-in-path";
     318
     319        case "isPointInStroke":
     320            return "point-in-stroke";
     321
     322        case "clearShadow":
     323        case "setShadow":
     324        case "shadowBlur":
     325        case "shadowColor":
     326        case "shadowOffsetX":
     327        case "shadowOffsetY":
     328            return "shadow";
     329
     330        case "createLinearGradient":
     331        case "createPattern":
     332        case "createRadialGradient":
     333        case "fillStyle":
     334        case "setFillColor":
     335        case "setStrokeColor":
     336        case "strokeStyle":
     337            return "style";
     338
     339        case "stroke":
     340        case "strokeRect":
     341        case "strokeText":
     342            return "stroke";
     343
     344        case "direction":
     345        case "font":
     346        case "measureText":
     347        case "textAlign":
     348        case "textBaseline":
     349            return "text";
     350
     351        case "getTransform":
     352        case "resetTransform":
     353        case "rotate":
     354        case "scale":
     355        case "setTransform":
     356        case "transform":
     357        case "translate":
     358            return "transform";
     359
     360        case "clip":
     361        case "ellipse":
     362        case "rect":
     363        case "restore":
     364        case "save":
     365            return recordingAction.name;
     366        }
     367
     368        return "name-unknown";
    381369    }
    382370
     
    465453    }
    466454};
    467 
    468 WI.RecordingActionTreeElement._memoizedActionClassNames = new Map;
Note: See TracChangeset for help on using the changeset viewer.