⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 274229 in webkit


Ignore:
Timestamp:
Mar 10, 2021, 12:36:30 PM (6 years ago)
Author:
Razvan Caliman
Message:

Web Inspector: CSS Grid Inspector clean-up
https://bugs.webkit.org/show_bug.cgi?id=222913
<rdar://problem/75171301>

Reviewed by BJ Burg.

Remove obsolete methods to show/hide the grid overlay directly from a DOMNode.
Remove engineering-only context menu helpers used while implementing grid overlays.

  • UserInterface/Models/DOMNode.js:
  • UserInterface/Views/ContextMenuUtilities.js:
Location:
trunk/Source/WebInspectorUI
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r274157 r274229  
     12021-03-10  Razvan Caliman  <rcaliman@apple.com>
     2
     3        Web Inspector: CSS Grid Inspector clean-up
     4        https://bugs.webkit.org/show_bug.cgi?id=222913
     5        <rdar://problem/75171301>
     6
     7        Reviewed by BJ Burg.
     8
     9        Remove obsolete methods to show/hide the grid overlay directly from a DOMNode.
     10        Remove engineering-only context menu helpers used while implementing grid overlays.
     11
     12        * UserInterface/Models/DOMNode.js:
     13        * UserInterface/Views/ContextMenuUtilities.js:
     14
    1152021-03-09  Razvan Caliman  <rcaliman@apple.com>
    216
  • trunk/Source/WebInspectorUI/UserInterface/Models/DOMNode.js

    r272670 r274229  
    573573        let target = WI.assumingMainTarget();
    574574        target.DOMAgent.highlightNode(WI.DOMManager.buildHighlightConfig(mode), this.id);
    575     }
    576 
    577     showGridOverlay(color, {showLineNames, showLineNumbers, showExtendedGridLines, showTrackSizes, showAreaNames} = {})
    578     {
    579         console.assert(color instanceof WI.Color, color);
    580 
    581         if (this._destroyed)
    582             return Promise.reject("Cannot show overlay, node is destroyed");
    583 
    584         let target = WI.assumingMainTarget();
    585         return target.DOMAgent.showGridOverlay.invoke({
    586             nodeId: this.id,
    587             gridColor: color.toProtocol(),
    588             showLineNames: !!showLineNames,
    589             showLineNumbers: !!showLineNumbers,
    590             showExtendedGridLines: !!showExtendedGridLines,
    591             showTrackSizes: !!showTrackSizes,
    592             showAreaNames: !!showAreaNames,
    593         });
    594     }
    595 
    596     hideGridOverlay()
    597     {
    598         if (this._destroyed)
    599             return Promise.reject("Cannot hide overlay, node is destroyed");
    600 
    601         let target = WI.assumingMainTarget();
    602         return target.DOMAgent.hideGridOverlay(this.id);
    603575    }
    604576
  • trunk/Source/WebInspectorUI/UserInterface/Views/ContextMenuUtilities.js

    r272197 r274229  
    387387
    388388        contextMenu.appendSeparator();
    389 
    390         // FIXME: <https://webkit.org/b/221246> remove these engineering-only menu items when removing the feature flag.
    391         if (WI.isEngineeringBuild && WI.settings.experimentalEnableLayoutPanel.value) {
    392             if (InspectorBackend.hasCommand("DOM.showGridOverlay") && attached) {
    393                 contextMenu.appendItem(WI.unlocalizedString("Add Grid Overlay with Random Color"), () => {
    394                     let randomComponent = () => Math.floor(Math.random() * 255);
    395                     let color = new WI.Color(WI.Color.Format.RGB, [randomComponent(), randomComponent(), randomComponent()]);
    396                     domNode.showGridOverlay(color).catch(console.error);
    397                 });
    398 
    399                 contextMenu.appendItem(WI.unlocalizedString("Remove Grid Overlay for this Node"), () => {
    400                     domNode.hideGridOverlay();
    401                 });
    402 
    403                 contextMenu.appendItem(WI.unlocalizedString("Remove All Grid Overlays"), () => {
    404                     let target = WI.assumingMainTarget();
    405                     target.DOMAgent.hideGridOverlay();
    406                 });
    407             }
    408         }
    409 
    410         contextMenu.appendSeparator();
    411389    }
    412390};
Note: See TracChangeset for help on using the changeset viewer.