Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 7cd36695ab33c2bc51653d1124f4b0ff2a6130ba
      
https://github.com/WebKit/WebKit/commit/7cd36695ab33c2bc51653d1124f4b0ff2a6130ba
  Author: Devin Rousso <[email protected]>
  Date:   2023-02-09 (Thu, 09 Feb 2023)

  Changed paths:
    M Source/JavaScriptCore/inspector/protocol/DOM.json
    M Source/WebCore/inspector/InspectorOverlay.cpp
    M Source/WebCore/inspector/InspectorOverlay.h
    M Source/WebCore/inspector/agents/InspectorDOMAgent.cpp
    M Source/WebCore/inspector/agents/InspectorDOMAgent.h
    M Source/WebInspectorUI/UserInterface/Controllers/DOMManager.js
    M Source/WebInspectorUI/UserInterface/Models/DOMNode.js

  Log Message:
  -----------
  Web Inspector: Show grid/flex overlays when highlighting elements
https://bugs.webkit.org/show_bug.cgi?id=251937

Reviewed by Patrick Angle.

This makes it so that the experience is the same between element selection and 
highlighting elements in Web Inspector (e.g. via the Elements Tab). Otherwise, 
it could be confusing for a developer to see grid/flex/etc. overlays when in 
element selection but not when highlighting the same element in Web Inspector.

* Source/JavaScriptCore/inspector/protocol/DOM.json:
* Source/WebCore/inspector/agents/InspectorDOMAgent.h:
* Source/WebCore/inspector/agents/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::willDestroyFrontendAndBackend):
(WebCore::InspectorDOMAgent::handleTouchEvent):
(WebCore::InspectorDOMAgent::highlightMousedOverNode):
(WebCore::InspectorDOMAgent::setSearchingForNode):
(WebCore::InspectorDOMAgent::gridOverlayConfigFromInspectorObject):
(WebCore::InspectorDOMAgent::flexOverlayConfigFromInspectorObject):
(WebCore::InspectorDOMAgent::highlightSelector):
(WebCore::InspectorDOMAgent::highlightNode):
(WebCore::InspectorDOMAgent::highlightNodeList):
Add optional parameters for `DOM.GridOverlayConfig` and `DOM.FlexOverlayConfig` 
to `DOM.highlightSelector`, `DOM.highlightNode`, and `DOM.highlightNodeList`.

* Source/WebCore/inspector/InspectorOverlay.h:
* Source/WebCore/inspector/InspectorOverlay.cpp:
(WebCore::isInNodeList): Added.
(WebCore::InspectorOverlay::paint):
(WebCore::InspectorOverlay::getHighlight):
(WebCore::InspectorOverlay::hideHighlight):
(WebCore::InspectorOverlay::highlightNodeList):
(WebCore::InspectorOverlay::highlightNode):
(WebCore::InspectorOverlay::shouldShowOverlay const):
(WebCore::InspectorOverlay::showHighlightGridOverlayForNode): Deleted.
(WebCore::InspectorOverlay::hideHighlightGridOverlay): Deleted.
(WebCore::InspectorOverlay::showHighlightFlexOverlayForNode): Deleted.
(WebCore::InspectorOverlay::hideHighlightFlexOverlay): Deleted.
Move the logic for `*Highlight{Grid,Flex}Overlay` to be part of 
`highlightNodeList` and `highlightNode`, since they all operate on the same 
`m_highlightNode` (and `m_highlightNodeList`) anyways.

* Source/WebInspectorUI/UserInterface/Controllers/DOMManager.js:
(WI.DOMManager.buildHighlightConfigs): Renamed from `buildHighlightConfig`.
(WI.DOMManager.prototype.highlightDOMNodeList):
(WI.DOMManager.prototype.highlightSelector):
(WI.DOMManager.prototype.set inspectModeEnabled):
* Source/WebInspectorUI/UserInterface/Models/DOMNode.js:
(WI.DOMNode.prototype.highlight):
Pass all the grid/flex overlay options to all callers of 
`DOM.highlightSelector`, `DOM.highlightNode`, and `DOM.highlightNodeList`.
Drive-by: Unify all the places where these arguments are generated to avoid 
repeated code.

Canonical link: https://commits.webkit.org/260061@main


_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to