Changeset 242019 in webkit


Ignore:
Timestamp:
Feb 24, 2019 8:41:53 PM (5 years ago)
Author:
Devin Rousso
Message:

Web Inspector: Change the InspectorOverlay to use native rather than canvas
https://bugs.webkit.org/show_bug.cgi?id=105023
<rdar://problem/13443692>

Reviewed by Brian Burg.

.:

  • ManualTests/inspector/overlay-nodes.html: Added.
  • ManualTests/inspector/overlay-rulers.html: Added.

Source/JavaScriptCore:

  • inspector/protocol/OverlayTypes.json: Removed.

Now that the overlay is entirely generated in C++, we no longer need the special prototol
types for transferring data to a JavaScript context.

  • inspector/protocol/Debugger.json:
  • inspector/agents/InspectorDebuggerAgent.h:
  • inspector/agents/InspectorDebuggerAgent.cpp:

(Inspector::InspectorDebuggerAgent::setOverlayMessage): Deleted.
Remove Debugger.setOverlayMessage command as it hasn't been used and is no longer supported.

  • CMakeLists.txt:
  • DerivedSources-input.xcfilelist:
  • DerivedSources.make:

Source/WebCore:

Should be no change in observed functionality.

  • inspector/InspectorOverlay.h:
  • inspector/InspectorOverlay.cpp:

(WebCore::truncateWithEllipsis): Added.
(WebCore::localPointToRootPoint): Added.
(WebCore::contentsQuadToCoordinateSystem):
(WebCore::effectiveElementForNode): Added.
(WebCore::quadToPath): Added.
(WebCore::drawOutlinedQuadWithClip): Added.
(WebCore::drawOutlinedQuad): Added.
(WebCore::drawFragmentHighlight): Added.
(WebCore::drawShapeHighlight): Added.
(WebCore::InspectorOverlay::paint):
(WebCore::InspectorOverlay::setIndicating):
(WebCore::InspectorOverlay::shouldShowOverlay const):
(WebCore::InspectorOverlay::update):
(WebCore::InspectorOverlay::setShowPaintRects): Added.
(WebCore::InspectorOverlay::showPaintRect):
(WebCore::InspectorOverlay::updatePaintRectsTimerFired):
(WebCore::InspectorOverlay::drawNodeHighlight):
(WebCore::InspectorOverlay::drawQuadHighlight):
(WebCore::InspectorOverlay::drawPaintRects):
(WebCore::InspectorOverlay::drawBounds): Added.
(WebCore::InspectorOverlay::drawRulers):
(WebCore::InspectorOverlay::drawElementTitle): Added.
(WebCore::contentsQuadToPage): Deleted.
(WebCore::InspectorOverlay::setPausedInDebuggerMessage): Deleted.
(WebCore::buildObjectForPoint): Deleted.
(WebCore::buildObjectForRect): Deleted.
(WebCore::buildArrayForQuad): Deleted.
(WebCore::buildObjectForHighlight): Deleted.
(WebCore::buildObjectForSize): Deleted.
(WebCore::InspectorOverlay::setShowingPaintRects): Deleted.
(WebCore::buildArrayForRendererFragments): Deleted.
(WebCore::localPointToRoot): Deleted.
(WebCore::appendPathCommandAndPoints): Deleted.
(WebCore::appendPathSegment): Deleted.
(WebCore::buildObjectForShapeOutside): Deleted.
(WebCore::buildObjectForElementData): Deleted.
(WebCore::InspectorOverlay::buildHighlightObjectForNode const): Deleted.
(WebCore::InspectorOverlay::buildObjectForHighlightedNodes const): Deleted.
(WebCore::InspectorOverlay::drawPausedInDebuggerMessage): Deleted.
(WebCore::InspectorOverlay::overlayPage): Deleted.
(WebCore::InspectorOverlay::forcePaint): Deleted.
(WebCore::InspectorOverlay::reset): Deleted.
(WebCore::evaluateCommandInOverlay): Deleted.
(WebCore::InspectorOverlay::evaluateInOverlay): Deleted.
(WebCore::InspectorOverlay::freePage): Deleted.

  • inspector/agents/InspectorPageAgent.cpp:

(WebCore::InspectorPageAgent::disable):
(WebCore::InspectorPageAgent::setShowPaintRects):
Drive-by: rename setShowingPaintRects to better match the protocol.

  • inspector/agents/page/PageDebuggerAgent.h:
  • inspector/agents/page/PageDebuggerAgent.cpp:

(WebCore::PageDebuggerAgent::PageDebuggerAgent):
(WebCore::PageDebuggerAgent::setOverlayMessage): Deleted.
Remove Debugger.setOverlayMessage command as it hasn't been used and is no longer supported.

  • inspector/InspectorController.h:
  • inspector/InspectorController.cpp:

(WebCore::InspectorController::createLazyAgents):
(WebCore::InspectorController::disconnectFrontend):
(WebCore::InspectorController::disconnectAllFrontends):
(WebCore::InspectorController::buildObjectForHighlightedNodes const): Deleted.

  • testing/Internals.h:
  • testing/Internals.idl:
  • testing/Internals.cpp:

(WebCore::Internals::inspectorHighlightObject): Deleted.

  • inspector/InspectorOverlayPage.css: Removed.
  • inspector/InspectorOverlayPage.html: Removed.
  • inspector/InspectorOverlayPage.js: Removed.
  • CMakeLists.txt:
  • DerivedSources-input.xcfilelist:
  • DerivedSources-output.xcfilelist:
  • DerivedSources.make:
  • WebCore.xcodeproj/project.pbxproj:

Source/WebInspectorUI:

  • UserInterface/Base/Main.js:

(WI.initializeTarget):

  • UserInterface/Protocol/Legacy/10.0/InspectorBackendCommands.js:
  • UserInterface/Protocol/Legacy/10.3/InspectorBackendCommands.js:
  • UserInterface/Protocol/Legacy/11.0/InspectorBackendCommands.js:
  • UserInterface/Protocol/Legacy/11.3/InspectorBackendCommands.js:
  • UserInterface/Protocol/Legacy/12.0/InspectorBackendCommands.js:
  • UserInterface/Protocol/Legacy/12.2/InspectorBackendCommands.js:
  • UserInterface/Protocol/Legacy/8.0/InspectorBackendCommands.js:
  • UserInterface/Protocol/Legacy/9.0/InspectorBackendCommands.js:
  • UserInterface/Protocol/Legacy/9.3/InspectorBackendCommands.js:
  • Versions/Inspector-iOS-10.0.json:
  • Versions/Inspector-iOS-10.3.json:
  • Versions/Inspector-iOS-11.0.json:
  • Versions/Inspector-iOS-11.3.json:
  • Versions/Inspector-iOS-12.0.json:
  • Versions/Inspector-iOS-12.2.json:
  • Versions/Inspector-iOS-8.0.json:
  • Versions/Inspector-iOS-9.0.json:
  • Versions/Inspector-iOS-9.3.json:

Remove Debugger.setOverlayMessage command as it hasn't been used and is no longer supported.

LayoutTests:

  • http/tests/inspector/dom/shapes-test.js: Removed.
  • inspector/dom/hideHighlight.html: Removed.
  • inspector/dom/hideHighlight-expected.txt: Removed.
  • inspector/dom/highlight-shape-outside.html: Removed.
  • inspector/dom/highlight-shape-outside-expected.txt: Removed.
  • inspector/dom/highlight-shape-outside-margin.html: Removed.
  • inspector/dom/highlight-shape-outside-margin-expected.txt: Removed.
  • inspector/dom/highlightFrame.html: Removed.
  • inspector/dom/highlightFrame-expected.txt: Removed.
  • inspector/dom/highlightNode.html: Removed.
  • inspector/dom/highlightNode-expected.txt: Removed.
  • inspector/dom/highlightNodeList.html: Removed.
  • inspector/dom/highlightNodeList-expected.txt: Removed.
  • inspector/dom/highlightSelector.html: Removed.
  • inspector/dom/highlightSelector-expected.txt: Removed.
  • platform/mac/TestExpectations:
Location:
trunk
Files:
2 added
19 deleted
46 edited

Legend:

Unmodified
Added
Removed
  • trunk/ChangeLog

    r241939 r242019  
     12019-02-24  Devin Rousso  <drousso@apple.com>
     2
     3        Web Inspector: Change the InspectorOverlay to use native rather than canvas
     4        https://bugs.webkit.org/show_bug.cgi?id=105023
     5        <rdar://problem/13443692>
     6
     7        Reviewed by Brian Burg.
     8
     9        * ManualTests/inspector/overlay-nodes.html: Added.
     10        * ManualTests/inspector/overlay-rulers.html: Added.
     11
    1122019-02-22  Adrian Perez de Castro  <aperez@igalia.com>
    213
  • trunk/LayoutTests/ChangeLog

    r242018 r242019  
     12019-02-24  Devin Rousso  <drousso@apple.com>
     2
     3        Web Inspector: Change the InspectorOverlay to use native rather than canvas
     4        https://bugs.webkit.org/show_bug.cgi?id=105023
     5        <rdar://problem/13443692>
     6
     7        Reviewed by Brian Burg.
     8
     9        * http/tests/inspector/dom/shapes-test.js: Removed.
     10        * inspector/dom/hideHighlight.html: Removed.
     11        * inspector/dom/hideHighlight-expected.txt: Removed.
     12        * inspector/dom/highlight-shape-outside.html: Removed.
     13        * inspector/dom/highlight-shape-outside-expected.txt: Removed.
     14        * inspector/dom/highlight-shape-outside-margin.html: Removed.
     15        * inspector/dom/highlight-shape-outside-margin-expected.txt: Removed.
     16        * inspector/dom/highlightFrame.html: Removed.
     17        * inspector/dom/highlightFrame-expected.txt: Removed.
     18        * inspector/dom/highlightNode.html: Removed.
     19        * inspector/dom/highlightNode-expected.txt: Removed.
     20        * inspector/dom/highlightNodeList.html: Removed.
     21        * inspector/dom/highlightNodeList-expected.txt: Removed.
     22        * inspector/dom/highlightSelector.html: Removed.
     23        * inspector/dom/highlightSelector-expected.txt: Removed.
     24        * platform/mac/TestExpectations:
     25
    1262019-02-24  Devin Rousso  <drousso@apple.com>
    227
  • trunk/LayoutTests/platform/mac/TestExpectations

    r242017 r242019  
    10631063webkit.org/b/170127 inspector/dom-debugger/dom-breakpoints.html [ Pass Timeout ]
    10641064webkit.org/b/148636 inspector/dom/getAccessibilityPropertiesForNode.html [ Pass Timeout ]
    1065 webkit.org/b/148636 inspector/dom/highlight-shape-outside.html [ Pass Timeout ]
    10661065webkit.org/b/154610 inspector/dom-debugger/node-removed.html [ Pass Timeout ]
    10671066webkit.org/b/153039 [ Debug ] inspector/heap/garbageCollected.html [ Pass Timeout ]
  • trunk/Source/JavaScriptCore/CMakeLists.txt

    r241769 r242019  
    10971097    ${JAVASCRIPTCORE_DIR}/inspector/protocol/LayerTree.json
    10981098    ${JAVASCRIPTCORE_DIR}/inspector/protocol/Network.json
    1099     ${JAVASCRIPTCORE_DIR}/inspector/protocol/OverlayTypes.json
    11001099    ${JAVASCRIPTCORE_DIR}/inspector/protocol/Page.json
    11011100    ${JAVASCRIPTCORE_DIR}/inspector/protocol/Recording.json
  • trunk/Source/JavaScriptCore/ChangeLog

    r242015 r242019  
     12019-02-24  Devin Rousso  <drousso@apple.com>
     2
     3        Web Inspector: Change the InspectorOverlay to use native rather than canvas
     4        https://bugs.webkit.org/show_bug.cgi?id=105023
     5        <rdar://problem/13443692>
     6
     7        Reviewed by Brian Burg.
     8
     9        * inspector/protocol/OverlayTypes.json: Removed.
     10        Now that the overlay is entirely generated in C++, we no longer need the special prototol
     11        types for transferring data to a JavaScript context.
     12
     13        * inspector/protocol/Debugger.json:
     14        * inspector/agents/InspectorDebuggerAgent.h:
     15        * inspector/agents/InspectorDebuggerAgent.cpp:
     16        (Inspector::InspectorDebuggerAgent::setOverlayMessage): Deleted.
     17        Remove `Debugger.setOverlayMessage` command as it hasn't been used and is no longer supported.
     18
     19        * CMakeLists.txt:
     20        * DerivedSources-input.xcfilelist:
     21        * DerivedSources.make:
     22
    1232019-02-24  Yusuke Suzuki  <ysuzuki@apple.com>
    224
  • trunk/Source/JavaScriptCore/DerivedSources-input.xcfilelist

    r240993 r242019  
    9595$(PROJECT_DIR)/inspector/protocol/Memory.json
    9696$(PROJECT_DIR)/inspector/protocol/Network.json
    97 $(PROJECT_DIR)/inspector/protocol/OverlayTypes.json
    9897$(PROJECT_DIR)/inspector/protocol/Page.json
    9998$(PROJECT_DIR)/inspector/protocol/Recording.json
  • trunk/Source/JavaScriptCore/DerivedSources.make

    r241660 r242019  
    244244    $(JavaScriptCore)/inspector/protocol/LayerTree.json \
    245245    $(JavaScriptCore)/inspector/protocol/Network.json \
    246     $(JavaScriptCore)/inspector/protocol/OverlayTypes.json \
    247246    $(JavaScriptCore)/inspector/protocol/Page.json \
    248247    $(JavaScriptCore)/inspector/protocol/Recording.json \
  • trunk/Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.cpp

    r241244 r242019  
    856856        m_scriptDebugServer.setPauseOnExceptionsState(pauseState);
    857857    }
    858 }
    859 
    860 void InspectorDebuggerAgent::setOverlayMessage(ErrorString&, const String*)
    861 {
    862858}
    863859
  • trunk/Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.h

    r239427 r242019  
    8181    void setPauseOnAssertions(ErrorString&, bool enabled) final;
    8282    void evaluateOnCallFrame(ErrorString&, const String& callFrameId, const String& expression, const String* objectGroup, const bool* includeCommandLineAPI, const bool* doNotPauseOnExceptionsAndMuteConsole, const bool* returnByValue, const bool* generatePreview, const bool* saveResult, RefPtr<Protocol::Runtime::RemoteObject>& result, Optional<bool>& wasThrown, Optional<int>& savedResultIndex) final;
    83     void setOverlayMessage(ErrorString&, const String*) override;
    8483
    8584    bool isPaused() const;
  • trunk/Source/JavaScriptCore/inspector/protocol/Debugger.json

    r239703 r242019  
    286286                { "name": "wasThrown", "type": "boolean", "optional": true, "description": "True if the result was thrown during the evaluation." },
    287287                { "name": "savedResultIndex", "type": "integer", "optional": true, "description": "If the result was saved, this is the $n index that can be used to access the value." }
    288             ]
    289         },
    290         {
    291             "name": "setOverlayMessage",
    292             "description": "Sets overlay message.",
    293             "parameters": [
    294                 { "name": "message", "type": "string", "optional": true, "description": "Overlay message to display when paused in debugger." }
    295288            ]
    296289        }
  • trunk/Source/WebCore/CMakeLists.txt

    r241328 r242019  
    17631763WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS()
    17641764
    1765 # Generate InspectorOverlayPage.h
    1766 add_custom_command(
    1767     OUTPUT ${DERIVED_SOURCES_WEBCORE_DIR}/InspectorOverlayPage.h ${DERIVED_SOURCES_WEBCORE_DIR}/InspectorOverlayPage.combined.html
    1768     MAIN_DEPENDENCY inspector/InspectorOverlayPage.html
    1769     DEPENDS ${JavaScriptCore_SCRIPTS_DIR}/xxd.pl ${JavaScriptCore_SCRIPTS_DIR}/inline-and-minify-stylesheets-and-scripts.py
    1770     DEPENDS inspector/InspectorOverlayPage.css inspector/InspectorOverlayPage.js
    1771     COMMAND ${PYTHON_EXECUTABLE} ${JavaScriptCore_SCRIPTS_DIR}/inline-and-minify-stylesheets-and-scripts.py ${WEBCORE_DIR}/inspector/InspectorOverlayPage.html ${DERIVED_SOURCES_WEBCORE_DIR}/InspectorOverlayPage.combined.html
    1772     COMMAND ${PERL_EXECUTABLE} ${JavaScriptCore_SCRIPTS_DIR}/xxd.pl InspectorOverlayPage_html ${DERIVED_SOURCES_WEBCORE_DIR}/InspectorOverlayPage.combined.html ${DERIVED_SOURCES_WEBCORE_DIR}/InspectorOverlayPage.h
    1773     VERBATIM)
    1774 list(APPEND WebCore_SOURCES ${DERIVED_SOURCES_WEBCORE_DIR}/InspectorOverlayPage.h)
    1775 
    17761765
    17771766# Generate CommandLineAPIModuleSource.h
  • trunk/Source/WebCore/ChangeLog

    r242014 r242019  
     12019-02-24  Devin Rousso  <drousso@apple.com>
     2
     3        Web Inspector: Change the InspectorOverlay to use native rather than canvas
     4        https://bugs.webkit.org/show_bug.cgi?id=105023
     5        <rdar://problem/13443692>
     6
     7        Reviewed by Brian Burg.
     8
     9        Should be no change in observed functionality.
     10
     11        * inspector/InspectorOverlay.h:
     12        * inspector/InspectorOverlay.cpp:
     13        (WebCore::truncateWithEllipsis): Added.
     14        (WebCore::localPointToRootPoint): Added.
     15        (WebCore::contentsQuadToCoordinateSystem):
     16        (WebCore::effectiveElementForNode): Added.
     17        (WebCore::quadToPath): Added.
     18        (WebCore::drawOutlinedQuadWithClip): Added.
     19        (WebCore::drawOutlinedQuad): Added.
     20        (WebCore::drawFragmentHighlight): Added.
     21        (WebCore::drawShapeHighlight): Added.
     22        (WebCore::InspectorOverlay::paint):
     23        (WebCore::InspectorOverlay::setIndicating):
     24        (WebCore::InspectorOverlay::shouldShowOverlay const):
     25        (WebCore::InspectorOverlay::update):
     26        (WebCore::InspectorOverlay::setShowPaintRects): Added.
     27        (WebCore::InspectorOverlay::showPaintRect):
     28        (WebCore::InspectorOverlay::updatePaintRectsTimerFired):
     29        (WebCore::InspectorOverlay::drawNodeHighlight):
     30        (WebCore::InspectorOverlay::drawQuadHighlight):
     31        (WebCore::InspectorOverlay::drawPaintRects):
     32        (WebCore::InspectorOverlay::drawBounds): Added.
     33        (WebCore::InspectorOverlay::drawRulers):
     34        (WebCore::InspectorOverlay::drawElementTitle): Added.
     35        (WebCore::contentsQuadToPage): Deleted.
     36        (WebCore::InspectorOverlay::setPausedInDebuggerMessage): Deleted.
     37        (WebCore::buildObjectForPoint): Deleted.
     38        (WebCore::buildObjectForRect): Deleted.
     39        (WebCore::buildArrayForQuad): Deleted.
     40        (WebCore::buildObjectForHighlight): Deleted.
     41        (WebCore::buildObjectForSize): Deleted.
     42        (WebCore::InspectorOverlay::setShowingPaintRects): Deleted.
     43        (WebCore::buildArrayForRendererFragments): Deleted.
     44        (WebCore::localPointToRoot): Deleted.
     45        (WebCore::appendPathCommandAndPoints): Deleted.
     46        (WebCore::appendPathSegment): Deleted.
     47        (WebCore::buildObjectForShapeOutside): Deleted.
     48        (WebCore::buildObjectForElementData): Deleted.
     49        (WebCore::InspectorOverlay::buildHighlightObjectForNode const): Deleted.
     50        (WebCore::InspectorOverlay::buildObjectForHighlightedNodes const): Deleted.
     51        (WebCore::InspectorOverlay::drawPausedInDebuggerMessage): Deleted.
     52        (WebCore::InspectorOverlay::overlayPage): Deleted.
     53        (WebCore::InspectorOverlay::forcePaint): Deleted.
     54        (WebCore::InspectorOverlay::reset): Deleted.
     55        (WebCore::evaluateCommandInOverlay): Deleted.
     56        (WebCore::InspectorOverlay::evaluateInOverlay): Deleted.
     57        (WebCore::InspectorOverlay::freePage): Deleted.
     58
     59        * inspector/agents/InspectorPageAgent.cpp:
     60        (WebCore::InspectorPageAgent::disable):
     61        (WebCore::InspectorPageAgent::setShowPaintRects):
     62        Drive-by: rename `setShowingPaintRects` to better match the protocol.
     63
     64        * inspector/agents/page/PageDebuggerAgent.h:
     65        * inspector/agents/page/PageDebuggerAgent.cpp:
     66        (WebCore::PageDebuggerAgent::PageDebuggerAgent):
     67        (WebCore::PageDebuggerAgent::setOverlayMessage): Deleted.
     68        Remove `Debugger.setOverlayMessage` command as it hasn't been used and is no longer supported.
     69
     70        * inspector/InspectorController.h:
     71        * inspector/InspectorController.cpp:
     72        (WebCore::InspectorController::createLazyAgents):
     73        (WebCore::InspectorController::disconnectFrontend):
     74        (WebCore::InspectorController::disconnectAllFrontends):
     75        (WebCore::InspectorController::buildObjectForHighlightedNodes const): Deleted.
     76
     77        * testing/Internals.h:
     78        * testing/Internals.idl:
     79        * testing/Internals.cpp:
     80        (WebCore::Internals::inspectorHighlightObject): Deleted.
     81
     82        * inspector/InspectorOverlayPage.css: Removed.
     83        * inspector/InspectorOverlayPage.html: Removed.
     84        * inspector/InspectorOverlayPage.js: Removed.
     85
     86        * CMakeLists.txt:
     87        * DerivedSources-input.xcfilelist:
     88        * DerivedSources-output.xcfilelist:
     89        * DerivedSources.make:
     90        * WebCore.xcodeproj/project.pbxproj:
     91
    1922019-02-20  Darin Adler  <darin@apple.com>
    293
  • trunk/Source/WebCore/DerivedSources-input.xcfilelist

    r241328 r242019  
    857857$(PROJECT_DIR)/inspector/InspectorAuditDOMObject.idl
    858858$(PROJECT_DIR)/inspector/InspectorFrontendHost.idl
    859 $(PROJECT_DIR)/inspector/InspectorOverlayPage.css
    860 $(PROJECT_DIR)/inspector/InspectorOverlayPage.html
    861 $(PROJECT_DIR)/inspector/InspectorOverlayPage.js
    862859$(PROJECT_DIR)/loader/appcache/DOMApplicationCache.idl
    863860$(PROJECT_DIR)/make-hash-tools.pl
  • trunk/Source/WebCore/DerivedSources-output.xcfilelist

    r241328 r242019  
    3030$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/HTTPHeaderNames.gperf
    3131$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/HTTPHeaderNames.h
    32 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/InspectorOverlayPage.h
    3332$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/InternalSettingsGenerated.cpp
    3433$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/InternalSettingsGenerated.h
  • trunk/Source/WebCore/DerivedSources.make

    r241328 r242019  
    17261726# Inspector interfaces
    17271727
    1728 all : InspectorOverlayPage.h
    1729 
    1730 InspectorOverlayPage.h : InspectorOverlayPage.html InspectorOverlayPage.css InspectorOverlayPage.js
    1731         $(PYTHON) $(JavaScriptCore_SCRIPTS_DIR)/inline-and-minify-stylesheets-and-scripts.py $(WebCore)/inspector/InspectorOverlayPage.html ./InspectorOverlayPage.combined.html
    1732         $(PERL) $(JavaScriptCore_SCRIPTS_DIR)/xxd.pl InspectorOverlayPage_html ./InspectorOverlayPage.combined.html InspectorOverlayPage.h
    1733         $(DELETE) InspectorOverlayPage.combined.html
    1734 
    17351728all : CommandLineAPIModuleSource.h
    17361729
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r241997 r242019  
    95629562                7A674BD90F9EBF4E006CF099 /* PageGroupLoadDeferrer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PageGroupLoadDeferrer.cpp; sourceTree = "<group>"; };
    95639563                7A674BDA0F9EBF4E006CF099 /* PageGroupLoadDeferrer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PageGroupLoadDeferrer.h; sourceTree = "<group>"; };
    9564                 7A7256B915EB9F5B007323A7 /* InspectorOverlayPage.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = InspectorOverlayPage.html; sourceTree = "<group>"; };
    95659564                7A929CA11C598378004DF226 /* ResourceLoadStatistics.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ResourceLoadStatistics.cpp; sourceTree = "<group>"; };
    95669565                7A929CA21C598378004DF226 /* ResourceLoadStatistics.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ResourceLoadStatistics.h; sourceTree = "<group>"; };
     
    1143511434                A516E8B4136E04DB0076C3C0 /* LocalizedDateCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LocalizedDateCache.h; sourceTree = "<group>"; };
    1143611435                A516E8B5136E04DB0076C3C0 /* LocalizedDateCache.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = LocalizedDateCache.mm; sourceTree = "<group>"; };
    11437                 A518225417E2A0D400A9BA1D /* InspectorOverlayPage.css */ = {isa = PBXFileReference; lastKnownFileType = text.css; path = InspectorOverlayPage.css; sourceTree = "<group>"; };
    11438                 A518225517E2A0D400A9BA1D /* InspectorOverlayPage.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; path = InspectorOverlayPage.js; sourceTree = "<group>"; };
    1143911436                A52B348C1FA3BD79008B6246 /* ServiceWorkerDebuggable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ServiceWorkerDebuggable.h; sourceTree = "<group>"; };
    1144011437                A52B348E1FA3BD79008B6246 /* ServiceWorkerDebuggable.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ServiceWorkerDebuggable.cpp; sourceTree = "<group>"; };
     
    1706317060                                7C522D4915B477E8009B7C95 /* InspectorOverlay.cpp */,
    1706417061                                7C522D4A15B478B2009B7C95 /* InspectorOverlay.h */,
    17065                                 A518225417E2A0D400A9BA1D /* InspectorOverlayPage.css */,
    17066                                 7A7256B915EB9F5B007323A7 /* InspectorOverlayPage.html */,
    17067                                 A518225517E2A0D400A9BA1D /* InspectorOverlayPage.js */,
    1706817062                                6A7279891F16C29B003F39B8 /* InspectorShaderProgram.cpp */,
    1706917063                                6A7279881F16C29B003F39B8 /* InspectorShaderProgram.h */,
  • trunk/Source/WebCore/inspector/InspectorController.cpp

    r240457 r242019  
    193193    auto pageContext = pageAgentContext();
    194194
    195     auto debuggerAgent = std::make_unique<PageDebuggerAgent>(pageContext, m_pageAgent, m_overlay.get());
     195    auto debuggerAgent = std::make_unique<PageDebuggerAgent>(pageContext, m_pageAgent);
    196196    auto debuggerAgentPtr = debuggerAgent.get();
    197197
     
    304304
    305305        // Clean up inspector resources.
    306         m_overlay->freePage();
    307306        m_injectedScriptManager->discardInjectedScripts();
    308307
     
    341340
    342341    // Clean up inspector resources.
    343     m_overlay->freePage();
    344342    m_injectedScriptManager->disconnect();
    345343
     
    393391{
    394392    m_overlay->getHighlight(highlight, coordinateSystem);
    395 }
    396 
    397 Ref<JSON::ArrayOf<Inspector::Protocol::OverlayTypes::NodeHighlightData>> InspectorController::buildObjectForHighlightedNodes() const
    398 {
    399     return m_overlay->buildObjectForHighlightedNodes();
    400393}
    401394
  • trunk/Source/WebCore/inspector/InspectorController.h

    r238206 r242019  
    4545class FrontendRouter;
    4646class InspectorAgent;
    47 
    48 namespace Protocol {
    49 namespace OverlayTypes {
    50 class NodeHighlightData;
    51 }
    52 }
    5347}
    5448
     
    10498    WEBCORE_EXPORT void setIndicating(bool);
    10599
    106     WEBCORE_EXPORT Ref<JSON::ArrayOf<Inspector::Protocol::OverlayTypes::NodeHighlightData>> buildObjectForHighlightedNodes() const;
    107 
    108100    WEBCORE_EXPORT void didComposite(Frame&);
    109101
  • trunk/Source/WebCore/inspector/InspectorOverlay.cpp

    r239247 r242019  
    11/*
    22 * Copyright (C) 2011 Google Inc. All rights reserved.
     3 * Copyright (C) 2019 Apple Inc. All rights reserved.
    34 *
    45 * Redistribution and use in source and binary forms, with or without
     
    3031#include "InspectorOverlay.h"
    3132
    32 #include "CacheStorageProvider.h"
    33 #include "DocumentLoader.h"
    34 #include "EditorClient.h"
     33#include "AXObjectCache.h"
     34#include "AccessibilityObject.h"
     35#include "DOMCSSNamespace.h"
     36#include "DOMTokenList.h"
    3537#include "Element.h"
    36 #include "EmptyClients.h"
     38#include "FloatPoint.h"
     39#include "FloatSize.h"
     40#include "FontCascade.h"
     41#include "FontCascadeDescription.h"
    3742#include "Frame.h"
    3843#include "FrameView.h"
    3944#include "GraphicsContext.h"
    4045#include "InspectorClient.h"
    41 #include "InspectorOverlayPage.h"
    42 #include "LibWebRTCProvider.h"
     46#include "IntPoint.h"
     47#include "IntRect.h"
     48#include "IntSize.h"
    4349#include "Node.h"
     50#include "NodeList.h"
    4451#include "Page.h"
    45 #include "PageConfiguration.h"
    46 #include "PolygonShape.h"
     52#include "Path.h"
    4753#include "PseudoElement.h"
    48 #include "RTCController.h"
    49 #include "RectangleShape.h"
     54#include "RenderBox.h"
    5055#include "RenderBoxModelObject.h"
    51 #include "RenderElement.h"
    5256#include "RenderInline.h"
    53 #include "RenderView.h"
    54 #include "ScriptController.h"
    55 #include "ScriptSourceCode.h"
     57#include "RenderObject.h"
    5658#include "Settings.h"
    57 #include "SocketProvider.h"
    58 #include "StyledElement.h"
    59 #include <JavaScriptCore/InspectorProtocolObjects.h>
    60 #include <wtf/JSONValues.h>
    61 
    62 #if PLATFORM(MAC)
    63 #include "LocalDefaultSystemAppearance.h"
    64 #endif
     59#include <wtf/MathExtras.h>
     60#include <wtf/text/StringBuilder.h>
    6561
    6662namespace WebCore {
     
    6864using namespace Inspector;
    6965
     66static constexpr float elementDataSpacing = 2;
     67static constexpr float elementDataArrowSize = 7;
     68static constexpr float elementDataBorderSize = 1;
     69
     70static constexpr float rulerSize = 15;
     71static constexpr float rulerLabelSize = 13;
     72static constexpr float rulerStepIncrement = 50;
     73static constexpr float rulerStepLength = 8;
     74static constexpr float rulerSubStepIncrement = 5;
     75static constexpr float rulerSubStepLength = 5;
     76
     77static void truncateWithEllipsis(String& string, size_t length)
     78{
     79    const UChar ellipsisUChar[] = { 0x2026, 0 };
     80
     81    if (string.length() > length) {
     82        string.truncate(length);
     83        string.append(ellipsisUChar);
     84    }
     85}
     86
     87static FloatPoint localPointToRootPoint(const FrameView* view, const FloatPoint& point)
     88{
     89    return view->contentsToRootView(roundedIntPoint(point));
     90}
     91
    7092static void contentsQuadToCoordinateSystem(const FrameView* mainView, const FrameView* view, FloatQuad& quad, InspectorOverlay::CoordinateSystem coordinateSystem)
    7193{
    72     quad.setP1(view->contentsToRootView(roundedIntPoint(quad.p1())));
    73     quad.setP2(view->contentsToRootView(roundedIntPoint(quad.p2())));
    74     quad.setP3(view->contentsToRootView(roundedIntPoint(quad.p3())));
    75     quad.setP4(view->contentsToRootView(roundedIntPoint(quad.p4())));
     94    quad.setP1(localPointToRootPoint(view, quad.p1()));
     95    quad.setP2(localPointToRootPoint(view, quad.p2()));
     96    quad.setP3(localPointToRootPoint(view, quad.p3()));
     97    quad.setP4(localPointToRootPoint(view, quad.p4()));
    7698
    7799    if (coordinateSystem == InspectorOverlay::CoordinateSystem::View)
     
    79101}
    80102
    81 static void contentsQuadToPage(const FrameView* mainView, const FrameView* view, FloatQuad& quad)
    82 {
    83     contentsQuadToCoordinateSystem(mainView, view, quad, InspectorOverlay::CoordinateSystem::View);
     103static Element* effectiveElementForNode(Node& node)
     104{
     105    if (!is<Element>(node) || !node.document().frame())
     106        return nullptr;
     107
     108    Element* element = nullptr;
     109    if (is<PseudoElement>(node)) {
     110        if (Element* hostElement = downcast<PseudoElement>(node).hostElement())
     111            element = hostElement;
     112    } else
     113        element = &downcast<Element>(node);
     114
     115    return element;
    84116}
    85117
     
    167199}
    168200
     201static Path quadToPath(const FloatQuad& quad, FloatRect& bounds)
     202{
     203    Path path;
     204    path.moveTo(quad.p1());
     205    path.addLineTo(quad.p2());
     206    path.addLineTo(quad.p3());
     207    path.addLineTo(quad.p4());
     208    path.closeSubpath();
     209
     210    bounds.unite(path.boundingRect());
     211
     212    return path;
     213}
     214
     215static void drawOutlinedQuadWithClip(GraphicsContext& context, const FloatQuad& quad, const FloatQuad& clipQuad, const Color& fillColor, FloatRect& bounds)
     216{
     217    GraphicsContextStateSaver stateSaver(context);
     218
     219    context.setFillColor(fillColor);
     220    context.setStrokeThickness(0);
     221    context.fillPath(quadToPath(quad, bounds));
     222
     223    context.setCompositeOperation(CompositeDestinationOut);
     224    context.setFillColor(Color::createUnchecked(255, 0, 0));
     225    context.fillPath(quadToPath(clipQuad, bounds));
     226}
     227
     228static void drawOutlinedQuad(GraphicsContext& context, const FloatQuad& quad, const Color& fillColor, const Color& outlineColor, FloatRect& bounds)
     229{
     230    Path path = quadToPath(quad, bounds);
     231
     232    GraphicsContextStateSaver stateSaver(context);
     233
     234    context.setStrokeThickness(2);
     235
     236    context.clipPath(path);
     237
     238    context.setFillColor(fillColor);
     239    context.fillPath(path);
     240
     241    context.setStrokeColor(outlineColor);
     242    context.strokePath(path);
     243}
     244
     245static void drawFragmentHighlight(GraphicsContext& context, Node& node, const HighlightConfig& highlightConfig, FloatRect& bounds)
     246{
     247    Highlight highlight;
     248    buildNodeHighlight(node, highlightConfig, highlight, InspectorOverlay::CoordinateSystem::Document);
     249
     250    FloatQuad marginQuad;
     251    FloatQuad borderQuad;
     252    FloatQuad paddingQuad;
     253    FloatQuad contentQuad;
     254
     255    size_t size = highlight.quads.size();
     256    if (size >= 1)
     257        marginQuad = highlight.quads[0];
     258    if (size >= 2)
     259        borderQuad = highlight.quads[1];
     260    if (size >= 3)
     261        paddingQuad = highlight.quads[2];
     262    if (size >= 4)
     263        contentQuad = highlight.quads[3];
     264
     265    if (!marginQuad.isEmpty() && marginQuad != borderQuad && highlight.marginColor.isVisible())
     266        drawOutlinedQuadWithClip(context, marginQuad, borderQuad, highlight.marginColor, bounds);
     267
     268    if (!borderQuad.isEmpty() && borderQuad != paddingQuad && highlight.borderColor.isVisible())
     269        drawOutlinedQuadWithClip(context, borderQuad, paddingQuad, highlight.borderColor, bounds);
     270
     271    if (!paddingQuad.isEmpty() && paddingQuad != contentQuad && highlight.paddingColor.isVisible())
     272        drawOutlinedQuadWithClip(context, paddingQuad, contentQuad, highlight.paddingColor, bounds);
     273
     274    if (!contentQuad.isEmpty() && (highlight.contentColor.isVisible() || highlight.contentOutlineColor.isVisible()))
     275        drawOutlinedQuad(context, contentQuad, highlight.contentColor, highlight.contentOutlineColor, bounds);
     276}
     277
     278static void drawShapeHighlight(GraphicsContext& context, Node& node, FloatRect& bounds)
     279{
     280    Element* element = effectiveElementForNode(node);
     281    if (!element)
     282        return;
     283
     284    RenderObject* renderer = element->renderer();
     285    if (!renderer || !is<RenderBox>(renderer))
     286        return;
     287
     288    const ShapeOutsideInfo* shapeOutsideInfo = downcast<RenderBox>(renderer)->shapeOutsideInfo();
     289    if (!shapeOutsideInfo)
     290        return;
     291
     292    const Color shapeHighlightColor(96, 82, 127, 204);
     293
     294    Frame* containingFrame = element->document().frame();
     295    FrameView* containingView = containingFrame->view();
     296    FrameView* mainView = containingFrame->page()->mainFrame().view();
     297
     298    Shape::DisplayPaths paths;
     299    shapeOutsideInfo->computedShape().buildDisplayPaths(paths);
     300
     301    if (paths.shape.isEmpty()) {
     302        LayoutRect shapeBounds = shapeOutsideInfo->computedShapePhysicalBoundingBox();
     303        FloatQuad shapeQuad = renderer->localToAbsoluteQuad(FloatRect(shapeBounds));
     304        contentsQuadToCoordinateSystem(mainView, containingView, shapeQuad, InspectorOverlay::CoordinateSystem::Document);
     305        drawOutlinedQuad(context, shapeQuad, shapeHighlightColor, Color::transparent, bounds);
     306        return;
     307    }
     308
     309    const auto mapPoints = [&] (const Path& path) {
     310        Path newPath;
     311        path.apply([&] (const PathElement& pathElement) {
     312            const auto localToRoot = [&] (size_t index) {
     313                const FloatPoint& point = pathElement.points[index];
     314                return localPointToRootPoint(containingView, renderer->localToAbsolute(shapeOutsideInfo->shapeToRendererPoint(point)));
     315            };
     316
     317            switch (pathElement.type) {
     318            case PathElementMoveToPoint:
     319                newPath.moveTo(localToRoot(0));
     320                break;
     321
     322            case PathElementAddLineToPoint:
     323                newPath.addLineTo(localToRoot(0));
     324                break;
     325
     326            case PathElementAddCurveToPoint:
     327                newPath.addBezierCurveTo(localToRoot(0), localToRoot(1), localToRoot(2));
     328                break;
     329
     330            case PathElementAddQuadCurveToPoint:
     331                newPath.addQuadCurveTo(localToRoot(0), localToRoot(1));
     332                break;
     333
     334            case PathElementCloseSubpath:
     335                newPath.closeSubpath();
     336                break;
     337            }
     338        });
     339        return newPath;
     340    };
     341
     342    if (paths.marginShape.length()) {
     343        Path marginPath = mapPoints(paths.marginShape);
     344        bounds.unite(marginPath.boundingRect());
     345
     346        GraphicsContextStateSaver stateSaver(context);
     347
     348        const Color shapeMarginHighlightColor(96, 82, 127, 153);
     349        context.setFillColor(shapeMarginHighlightColor);
     350        context.fillPath(marginPath);
     351    }
     352
     353    Path shapePath = mapPoints(paths.shape);
     354    bounds.unite(shapePath.boundingRect());
     355
     356    GraphicsContextStateSaver stateSaver(context);
     357
     358    context.setFillColor(shapeHighlightColor);
     359    context.fillPath(shapePath);
     360}
     361
    169362InspectorOverlay::InspectorOverlay(Page& page, InspectorClient* client)
    170363    : m_page(page)
     
    181374        return;
    182375
    183     Page* overlayPage = this->overlayPage();
    184     if (!overlayPage)
    185         return;
     376    FloatSize viewportSize = m_page.mainFrame().view()->sizeForVisibleContent();
     377
     378    context.clearRect({ FloatPoint::zero(), viewportSize });
    186379
    187380    GraphicsContextStateSaver stateSaver(context);
    188     FrameView* view = overlayPage->mainFrame().view();
    189 
    190 #if PLATFORM(MAC)
    191     LocalDefaultSystemAppearance localAppearance(view->useDarkAppearance());
    192 #endif
    193 
    194     view->updateLayoutAndStyleIfNeededRecursive();
    195     view->paint(context, IntRect(0, 0, view->width(), view->height()));
     381
     382    if (m_indicating) {
     383        GraphicsContextStateSaver stateSaver(context);
     384
     385        const Color indicatingColor(111, 168, 220, 168);
     386        context.setFillColor(indicatingColor);
     387        context.fillRect({ FloatPoint::zero(), viewportSize });
     388    }
     389
     390    if (m_highlightQuad)
     391        drawQuadHighlight(context, *m_highlightQuad);
     392
     393    if (m_highlightNodeList) {
     394        for (unsigned i = 0; i < m_highlightNodeList->length(); ++i) {
     395            if (Node* node = m_highlightNodeList->item(i))
     396                drawNodeHighlight(context, *node);
     397        }
     398    }
     399
     400    if (m_highlightNode)
     401        drawNodeHighlight(context, *m_highlightNode);
     402
     403    if (!m_paintRects.isEmpty())
     404        drawPaintRects(context, m_paintRects);
     405
     406    if (m_showRulers)
     407        drawRulers(context);
    196408}
    197409
     
    217429}
    218430
    219 void InspectorOverlay::setPausedInDebuggerMessage(const String* message)
    220 {
    221     m_pausedInDebuggerMessage = message ? *message : String();
    222     update();
    223 }
    224 
    225431void InspectorOverlay::hideHighlight()
    226432{
     
    269475void InspectorOverlay::setIndicating(bool indicating)
    270476{
     477    if (m_indicating == indicating)
     478        return;
     479
    271480    m_indicating = indicating;
    272481
    273     if (m_indicating)
    274         evaluateInOverlay("showPageIndication"_s);
    275     else
    276         evaluateInOverlay("hidePageIndication"_s);
    277 
    278482    update();
    279483}
     
    281485bool InspectorOverlay::shouldShowOverlay() const
    282486{
    283     return m_highlightNode || m_highlightNodeList || m_highlightQuad || m_indicating || m_showingPaintRects || m_showRulers || !m_pausedInDebuggerMessage.isNull();
     487    return m_highlightNode || m_highlightNodeList || m_highlightQuad || m_indicating || m_showPaintRects || m_showRulers;
    284488}
    285489
     
    295499        return;
    296500
    297     Page* overlayPage = this->overlayPage();
    298     if (overlayPage) {
    299         FrameView* overlayView = overlayPage->mainFrame().view();
    300         IntSize frameViewFullSize = view->sizeForVisibleContent(ScrollableArea::IncludeScrollbars);
    301         overlayView->resize(frameViewFullSize);
    302     }
    303 
    304     // Clear canvas and paint things.
    305     IntSize viewportSize = view->sizeForVisibleContent();
    306     IntPoint scrollOffset = view->scrollPosition();
    307     reset(viewportSize, scrollOffset);
    308 
    309     // Include scrollbars to avoid masking them by the gutter.
    310     drawNodeHighlight();
    311     drawQuadHighlight();
    312     drawPausedInDebuggerMessage();
    313     drawPaintRects();
    314 
    315     if (m_showRulers)
    316         drawRulers();
    317 
    318     // Position DOM elements.
    319     if (overlayPage) {
    320         overlayPage->mainFrame().document()->resolveStyle(Document::ResolveStyleType::Rebuild);
    321         FrameView* overlayView = overlayPage->mainFrame().view();
    322         if (overlayView->needsLayout())
    323             overlayView->layoutContext().layout();
    324     }
    325 
    326     forcePaint();
    327 }
    328 
    329 static Ref<Inspector::Protocol::OverlayTypes::Point> buildObjectForPoint(const FloatPoint& point)
    330 {
    331     return Inspector::Protocol::OverlayTypes::Point::create()
    332         .setX(point.x())
    333         .setY(point.y())
    334         .release();
    335 }
    336 
    337 static Ref<Inspector::Protocol::OverlayTypes::Rect> buildObjectForRect(const FloatRect& rect)
    338 {
    339     return Inspector::Protocol::OverlayTypes::Rect::create()
    340         .setX(rect.x())
    341         .setY(rect.y())
    342         .setWidth(rect.width())
    343         .setHeight(rect.height())
    344         .release();
    345 }
    346 
    347 static Ref<Inspector::Protocol::OverlayTypes::Quad> buildArrayForQuad(const FloatQuad& quad)
    348 {
    349     auto array = Inspector::Protocol::OverlayTypes::Quad::create();
    350     array->addItem(buildObjectForPoint(quad.p1()));
    351     array->addItem(buildObjectForPoint(quad.p2()));
    352     array->addItem(buildObjectForPoint(quad.p3()));
    353     array->addItem(buildObjectForPoint(quad.p4()));
    354     return array;
    355 }
    356 
    357 static Ref<Inspector::Protocol::OverlayTypes::FragmentHighlightData> buildObjectForHighlight(const Highlight& highlight)
    358 {
    359     auto arrayOfQuads = JSON::ArrayOf<Inspector::Protocol::OverlayTypes::Quad>::create();
    360     for (auto& quad : highlight.quads)
    361         arrayOfQuads->addItem(buildArrayForQuad(quad));
    362 
    363     return Inspector::Protocol::OverlayTypes::FragmentHighlightData::create()
    364         .setQuads(WTFMove(arrayOfQuads))
    365         .setContentColor(highlight.contentColor.serialized())
    366         .setContentOutlineColor(highlight.contentOutlineColor.serialized())
    367         .setPaddingColor(highlight.paddingColor.serialized())
    368         .setBorderColor(highlight.borderColor.serialized())
    369         .setMarginColor(highlight.marginColor.serialized())
    370         .release();
    371 }
    372 
    373 static Ref<Inspector::Protocol::OverlayTypes::Size> buildObjectForSize(const IntSize& size)
    374 {
    375     return Inspector::Protocol::OverlayTypes::Size::create()
    376         .setWidth(size.width())
    377         .setHeight(size.height())
    378         .release();
    379 }
    380 
    381 void InspectorOverlay::setShowingPaintRects(bool showingPaintRects)
    382 {
    383     if (m_showingPaintRects == showingPaintRects)
    384         return;
    385 
    386     m_showingPaintRects = showingPaintRects;
    387     if (!m_showingPaintRects) {
     501    m_client->highlight();
     502}
     503
     504void InspectorOverlay::setShowPaintRects(bool showPaintRects)
     505{
     506    if (m_showPaintRects == showPaintRects)
     507        return;
     508
     509    m_showPaintRects = showPaintRects;
     510    if (!m_showPaintRects) {
    388511        m_paintRects.clear();
    389512        m_paintRectUpdateTimer.stop();
    390         drawPaintRects();
    391         forcePaint();
     513        update();
    392514    }
    393515}
     
    395517void InspectorOverlay::showPaintRect(const FloatRect& rect)
    396518{
    397     if (!m_showingPaintRects)
     519    if (!m_showPaintRects)
    398520        return;
    399521
     
    410532    }
    411533
    412     drawPaintRects();
    413     forcePaint();
     534    update();
    414535}
    415536
     
    436557        m_paintRectUpdateTimer.stop();
    437558
    438     if (rectsChanged) {
    439         drawPaintRects();
    440         forcePaint();
    441     }
    442 }
    443 
    444 void InspectorOverlay::drawPaintRects()
    445 {
    446     auto arrayOfRects = JSON::ArrayOf<Inspector::Protocol::OverlayTypes::Rect>::create();
    447     for (const auto& pair : m_paintRects)
    448         arrayOfRects->addItem(buildObjectForRect(pair.second));
    449 
    450     evaluateInOverlay("updatePaintRects"_s, WTFMove(arrayOfRects));
    451 }
    452 
    453 void InspectorOverlay::drawRulers()
    454 {
    455     evaluateInOverlay("drawRulers"_s);
    456 }
    457 
    458 static RefPtr<JSON::ArrayOf<Inspector::Protocol::OverlayTypes::FragmentHighlightData>> buildArrayForRendererFragments(RenderObject* renderer, const HighlightConfig& config)
    459 {
    460     auto arrayOfFragments = JSON::ArrayOf<Inspector::Protocol::OverlayTypes::FragmentHighlightData>::create();
    461 
     559    if (rectsChanged)
     560        update();
     561}
     562
     563void InspectorOverlay::drawNodeHighlight(GraphicsContext& context, Node& node)
     564{
     565    FloatRect bounds;
     566
     567    drawFragmentHighlight(context, node, m_nodeHighlightConfig, bounds);
     568
     569    if (m_nodeHighlightConfig.showInfo)
     570        drawShapeHighlight(context, node, bounds);
     571
     572    if (m_showRulers)
     573        drawBounds(context, bounds);
     574
     575    // Ensure that the title information is drawn after the bounds.
     576    if (m_nodeHighlightConfig.showInfo)
     577        drawElementTitle(context, node, bounds);
     578}
     579
     580void InspectorOverlay::drawQuadHighlight(GraphicsContext& context, const FloatQuad& quad)
     581{
    462582    Highlight highlight;
    463     buildRendererHighlight(renderer, config, highlight, InspectorOverlay::CoordinateSystem::View);
    464     arrayOfFragments->addItem(buildObjectForHighlight(highlight));
    465 
    466     return WTFMove(arrayOfFragments);
    467 }
    468 
    469 static FloatPoint localPointToRoot(RenderObject* renderer, const FrameView* mainView, const FrameView* view, const FloatPoint& point)
    470 {
    471     FloatPoint result = renderer->localToAbsolute(point);
    472     result = view->contentsToRootView(roundedIntPoint(result));
    473     result += toIntSize(mainView->scrollPosition());
    474     return result;
    475 }
    476 
    477 struct PathApplyInfo {
    478     FrameView* rootView;
    479     FrameView* view;
    480     Inspector::Protocol::OverlayTypes::DisplayPath* pathArray;
    481     RenderObject* renderer;
    482     const ShapeOutsideInfo* shapeOutsideInfo;
    483 };
    484 
    485 static void appendPathCommandAndPoints(PathApplyInfo& info, const String& command, const FloatPoint points[], unsigned length)
    486 {
    487     FloatPoint point;
    488     info.pathArray->addItem(command);
    489     for (unsigned i = 0; i < length; i++) {
    490         point = info.shapeOutsideInfo->shapeToRendererPoint(points[i]);
    491         point = localPointToRoot(info.renderer, info.rootView, info.view, point);
    492         info.pathArray->addItem(point.x());
    493         info.pathArray->addItem(point.y());
    494     }
    495 }
    496 
    497 static void appendPathSegment(PathApplyInfo& pathApplyInfo, const PathElement& pathElement)
    498 {
    499     FloatPoint point;
    500     switch (pathElement.type) {
    501     // The points member will contain 1 value.
    502     case PathElementMoveToPoint:
    503         appendPathCommandAndPoints(pathApplyInfo, "M"_s, pathElement.points, 1);
    504         break;
    505     // The points member will contain 1 value.
    506     case PathElementAddLineToPoint:
    507         appendPathCommandAndPoints(pathApplyInfo, "L"_s, pathElement.points, 1);
    508         break;
    509     // The points member will contain 3 values.
    510     case PathElementAddCurveToPoint:
    511         appendPathCommandAndPoints(pathApplyInfo, "C"_s, pathElement.points, 3);
    512         break;
    513     // The points member will contain 2 values.
    514     case PathElementAddQuadCurveToPoint:
    515         appendPathCommandAndPoints(pathApplyInfo, "Q"_s, pathElement.points, 2);
    516         break;
    517     // The points member will contain no values.
    518     case PathElementCloseSubpath:
    519         appendPathCommandAndPoints(pathApplyInfo, "Z"_s, nullptr, 0);
    520         break;
    521     }
    522 }
    523 
    524 static RefPtr<Inspector::Protocol::OverlayTypes::ShapeOutsideData> buildObjectForShapeOutside(Frame* containingFrame, RenderBox* renderer)
    525 {
    526     const ShapeOutsideInfo* shapeOutsideInfo = renderer->shapeOutsideInfo();
    527     if (!shapeOutsideInfo)
    528         return nullptr;
    529 
    530     LayoutRect shapeBounds = shapeOutsideInfo->computedShapePhysicalBoundingBox();
    531     FloatQuad shapeQuad = renderer->localToAbsoluteQuad(FloatRect(shapeBounds));
    532     contentsQuadToPage(containingFrame->page()->mainFrame().view(), containingFrame->view(), shapeQuad);
    533 
    534     auto shapeObject = Inspector::Protocol::OverlayTypes::ShapeOutsideData::create()
    535         .setBounds(buildArrayForQuad(shapeQuad))
    536         .release();
    537 
    538     Shape::DisplayPaths paths;
    539     shapeOutsideInfo->computedShape().buildDisplayPaths(paths);
    540 
    541     if (paths.shape.length()) {
    542         auto shapePath = Inspector::Protocol::OverlayTypes::DisplayPath::create();
    543         PathApplyInfo info;
    544         info.rootView = containingFrame->page()->mainFrame().view();
    545         info.view = containingFrame->view();
    546         info.pathArray = &shapePath.get();
    547         info.renderer = renderer;
    548         info.shapeOutsideInfo = shapeOutsideInfo;
    549 
    550         paths.shape.apply([&info](const PathElement& pathElement) {
    551             appendPathSegment(info, pathElement);
    552         });
    553 
    554         shapeObject->setShape(shapePath.copyRef());
    555 
    556         if (paths.marginShape.length()) {
    557             auto marginShapePath = Inspector::Protocol::OverlayTypes::DisplayPath::create();
    558             info.pathArray = &marginShapePath.get();
    559 
    560             paths.marginShape.apply([&info](const PathElement& pathElement) {
    561                 appendPathSegment(info, pathElement);
    562             });
    563 
    564             shapeObject->setMarginShape(marginShapePath.copyRef());
     583    buildQuadHighlight(quad, m_quadHighlightConfig, highlight);
     584
     585    if (highlight.quads.size() >= 1) {
     586        FloatRect bounds;
     587
     588        drawOutlinedQuad(context, highlight.quads[0], highlight.contentColor, highlight.contentOutlineColor, bounds);
     589
     590        if (m_showRulers)
     591            drawBounds(context, bounds);
     592    }
     593}
     594
     595void InspectorOverlay::drawPaintRects(GraphicsContext& context, const Deque<TimeRectPair>& paintRects)
     596{
     597    GraphicsContextStateSaver stateSaver(context);
     598
     599    const Color paintRectsColor(1.0f, 0.0f, 0.0f, 0.5f);
     600    context.setFillColor(paintRectsColor);
     601
     602    for (const TimeRectPair& pair : paintRects)
     603        context.fillRect(pair.second);
     604}
     605
     606void InspectorOverlay::drawBounds(GraphicsContext& context, const FloatRect& bounds)
     607{
     608    FrameView* pageView = m_page.mainFrame().view();
     609    FloatSize viewportSize = pageView->sizeForVisibleContent();
     610    FloatSize contentInset(0, pageView->topContentInset(ScrollView::TopContentInsetType::WebCoreOrPlatformContentInset));
     611
     612    Path path;
     613
     614    if (bounds.y() > contentInset.height()) {
     615        path.moveTo({ bounds.x(), bounds.y() });
     616        path.addLineTo({ bounds.x(), contentInset.height() });
     617
     618        path.moveTo({ bounds.maxX(), bounds.y() });
     619        path.addLineTo({ bounds.maxX(), contentInset.height() });
     620    }
     621
     622    if (bounds.maxY() < viewportSize.height()) {
     623        path.moveTo({ bounds.x(), viewportSize.height() });
     624        path.addLineTo({ bounds.x(), bounds.maxY() });
     625
     626        path.moveTo({ bounds.maxX(), viewportSize.height() });
     627        path.addLineTo({ bounds.maxX(), bounds.maxY() });
     628    }
     629
     630    if (bounds.x() > contentInset.width()) {
     631        path.moveTo({ bounds.x(), bounds.y() });
     632        path.addLineTo({ contentInset.width(), bounds.y() });
     633
     634        path.moveTo({ bounds.x(), bounds.maxY() });
     635        path.addLineTo({ contentInset.width(), bounds.maxY() });
     636    }
     637
     638    if (bounds.maxX() < viewportSize.width()) {
     639        path.moveTo({ bounds.maxX(), bounds.y() });
     640        path.addLineTo({ viewportSize.width(), bounds.y() });
     641
     642        path.moveTo({ bounds.maxX(), bounds.maxY() });
     643        path.addLineTo({ viewportSize.width(), bounds.maxY() });
     644    }
     645
     646    GraphicsContextStateSaver stateSaver(context);
     647
     648    context.setStrokeThickness(1);
     649
     650    const Color boundsColor(1.0f, 0.0f, 0.0f, 0.6f);
     651    context.setStrokeColor(boundsColor);
     652
     653    context.strokePath(path);
     654}
     655
     656void InspectorOverlay::drawRulers(GraphicsContext& context)
     657{
     658    const Color rulerBackgroundColor(1.0f, 1.0f, 1.0f, 0.6f);
     659    const Color lightRulerColor(0.0f, 0.0f, 0.0f, 0.2f);
     660    const Color darkRulerColor(0.0f, 0.0f, 0.0f, 0.5f);
     661
     662    IntPoint scrollOffset;
     663
     664    FrameView* pageView = m_page.mainFrame().view();
     665    if (!pageView->delegatesScrolling())
     666        scrollOffset = pageView->visibleContentRect().location();
     667
     668    FloatSize viewportSize = pageView->sizeForVisibleContent();
     669    FloatSize contentInset(0, pageView->topContentInset(ScrollView::TopContentInsetType::WebCoreOrPlatformContentInset));
     670    float pageScaleFactor = m_page.pageScaleFactor();
     671    float pageZoomFactor = m_page.mainFrame().pageZoomFactor();
     672
     673    float pageFactor = pageZoomFactor * pageScaleFactor;
     674    float scrollX = scrollOffset.x() * pageScaleFactor;
     675    float scrollY = scrollOffset.y() * pageScaleFactor;
     676
     677    const auto zoom = [&] (float value) -> float {
     678        return value * pageFactor;
     679    };
     680
     681    const auto unzoom = [&] (float value) -> float {
     682        return value / pageFactor;
     683    };
     684
     685    const auto multipleBelow = [&] (float value, float step) -> float {
     686        return value - std::fmod(value, step);
     687    };
     688
     689    float width = viewportSize.width() / pageFactor;
     690    float height = viewportSize.height() / pageFactor;
     691    float minX = unzoom(scrollX);
     692    float minY = unzoom(scrollY);
     693    float maxX = minX + width;
     694    float maxY = minY + height;
     695
     696    // Draw backgrounds.
     697    {
     698        GraphicsContextStateSaver backgroundStateSaver(context);
     699
     700        float offsetX = contentInset.width() + rulerSize;
     701        float offsetY = contentInset.height() + rulerSize;
     702
     703        context.setFillColor(rulerBackgroundColor);
     704        context.fillRect({ contentInset.width(), contentInset.height(), rulerSize, rulerSize });
     705        context.fillRect({ offsetX, contentInset.height(), zoom(width) - offsetX, rulerSize });
     706        context.fillRect({ contentInset.width(), offsetY, rulerSize, zoom(height) - offsetY });
     707    }
     708
     709    // Draw lines.
     710    {
     711        GraphicsContextStateSaver lineStateSaver(context);
     712
     713        context.setFillColor(darkRulerColor);
     714        context.setStrokeThickness(1);
     715
     716        // Draw horizontal ruler.
     717        {
     718            GraphicsContextStateSaver horizontalRulerStateSaver(context);
     719
     720            context.translate(contentInset.width() - scrollX + 0.5f, contentInset.height() - scrollY);
     721
     722            for (float x = multipleBelow(minX, rulerSubStepIncrement); x < maxX; x += rulerSubStepIncrement) {
     723                if (!x && !scrollX)
     724                    continue;
     725
     726                Path path;
     727                path.moveTo({ zoom(x), scrollY });
     728
     729                if (std::fmod(x, rulerStepIncrement)) {
     730                    context.setStrokeColor(lightRulerColor);
     731                    path.addLineTo({ zoom(x), scrollY + rulerSubStepLength });
     732                } else {
     733                    context.setStrokeColor(darkRulerColor);
     734                    path.addLineTo({ zoom(x), scrollY + (std::fmod(x, rulerStepIncrement * 2) ? rulerSubStepLength : rulerStepLength) });
     735                }
     736
     737                context.strokePath(path);
     738            }
    565739        }
    566     }
    567 
    568     return WTFMove(shapeObject);
    569 }
    570 
    571 static RefPtr<Inspector::Protocol::OverlayTypes::ElementData> buildObjectForElementData(Node* node, HighlightType)
    572 {
    573     if (!is<Element>(node) || !node->document().frame())
    574         return nullptr;
    575 
    576     Element* effectiveElement = downcast<Element>(node);
    577     if (node->isPseudoElement()) {
    578         Element* hostElement = downcast<PseudoElement>(*node).hostElement();
    579         if (!hostElement)
    580             return nullptr;
    581         effectiveElement = hostElement;
    582     }
    583 
    584     Element& element = *effectiveElement;
    585     bool isXHTML = element.document().isXHTMLDocument();
    586     auto elementData = Inspector::Protocol::OverlayTypes::ElementData::create()
    587         .setTagName(isXHTML ? element.nodeName() : element.nodeName().convertToASCIILowercase())
    588         .setIdValue(element.getIdAttribute())
    589         .release();
    590 
    591     if (element.hasClass() && is<StyledElement>(element)) {
    592         auto classes = JSON::ArrayOf<String>::create();
    593         HashSet<AtomicString> usedClassNames;
    594         const SpaceSplitString& classNamesString = downcast<StyledElement>(element).classNames();
    595         for (size_t i = 0; i < classNamesString.size(); ++i) {
    596             const AtomicString& className = classNamesString[i];
    597             if (usedClassNames.contains(className))
    598                 continue;
    599 
    600             usedClassNames.add(className);
    601             classes->addItem(className);
     740
     741        // Draw vertical ruler.
     742        {
     743            GraphicsContextStateSaver veritcalRulerStateSaver(context);
     744
     745            context.translate(contentInset.width() - scrollX, contentInset.height() - scrollY + 0.5f);
     746
     747            for (float y = multipleBelow(minY, rulerSubStepIncrement); y < maxY; y += rulerSubStepIncrement) {
     748                if (!y && !scrollY)
     749                    continue;
     750
     751                Path path;
     752                path.moveTo({ scrollX, zoom(y) });
     753
     754                if (std::fmod(y, rulerStepIncrement)) {
     755                    context.setStrokeColor(lightRulerColor);
     756                    path.addLineTo({ scrollX + rulerSubStepLength, zoom(y) });
     757                } else {
     758                    context.setStrokeColor(darkRulerColor);
     759                    path.addLineTo({ scrollX + (std::fmod(y, rulerStepIncrement * 2) ? rulerSubStepLength : rulerStepLength), zoom(y) });
     760                }
     761
     762                context.strokePath(path);
     763            }
    602764        }
    603         elementData->setClasses(WTFMove(classes));
    604     }
    605 
    606     if (node->isPseudoElement()) {
    607         if (node->pseudoId() == PseudoId::Before)
    608             elementData->setPseudoElement("before");
    609         else if (node->pseudoId() == PseudoId::After)
    610             elementData->setPseudoElement("after");
    611     }
    612 
    613     RenderElement* renderer = element.renderer();
     765
     766        // Draw labels.
     767        {
     768            GraphicsContextStateSaver labelStateSaver(context);
     769
     770            FontCascadeDescription fontDescription;
     771            fontDescription.setOneFamily(m_page.settings().sansSerifFontFamily());
     772            fontDescription.setComputedSize(10);
     773
     774            FontCascade font(WTFMove(fontDescription), 0, 0);
     775            font.update(nullptr);
     776
     777            context.translate(contentInset.width() - scrollX, contentInset.height() - scrollY);
     778
     779            for (float x = multipleBelow(minX, rulerStepIncrement * 2); x < maxX; x += rulerStepIncrement * 2) {
     780                if (!x && !scrollX)
     781                    continue;
     782
     783                GraphicsContextStateSaver verticalLabelStateSaver(context);
     784                context.translate(zoom(x) + 0.5f, scrollY);
     785                context.drawText(font, TextRun(String::number(x)), { 2, rulerLabelSize });
     786            }
     787
     788            for (float y = multipleBelow(minY, rulerStepIncrement * 2); y < maxY; y += rulerStepIncrement * 2) {
     789                if (!y && !scrollY)
     790                    continue;
     791
     792                GraphicsContextStateSaver horizontalLabelStateSaver(context);
     793                context.translate(scrollX, zoom(y) + 0.5f);
     794                context.rotate(-piOverTwoFloat);
     795                context.drawText(font, TextRun(String::number(y)), { 2, rulerLabelSize });
     796            }
     797        }
     798    }
     799}
     800
     801void InspectorOverlay::drawElementTitle(GraphicsContext& context, Node& node, const FloatRect& bounds)
     802{
     803    if (bounds.isEmpty())
     804        return;
     805
     806    Element* element = effectiveElementForNode(node);
     807    if (!element)
     808        return;
     809
     810    RenderObject* renderer = element->renderer();
    614811    if (!renderer)
    615         return nullptr;
    616 
    617     Frame* containingFrame = node->document().frame();
    618     FrameView* containingView = containingFrame->view();
    619     IntRect boundingBox = snappedIntRect(containingView->contentsToRootView(renderer->absoluteBoundingBoxRect()));
    620     RenderBoxModelObject* modelObject = is<RenderBoxModelObject>(*renderer) ? downcast<RenderBoxModelObject>(renderer) : nullptr;
    621     auto sizeObject = Inspector::Protocol::OverlayTypes::Size::create()
    622         .setWidth(modelObject ? adjustForAbsoluteZoom(roundToInt(modelObject->offsetWidth()), *modelObject) : boundingBox.width())
    623         .setHeight(modelObject ? adjustForAbsoluteZoom(roundToInt(modelObject->offsetHeight()), *modelObject) : boundingBox.height())
    624         .release();
    625     elementData->setSize(WTFMove(sizeObject));
    626 
    627     if (is<RenderBox>(*renderer)) {
    628         auto& renderBox = downcast<RenderBox>(*renderer);
    629         if (RefPtr<Inspector::Protocol::OverlayTypes::ShapeOutsideData> shapeObject = buildObjectForShapeOutside(containingFrame, &renderBox))
    630             elementData->setShapeOutsideData(WTFMove(shapeObject));
     812        return;
     813
     814    const UChar multiplicationSignUChar[] = { 0x00D7, 0 };
     815
     816    String elementTagName = element->nodeName();
     817    if (!element->document().isXHTMLDocument())
     818        elementTagName = elementTagName.convertToASCIILowercase();
     819
     820    String elementIDValue;
     821    if (element->hasID())
     822        elementIDValue = makeString('#', DOMCSSNamespace::escape(element->getIdAttribute()));
     823
     824    String elementClassValue;
     825    if (element->hasClass()) {
     826        StringBuilder builder;
     827        DOMTokenList& classList = element->classList();
     828        for (size_t i = 0; i < classList.length(); ++i) {
     829            builder.append('.');
     830            builder.append(DOMCSSNamespace::escape(classList.item(i)));
     831        }
     832
     833        elementClassValue = builder.toString();
     834        truncateWithEllipsis(elementClassValue, 50);
     835    }
     836
     837    String elementPseudoType;
     838    if (element->isBeforePseudoElement())
     839        elementPseudoType = "::before"_s;
     840    else if (element->isAfterPseudoElement())
     841        elementPseudoType = "::after"_s;
     842
     843    String elementWidth;
     844    String elementHeight;
     845    if (is<RenderBoxModelObject>(renderer)) {
     846        RenderBoxModelObject* modelObject = downcast<RenderBoxModelObject>(renderer);
     847        elementWidth = String::number(adjustForAbsoluteZoom(roundToInt(modelObject->offsetWidth()), *modelObject));
     848        elementHeight = String::number(adjustForAbsoluteZoom(roundToInt(modelObject->offsetHeight()), *modelObject));
     849    } else {
     850        FrameView* containingView = element->document().frame()->view();
     851        IntRect boundingBox = snappedIntRect(containingView->contentsToRootView(renderer->absoluteBoundingBoxRect()));
     852        elementWidth = String::number(boundingBox.width());
     853        elementHeight = String::number(boundingBox.height());
    631854    }
    632855
     
    635858        WebCore::AXObjectCache::enableAccessibility();
    636859
    637     if (AXObjectCache* axObjectCache = node->document().axObjectCache()) {
    638         if (AccessibilityObject* axObject = axObjectCache->getOrCreate(node))
    639             elementData->setRole(axObject->computedRoleString());
    640     }
    641 
    642     return WTFMove(elementData);
    643 }
    644 
    645 RefPtr<Inspector::Protocol::OverlayTypes::NodeHighlightData> InspectorOverlay::buildHighlightObjectForNode(Node* node, HighlightType type) const
    646 {
    647     if (!node)
    648         return nullptr;
    649 
    650     RenderObject* renderer = node->renderer();
    651     if (!renderer)
    652         return nullptr;
    653 
    654     RefPtr<JSON::ArrayOf<Inspector::Protocol::OverlayTypes::FragmentHighlightData>> arrayOfFragmentHighlights = buildArrayForRendererFragments(renderer, m_nodeHighlightConfig);
    655     if (!arrayOfFragmentHighlights)
    656         return nullptr;
    657 
    658     // The main view's scroll offset is shared across all quads.
    659     FrameView* mainView = m_page.mainFrame().view();
    660 
    661     auto nodeHighlightObject = Inspector::Protocol::OverlayTypes::NodeHighlightData::create()
    662         .setScrollOffset(buildObjectForPoint(!mainView->delegatesScrolling() ? mainView->visibleContentRect().location() : FloatPoint()))
    663         .setFragments(WTFMove(arrayOfFragmentHighlights))
    664         .release();
    665 
    666     if (m_nodeHighlightConfig.showInfo) {
    667         if (RefPtr<Inspector::Protocol::OverlayTypes::ElementData> elementData = buildObjectForElementData(node, type))
    668             nodeHighlightObject->setElementData(WTFMove(elementData));
    669     }
    670 
    671     return WTFMove(nodeHighlightObject);
    672 }
    673 
    674 Ref<JSON::ArrayOf<Inspector::Protocol::OverlayTypes::NodeHighlightData>> InspectorOverlay::buildObjectForHighlightedNodes() const
    675 {
    676     auto highlights = JSON::ArrayOf<Inspector::Protocol::OverlayTypes::NodeHighlightData>::create();
    677 
    678     if (m_highlightNode) {
    679         if (RefPtr<Inspector::Protocol::OverlayTypes::NodeHighlightData> nodeHighlightData = buildHighlightObjectForNode(m_highlightNode.get(), HighlightType::Node))
    680             highlights->addItem(WTFMove(nodeHighlightData));
    681     } else if (m_highlightNodeList) {
    682         for (unsigned i = 0; i < m_highlightNodeList->length(); ++i) {
    683             if (RefPtr<Inspector::Protocol::OverlayTypes::NodeHighlightData> nodeHighlightData = buildHighlightObjectForNode(m_highlightNodeList->item(i), HighlightType::NodeList))
    684                 highlights->addItem(WTFMove(nodeHighlightData));
    685         }
    686     }
    687 
    688     return highlights;
    689 }
    690 
    691 void InspectorOverlay::drawNodeHighlight()
    692 {
    693     if (m_highlightNode || m_highlightNodeList)
    694         evaluateInOverlay("drawNodeHighlight", buildObjectForHighlightedNodes());
    695 }
    696 
    697 void InspectorOverlay::drawQuadHighlight()
    698 {
    699     if (!m_highlightQuad)
    700         return;
    701 
    702     Highlight highlight;
    703     buildQuadHighlight(*m_highlightQuad, m_quadHighlightConfig, highlight);
    704     evaluateInOverlay("drawQuadHighlight", buildObjectForHighlight(highlight));
    705 }
    706 
    707 void InspectorOverlay::drawPausedInDebuggerMessage()
    708 {
    709     if (!m_pausedInDebuggerMessage.isNull())
    710         evaluateInOverlay("drawPausedInDebuggerMessage", m_pausedInDebuggerMessage);
    711 }
    712 
    713 Page* InspectorOverlay::overlayPage()
    714 {
    715 #if PLATFORM(IOS_FAMILY)
    716     return nullptr;
    717 #else
    718     if (m_overlayPage)
    719         return m_overlayPage.get();
    720 
    721     auto pageConfiguration = pageConfigurationWithEmptyClients();
    722     m_overlayPage = std::make_unique<Page>(WTFMove(pageConfiguration));
    723     m_overlayPage->setDeviceScaleFactor(m_page.deviceScaleFactor());
    724 
    725     Settings& settings = m_page.settings();
    726     Settings& overlaySettings = m_overlayPage->settings();
    727 
    728     overlaySettings.setStandardFontFamily(settings.standardFontFamily());
    729     overlaySettings.setSerifFontFamily(settings.serifFontFamily());
    730     overlaySettings.setSansSerifFontFamily(settings.sansSerifFontFamily());
    731     overlaySettings.setCursiveFontFamily(settings.cursiveFontFamily());
    732     overlaySettings.setFantasyFontFamily(settings.fantasyFontFamily());
    733     overlaySettings.setPictographFontFamily(settings.pictographFontFamily());
    734     overlaySettings.setMinimumFontSize(settings.minimumFontSize());
    735     overlaySettings.setMinimumLogicalFontSize(settings.minimumLogicalFontSize());
    736     overlaySettings.setMediaEnabled(false);
    737     overlaySettings.setScriptEnabled(true);
    738     overlaySettings.setPluginsEnabled(false);
    739 
    740     Frame& frame = m_overlayPage->mainFrame();
    741     frame.setView(FrameView::create(frame));
    742     frame.init();
    743     FrameLoader& loader = frame.loader();
    744     frame.view()->setCanHaveScrollbars(false);
    745     frame.view()->setTransparent(true);
    746     ASSERT(loader.activeDocumentLoader());
    747     auto& writer = loader.activeDocumentLoader()->writer();
    748     writer.setMIMEType("text/html");
    749     writer.begin();
    750     writer.insertDataSynchronously(String(reinterpret_cast<const char*>(InspectorOverlayPage_html), sizeof(InspectorOverlayPage_html)));
    751     writer.end();
    752 
    753 #if OS(WINDOWS)
    754     evaluateInOverlay("setPlatform", "windows");
    755 #elif OS(MAC_OS_X)
    756     evaluateInOverlay("setPlatform", "mac");
    757 #elif OS(UNIX)
    758     evaluateInOverlay("setPlatform", "linux");
    759 #endif
    760 
    761     return m_overlayPage.get();
    762 #endif
    763 }
    764 
    765 void InspectorOverlay::forcePaint()
    766 {
    767     // This overlay page is very weird and doesn't automatically paint. We have to force paints manually.
    768     m_client->highlight();
    769 }
    770 
    771 void InspectorOverlay::reset(const IntSize& viewportSize, const IntPoint& scrollOffset)
    772 {
    773     auto configObject = Inspector::Protocol::OverlayTypes::OverlayConfiguration::create()
    774         .setDeviceScaleFactor(m_page.deviceScaleFactor())
    775         .setViewportSize(buildObjectForSize(viewportSize))
    776         .setPageScaleFactor(m_page.pageScaleFactor())
    777         .setPageZoomFactor(m_page.mainFrame().pageZoomFactor())
    778         .setScrollOffset(buildObjectForPoint(scrollOffset))
    779         .setContentInset(buildObjectForSize(IntSize(0, m_page.mainFrame().view()->topContentInset(ScrollView::TopContentInsetType::WebCoreOrPlatformContentInset))))
    780         .setShowRulers(m_showRulers)
    781         .release();
    782     evaluateInOverlay("reset", WTFMove(configObject));
    783 }
    784 
    785 static void evaluateCommandInOverlay(Page* page, Ref<JSON::Array>&& command)
    786 {
    787     if (!page)
    788         return;
    789 
    790     page->mainFrame().script().evaluate(ScriptSourceCode(makeString("dispatch(", command->toJSONString(), ')')));
    791 }
    792 
    793 void InspectorOverlay::evaluateInOverlay(const String& method)
    794 {
    795     Ref<JSON::Array> command = JSON::Array::create();
    796     command->pushString(method);
    797 
    798     evaluateCommandInOverlay(overlayPage(), WTFMove(command));
    799 }
    800 
    801 void InspectorOverlay::evaluateInOverlay(const String& method, const String& argument)
    802 {
    803     Ref<JSON::Array> command = JSON::Array::create();
    804     command->pushString(method);
    805     command->pushString(argument);
    806 
    807     evaluateCommandInOverlay(overlayPage(), WTFMove(command));
    808 }
    809 
    810 void InspectorOverlay::evaluateInOverlay(const String& method, RefPtr<JSON::Value>&& argument)
    811 {
    812     Ref<JSON::Array> command = JSON::Array::create();
    813     command->pushString(method);
    814     command->pushValue(WTFMove(argument));
    815 
    816     evaluateCommandInOverlay(overlayPage(), WTFMove(command));
    817 }
    818 
    819 void InspectorOverlay::freePage()
    820 {
    821     m_overlayPage = nullptr;
     860    String elementRole;
     861    if (AXObjectCache* axObjectCache = element->document().axObjectCache()) {
     862        if (AccessibilityObject* axObject = axObjectCache->getOrCreate(element))
     863            elementRole = axObject->computedRoleString();
     864    }
     865
     866    FontCascadeDescription fontDescription;
     867    fontDescription.setFamilies({ "Menlo", m_page.settings().fixedFontFamily() });
     868    fontDescription.setComputedSize(11);
     869
     870    FontCascade font(WTFMove(fontDescription), 0, 0);
     871    font.update(nullptr);
     872
     873    int fontHeight = font.fontMetrics().height();
     874
     875    float elementDataWidth;
     876    float elementDataHeight = fontHeight;
     877    bool hasSecondLine = !elementRole.isEmpty();
     878
     879    {
     880        String firstLine = makeString(elementTagName, elementIDValue, elementClassValue, elementPseudoType, ' ', elementWidth, "px", ' ', multiplicationSignUChar, ' ', elementHeight, "px");
     881        String secondLine = makeString("Role ", elementRole);
     882
     883        float firstLineWidth = font.width(TextRun(firstLine));
     884        float secondLineWidth = font.width(TextRun(secondLine));
     885
     886        elementDataWidth = std::fmax(firstLineWidth, secondLineWidth);
     887        if (hasSecondLine)
     888            elementDataHeight += fontHeight;
     889    }
     890
     891    FrameView* pageView = m_page.mainFrame().view();
     892
     893    FloatSize viewportSize = pageView->sizeForVisibleContent();
     894    viewportSize.expand(-elementDataSpacing, -elementDataSpacing);
     895
     896    FloatSize contentInset(0, pageView->topContentInset(ScrollView::TopContentInsetType::WebCoreOrPlatformContentInset));
     897    contentInset.expand(elementDataSpacing, elementDataSpacing);
     898    if (m_showRulers)
     899        contentInset.expand(rulerSize, rulerSize);
     900
     901    float anchorTop = bounds.y();
     902    float anchorBottom = bounds.maxY();
     903
     904    bool renderArrowUp = false;
     905    bool renderArrowDown = false;
     906
     907    float boxWidth = elementDataWidth + (elementDataSpacing * 2);
     908    float boxHeight = elementDataArrowSize + elementDataHeight + (elementDataSpacing * 2);
     909
     910    float boxX = bounds.x();
     911    if (boxX < contentInset.width()) {
     912        boxX = contentInset.width();
     913    } else if (boxX > viewportSize.width() - boxWidth)
     914        boxX = viewportSize.width() - boxWidth;
     915    else
     916        boxX += elementDataSpacing;
     917
     918    float boxY;
     919    if (anchorTop > viewportSize.height()) {
     920        boxY = viewportSize.height() - boxHeight;
     921        renderArrowDown = true;
     922    } else if (anchorBottom < contentInset.height()) {
     923        boxY = contentInset.height() + elementDataArrowSize;
     924        renderArrowUp = true;
     925    } else if (anchorTop - boxHeight - elementDataSpacing > contentInset.height()) {
     926        boxY = anchorTop - boxHeight - elementDataSpacing;
     927        renderArrowDown = true;
     928    } else if (anchorBottom + boxHeight + elementDataSpacing < viewportSize.height()) {
     929        boxY = anchorBottom + elementDataArrowSize + elementDataSpacing;
     930        renderArrowUp = true;
     931    } else {
     932        boxY = contentInset.height();
     933        renderArrowDown = true;
     934    }
     935
     936    Path path;
     937    path.moveTo({ boxX, boxY });
     938    if (renderArrowUp) {
     939        path.addLineTo({ boxX + (elementDataArrowSize * 2), boxY });
     940        path.addLineTo({ boxX + (elementDataArrowSize * 3), boxY - elementDataArrowSize });
     941        path.addLineTo({ boxX + (elementDataArrowSize * 4), boxY });
     942    }
     943    path.addLineTo({ boxX + elementDataWidth + (elementDataSpacing * 2), boxY });
     944    path.addLineTo({ boxX + elementDataWidth + (elementDataSpacing * 2), boxY + elementDataHeight + (elementDataSpacing * 2) });
     945    if (renderArrowDown) {
     946        path.addLineTo({ boxX + (elementDataArrowSize * 4), boxY + elementDataHeight + (elementDataSpacing * 2) });
     947        path.addLineTo({ boxX + (elementDataArrowSize * 3), boxY + elementDataHeight + (elementDataSpacing * 2) + elementDataArrowSize });
     948        path.addLineTo({ boxX + (elementDataArrowSize * 2), boxY + elementDataHeight + (elementDataSpacing * 2) });
     949    }
     950    path.addLineTo({ boxX, boxY + elementDataHeight + (elementDataSpacing * 2) });
     951    path.closeSubpath();
     952
     953    GraphicsContextStateSaver stateSaver(context);
     954
     955    context.translate(elementDataBorderSize / 2.0f, elementDataBorderSize / 2.0f);
     956
     957    const Color elementTitleBackgroundColor(255, 255, 194);
     958    context.setFillColor(elementTitleBackgroundColor);
     959
     960    context.fillPath(path);
     961
     962    context.setStrokeThickness(elementDataBorderSize);
     963
     964    const Color elementTitleBorderColor(128, 128, 128);
     965    context.setStrokeColor(elementTitleBorderColor);
     966
     967    context.strokePath(path);
     968
     969    float textPositionX = boxX + elementDataSpacing;
     970    float textPositionY = boxY - (elementDataSpacing / 2.0f) + fontHeight;
     971    const auto drawText = [&] (const String& text, const Color& color) {
     972        if (text.isEmpty())
     973            return;
     974
     975        context.setFillColor(color);
     976        textPositionX += context.drawText(font, TextRun(text), { textPositionX, textPositionY });
     977    };
     978
     979    drawText(elementTagName, Color(136, 18, 128)); // Keep this in sync with XMLViewer.css (.tag)
     980    drawText(elementIDValue, Color(26, 26, 166)); // Keep this in sync with XMLViewer.css (.attribute-value)
     981    drawText(elementClassValue, Color(153, 69, 0)); // Keep this in sync with XMLViewer.css (.attribute-name)
     982    drawText(elementPseudoType, Color(136, 18, 128)); // Keep this in sync with XMLViewer.css (.tag)
     983    drawText(" "_s, Color::black);
     984    drawText(elementWidth, Color::black);
     985    drawText("px"_s, Color::darkGray);
     986    drawText(" "_s, Color::darkGray);
     987    drawText(multiplicationSignUChar, Color::darkGray);
     988    drawText(" "_s, Color::darkGray);
     989    drawText(elementHeight, Color::black);
     990    drawText("px"_s, Color::darkGray);
     991
     992    if (hasSecondLine) {
     993        textPositionX = boxX + elementDataSpacing;
     994        textPositionY += fontHeight;
     995
     996        drawText("Role"_s, Color(170, 13, 145));
     997        drawText(" "_s, Color::black);
     998        drawText(elementRole, Color::black);
     999    }
    8221000}
    8231001
  • trunk/Source/WebCore/inspector/InspectorOverlay.h

    r231881 r242019  
    11/*
    22 * Copyright (C) 2011 Google Inc. All rights reserved.
     3 * Copyright (C) 2019 Apple Inc. All rights reserved.
    34 *
    45 * Redistribution and use in source and binary forms, with or without
     
    3132#include "Color.h"
    3233#include "FloatQuad.h"
    33 #include "LayoutRect.h"
    34 #include "NodeList.h"
     34#include "FloatRect.h"
    3535#include "Timer.h"
    36 #include <JavaScriptCore/InspectorProtocolObjects.h>
    3736#include <wtf/Deque.h>
    38 #include <wtf/JSONValues.h>
     37#include <wtf/MonotonicTime.h>
    3938#include <wtf/RefPtr.h>
    4039#include <wtf/Vector.h>
     
    4342namespace WebCore {
    4443
    45 class Color;
    4644class GraphicsContext;
    4745class InspectorClient;
    48 class IntRect;
    4946class Node;
     47class NodeList;
    5048class Page;
    5149
     
    107105    void getHighlight(Highlight&, CoordinateSystem) const;
    108106
    109     void setPausedInDebuggerMessage(const String*);
    110 
    111107    void hideHighlight();
    112108    void highlightNodeList(RefPtr<NodeList>&&, const HighlightConfig&);
    113109    void highlightNode(Node*, const HighlightConfig&);
    114110    void highlightQuad(std::unique_ptr<FloatQuad>, const HighlightConfig&);
    115    
    116     void setShowingPaintRects(bool);
     111
     112    void setShowPaintRects(bool);
    117113    void showPaintRect(const FloatRect&);
    118114
    119115    void setShowRulers(bool);
    120    
     116
    121117    Node* highlightedNode() const;
    122118
     
    125121    void setIndicating(bool indicating);
    126122
    127     RefPtr<Inspector::Protocol::OverlayTypes::NodeHighlightData> buildHighlightObjectForNode(Node*, HighlightType) const;
    128     Ref<JSON::ArrayOf<Inspector::Protocol::OverlayTypes::NodeHighlightData>> buildObjectForHighlightedNodes() const;
     123private:
     124    using TimeRectPair = std::pair<MonotonicTime, FloatRect>;
    129125
    130     void freePage();
    131 private:
    132126    bool shouldShowOverlay() const;
    133     void drawNodeHighlight();
    134     void drawQuadHighlight();
    135     void drawPausedInDebuggerMessage();
    136     void drawPaintRects();
    137     void drawRulers();
     127
     128    void drawNodeHighlight(GraphicsContext&, Node&);
     129    void drawQuadHighlight(GraphicsContext&, const FloatQuad&);
     130    void drawPaintRects(GraphicsContext&, const Deque<TimeRectPair>&);
     131    void drawBounds(GraphicsContext&, const FloatRect&);
     132    void drawRulers(GraphicsContext&);
     133
     134    void drawElementTitle(GraphicsContext&, Node&, const FloatRect& bounds);
     135
    138136    void updatePaintRectsTimerFired();
    139 
    140     Page* overlayPage();
    141 
    142     void forcePaint();
    143     void reset(const IntSize& viewportSize, const IntPoint& scrollOffset);
    144     void evaluateInOverlay(const String& method);
    145     void evaluateInOverlay(const String& method, const String& argument);
    146     void evaluateInOverlay(const String& method, RefPtr<JSON::Value>&& argument);
    147137
    148138    Page& m_page;
    149139    InspectorClient* m_client;
    150     String m_pausedInDebuggerMessage;
     140
    151141    RefPtr<Node> m_highlightNode;
    152142    RefPtr<NodeList> m_highlightNodeList;
    153143    HighlightConfig m_nodeHighlightConfig;
     144
    154145    std::unique_ptr<FloatQuad> m_highlightQuad;
    155     std::unique_ptr<Page> m_overlayPage;
    156146    HighlightConfig m_quadHighlightConfig;
    157    
    158     using TimeRectPair = std::pair<MonotonicTime, FloatRect>;
     147
    159148    Deque<TimeRectPair> m_paintRects;
    160149    Timer m_paintRectUpdateTimer;
     150
    161151    bool m_indicating {false};
    162     bool m_showingPaintRects {false};
     152    bool m_showPaintRects {false};
    163153    bool m_showRulers {false};
    164154};
  • trunk/Source/WebCore/inspector/agents/InspectorPageAgent.cpp

    r240644 r242019  
    325325    ErrorString unused;
    326326    setShowPaintRects(unused, false);
     327    setShowRulers(unused, false);
    327328    overrideUserAgent(unused, nullptr);
    328329    setEmulatedMedia(unused, emptyString());
     
    634635        return;
    635636
    636     m_overlay->setShowingPaintRects(show);
     637    m_overlay->setShowPaintRects(show);
    637638}
    638639
  • trunk/Source/WebCore/inspector/agents/page/PageDebuggerAgent.cpp

    r236762 r242019  
    3838#include "EventTarget.h"
    3939#include "Frame.h"
    40 #include "InspectorOverlay.h"
    4140#include "InspectorPageAgent.h"
    4241#include "InstrumentingAgents.h"
     
    5857using namespace Inspector;
    5958
    60 PageDebuggerAgent::PageDebuggerAgent(PageAgentContext& context, InspectorPageAgent* pageAgent, InspectorOverlay* overlay)
     59PageDebuggerAgent::PageDebuggerAgent(PageAgentContext& context, InspectorPageAgent* pageAgent)
    6160    : WebDebuggerAgent(context)
    6261    , m_page(context.inspectedPage)
    6362    , m_pageAgent(pageAgent)
    64     , m_overlay(overlay)
    6563{
    6664}
     
    136134}
    137135
    138 void PageDebuggerAgent::setOverlayMessage(ErrorString&, const String* message)
    139 {
    140     m_overlay->setPausedInDebuggerMessage(message);
    141 }
    142 
    143136void PageDebuggerAgent::didClearMainFrameWindowObject()
    144137{
  • trunk/Source/WebCore/inspector/agents/page/PageDebuggerAgent.h

    r231659 r242019  
    3939class EventListener;
    4040class EventTarget;
    41 class InspectorOverlay;
    4241class InspectorPageAgent;
    4342class Page;
     
    4948    WTF_MAKE_FAST_ALLOCATED;
    5049public:
    51     PageDebuggerAgent(PageAgentContext&, InspectorPageAgent*, InspectorOverlay*);
     50    PageDebuggerAgent(PageAgentContext&, InspectorPageAgent*);
    5251    virtual ~PageDebuggerAgent() = default;
    5352
     
    8685
    8786    Inspector::InjectedScript injectedScriptForEval(ErrorString&, const int* executionContextId) override;
    88     void setOverlayMessage(ErrorString&, const String*) final;
    8987
    9088    Page& m_page;
    9189
    9290    InspectorPageAgent* m_pageAgent;
    93     InspectorOverlay* m_overlay { nullptr };
    9491
    9592    HashMap<const RegisteredEventListener*, int> m_registeredEventListeners;
  • trunk/Source/WebCore/testing/Internals.cpp

    r241788 r242019  
    15441544}
    15451545
    1546 ExceptionOr<String> Internals::inspectorHighlightObject()
    1547 {
    1548     Document* document = contextDocument();
    1549     if (!document || !document->page())
    1550         return Exception { InvalidAccessError };
    1551 
    1552     return document->page()->inspectorController().buildObjectForHighlightedNodes()->toJSONString();
    1553 }
    1554 
    15551546ExceptionOr<unsigned> Internals::markerCountForNode(Node& node, const String& markerType)
    15561547{
  • trunk/Source/WebCore/testing/Internals.h

    r241788 r242019  
    226226
    227227    ExceptionOr<Ref<DOMRectList>> inspectorHighlightRects();
    228     ExceptionOr<String> inspectorHighlightObject();
    229228
    230229    ExceptionOr<unsigned> markerCountForNode(Node&, const String&);
  • trunk/Source/WebCore/testing/Internals.idl

    r241788 r242019  
    244244
    245245    [MayThrowException] DOMRectList inspectorHighlightRects();
    246     [MayThrowException] DOMString inspectorHighlightObject();
    247246
    248247    [MayThrowException] unsigned long markerCountForNode(Node node, DOMString markerType);
  • trunk/Source/WebInspectorUI/ChangeLog

    r242018 r242019  
     12019-02-24  Devin Rousso  <drousso@apple.com>
     2
     3        Web Inspector: Change the InspectorOverlay to use native rather than canvas
     4        https://bugs.webkit.org/show_bug.cgi?id=105023
     5        <rdar://problem/13443692>
     6
     7        Reviewed by Brian Burg.
     8
     9        * UserInterface/Base/Main.js:
     10        (WI.initializeTarget):
     11
     12        * UserInterface/Protocol/Legacy/10.0/InspectorBackendCommands.js:
     13        * UserInterface/Protocol/Legacy/10.3/InspectorBackendCommands.js:
     14        * UserInterface/Protocol/Legacy/11.0/InspectorBackendCommands.js:
     15        * UserInterface/Protocol/Legacy/11.3/InspectorBackendCommands.js:
     16        * UserInterface/Protocol/Legacy/12.0/InspectorBackendCommands.js:
     17        * UserInterface/Protocol/Legacy/12.2/InspectorBackendCommands.js:
     18        * UserInterface/Protocol/Legacy/8.0/InspectorBackendCommands.js:
     19        * UserInterface/Protocol/Legacy/9.0/InspectorBackendCommands.js:
     20        * UserInterface/Protocol/Legacy/9.3/InspectorBackendCommands.js:
     21        * Versions/Inspector-iOS-10.0.json:
     22        * Versions/Inspector-iOS-10.3.json:
     23        * Versions/Inspector-iOS-11.0.json:
     24        * Versions/Inspector-iOS-11.3.json:
     25        * Versions/Inspector-iOS-12.0.json:
     26        * Versions/Inspector-iOS-12.2.json:
     27        * Versions/Inspector-iOS-8.0.json:
     28        * Versions/Inspector-iOS-9.0.json:
     29        * Versions/Inspector-iOS-9.3.json:
     30        Remove `Debugger.setOverlayMessage` command as it hasn't been used and is no longer supported.
     31
    1322019-02-24  Devin Rousso  <drousso@apple.com>
    233
  • trunk/Source/WebInspectorUI/UserInterface/Base/Main.js

    r241870 r242019  
    622622        }
    623623
     624        // COMPATIBILITY (iOS 11.3)
     625        if (target.PageAgent.setShowRulers && WI.settings.showRulers.value)
     626            target.PageAgent.setShowRulers(true);
     627
    624628        // COMPATIBILITY (iOS 8): Page.setShowPaintRects did not exist.
    625629        if (target.PageAgent.setShowPaintRects && WI.settings.showPaintRects.value)
  • trunk/Source/WebInspectorUI/UserInterface/Protocol/Legacy/10.0/InspectorBackendCommands.js

    r239183 r242019  
    198198InspectorBackend.registerCommand("Debugger.setPauseOnExceptions", [{"name": "state", "type": "string", "optional": false}], []);
    199199InspectorBackend.registerCommand("Debugger.evaluateOnCallFrame", [{"name": "callFrameId", "type": "string", "optional": false}, {"name": "expression", "type": "string", "optional": false}, {"name": "objectGroup", "type": "string", "optional": true}, {"name": "includeCommandLineAPI", "type": "boolean", "optional": true}, {"name": "doNotPauseOnExceptionsAndMuteConsole", "type": "boolean", "optional": true}, {"name": "returnByValue", "type": "boolean", "optional": true}, {"name": "generatePreview", "type": "boolean", "optional": true}, {"name": "saveResult", "type": "boolean", "optional": true}], ["result", "wasThrown", "savedResultIndex"]);
    200 InspectorBackend.registerCommand("Debugger.setOverlayMessage", [{"name": "message", "type": "string", "optional": true}], []);
    201200InspectorBackend.activateDomain("Debugger");
    202201
  • trunk/Source/WebInspectorUI/UserInterface/Protocol/Legacy/10.3/InspectorBackendCommands.js

    r239183 r242019  
    203203InspectorBackend.registerCommand("Debugger.setPauseOnAssertions", [{"name": "enabled", "type": "boolean", "optional": false}], []);
    204204InspectorBackend.registerCommand("Debugger.evaluateOnCallFrame", [{"name": "callFrameId", "type": "string", "optional": false}, {"name": "expression", "type": "string", "optional": false}, {"name": "objectGroup", "type": "string", "optional": true}, {"name": "includeCommandLineAPI", "type": "boolean", "optional": true}, {"name": "doNotPauseOnExceptionsAndMuteConsole", "type": "boolean", "optional": true}, {"name": "returnByValue", "type": "boolean", "optional": true}, {"name": "generatePreview", "type": "boolean", "optional": true}, {"name": "saveResult", "type": "boolean", "optional": true}], ["result", "wasThrown", "savedResultIndex"]);
    205 InspectorBackend.registerCommand("Debugger.setOverlayMessage", [{"name": "message", "type": "string", "optional": true}], []);
    206205InspectorBackend.activateDomain("Debugger");
    207206
  • trunk/Source/WebInspectorUI/UserInterface/Protocol/Legacy/11.0/InspectorBackendCommands.js

    r239183 r242019  
    215215InspectorBackend.registerCommand("Debugger.setPauseOnAssertions", [{"name": "enabled", "type": "boolean", "optional": false}], []);
    216216InspectorBackend.registerCommand("Debugger.evaluateOnCallFrame", [{"name": "callFrameId", "type": "string", "optional": false}, {"name": "expression", "type": "string", "optional": false}, {"name": "objectGroup", "type": "string", "optional": true}, {"name": "includeCommandLineAPI", "type": "boolean", "optional": true}, {"name": "doNotPauseOnExceptionsAndMuteConsole", "type": "boolean", "optional": true}, {"name": "returnByValue", "type": "boolean", "optional": true}, {"name": "generatePreview", "type": "boolean", "optional": true}, {"name": "saveResult", "type": "boolean", "optional": true}], ["result", "wasThrown", "savedResultIndex"]);
    217 InspectorBackend.registerCommand("Debugger.setOverlayMessage", [{"name": "message", "type": "string", "optional": true}], []);
    218217InspectorBackend.activateDomain("Debugger");
    219218
  • trunk/Source/WebInspectorUI/UserInterface/Protocol/Legacy/11.3/InspectorBackendCommands.js

    r239183 r242019  
    242242InspectorBackend.registerCommand("Debugger.setPauseOnAssertions", [{"name": "enabled", "type": "boolean", "optional": false}], []);
    243243InspectorBackend.registerCommand("Debugger.evaluateOnCallFrame", [{"name": "callFrameId", "type": "string", "optional": false}, {"name": "expression", "type": "string", "optional": false}, {"name": "objectGroup", "type": "string", "optional": true}, {"name": "includeCommandLineAPI", "type": "boolean", "optional": true}, {"name": "doNotPauseOnExceptionsAndMuteConsole", "type": "boolean", "optional": true}, {"name": "returnByValue", "type": "boolean", "optional": true}, {"name": "generatePreview", "type": "boolean", "optional": true}, {"name": "saveResult", "type": "boolean", "optional": true}], ["result", "wasThrown", "savedResultIndex"]);
    244 InspectorBackend.registerCommand("Debugger.setOverlayMessage", [{"name": "message", "type": "string", "optional": true}], []);
    245244InspectorBackend.activateDomain("Debugger");
    246245
  • trunk/Source/WebInspectorUI/UserInterface/Protocol/Legacy/12.0/InspectorBackendCommands.js

    r239183 r242019  
    244244InspectorBackend.registerCommand("Debugger.setPauseForInternalScripts", [{"name": "shouldPause", "type": "boolean", "optional": false}], []);
    245245InspectorBackend.registerCommand("Debugger.evaluateOnCallFrame", [{"name": "callFrameId", "type": "string", "optional": false}, {"name": "expression", "type": "string", "optional": false}, {"name": "objectGroup", "type": "string", "optional": true}, {"name": "includeCommandLineAPI", "type": "boolean", "optional": true}, {"name": "doNotPauseOnExceptionsAndMuteConsole", "type": "boolean", "optional": true}, {"name": "returnByValue", "type": "boolean", "optional": true}, {"name": "generatePreview", "type": "boolean", "optional": true}, {"name": "saveResult", "type": "boolean", "optional": true}], ["result", "wasThrown", "savedResultIndex"]);
    246 InspectorBackend.registerCommand("Debugger.setOverlayMessage", [{"name": "message", "type": "string", "optional": true}], []);
    247246InspectorBackend.activateDomain("Debugger");
    248247
  • trunk/Source/WebInspectorUI/UserInterface/Protocol/Legacy/12.2/InspectorBackendCommands.js

    r240488 r242019  
    250250InspectorBackend.registerCommand("Debugger.setPauseForInternalScripts", [{"name": "shouldPause", "type": "boolean", "optional": false}], []);
    251251InspectorBackend.registerCommand("Debugger.evaluateOnCallFrame", [{"name": "callFrameId", "type": "string", "optional": false}, {"name": "expression", "type": "string", "optional": false}, {"name": "objectGroup", "type": "string", "optional": true}, {"name": "includeCommandLineAPI", "type": "boolean", "optional": true}, {"name": "doNotPauseOnExceptionsAndMuteConsole", "type": "boolean", "optional": true}, {"name": "returnByValue", "type": "boolean", "optional": true}, {"name": "generatePreview", "type": "boolean", "optional": true}, {"name": "saveResult", "type": "boolean", "optional": true}], ["result", "wasThrown", "savedResultIndex"]);
    252 InspectorBackend.registerCommand("Debugger.setOverlayMessage", [{"name": "message", "type": "string", "optional": true}], []);
    253252InspectorBackend.activateDomain("Debugger");
    254253
  • trunk/Source/WebInspectorUI/UserInterface/Protocol/Legacy/8.0/InspectorBackendCommands.js

    r239183 r242019  
    7474InspectorBackend.registerCommand("Debugger.setPauseOnExceptions", [{"name": "state", "type": "string", "optional": false}], []);
    7575InspectorBackend.registerCommand("Debugger.evaluateOnCallFrame", [{"name": "callFrameId", "type": "string", "optional": false}, {"name": "expression", "type": "string", "optional": false}, {"name": "objectGroup", "type": "string", "optional": true}, {"name": "includeCommandLineAPI", "type": "boolean", "optional": true}, {"name": "doNotPauseOnExceptionsAndMuteConsole", "type": "boolean", "optional": true}, {"name": "returnByValue", "type": "boolean", "optional": true}, {"name": "generatePreview", "type": "boolean", "optional": true}], ["result", "wasThrown"]);
    76 InspectorBackend.registerCommand("Debugger.setOverlayMessage", [{"name": "message", "type": "string", "optional": true}], []);
    7776InspectorBackend.activateDomain("Debugger");
    7877
  • trunk/Source/WebInspectorUI/UserInterface/Protocol/Legacy/9.0/InspectorBackendCommands.js

    r239183 r242019  
    188188InspectorBackend.registerCommand("Debugger.setPauseOnExceptions", [{"name": "state", "type": "string", "optional": false}], []);
    189189InspectorBackend.registerCommand("Debugger.evaluateOnCallFrame", [{"name": "callFrameId", "type": "string", "optional": false}, {"name": "expression", "type": "string", "optional": false}, {"name": "objectGroup", "type": "string", "optional": true}, {"name": "includeCommandLineAPI", "type": "boolean", "optional": true}, {"name": "doNotPauseOnExceptionsAndMuteConsole", "type": "boolean", "optional": true}, {"name": "returnByValue", "type": "boolean", "optional": true}, {"name": "generatePreview", "type": "boolean", "optional": true}, {"name": "saveResult", "type": "boolean", "optional": true}], ["result", "wasThrown", "savedResultIndex"]);
    190 InspectorBackend.registerCommand("Debugger.setOverlayMessage", [{"name": "message", "type": "string", "optional": true}], []);
    191190InspectorBackend.activateDomain("Debugger");
    192191
  • trunk/Source/WebInspectorUI/UserInterface/Protocol/Legacy/9.3/InspectorBackendCommands.js

    r239183 r242019  
    195195InspectorBackend.registerCommand("Debugger.setPauseOnExceptions", [{"name": "state", "type": "string", "optional": false}], []);
    196196InspectorBackend.registerCommand("Debugger.evaluateOnCallFrame", [{"name": "callFrameId", "type": "string", "optional": false}, {"name": "expression", "type": "string", "optional": false}, {"name": "objectGroup", "type": "string", "optional": true}, {"name": "includeCommandLineAPI", "type": "boolean", "optional": true}, {"name": "doNotPauseOnExceptionsAndMuteConsole", "type": "boolean", "optional": true}, {"name": "returnByValue", "type": "boolean", "optional": true}, {"name": "generatePreview", "type": "boolean", "optional": true}, {"name": "saveResult", "type": "boolean", "optional": true}], ["result", "wasThrown", "savedResultIndex"]);
    197 InspectorBackend.registerCommand("Debugger.setOverlayMessage", [{"name": "message", "type": "string", "optional": true}], []);
    198197InspectorBackend.activateDomain("Debugger");
    199198
  • trunk/Source/WebInspectorUI/Versions/Inspector-iOS-10.0.json

    r239183 r242019  
    16121612            ],
    16131613            "description": "Evaluates expression on a given call frame."
    1614         },
    1615         {
    1616             "name": "setOverlayMessage",
    1617             "parameters": [
    1618                 { "name": "message", "type": "string", "optional": true, "description": "Overlay message to display when paused in debugger." }
    1619             ],
    1620             "description": "Sets overlay message."
    16211614        }
    16221615    ],
  • trunk/Source/WebInspectorUI/Versions/Inspector-iOS-10.3.json

    r239183 r242019  
    16531653            ],
    16541654            "description": "Evaluates expression on a given call frame."
    1655         },
    1656         {
    1657             "name": "setOverlayMessage",
    1658             "parameters": [
    1659                 { "name": "message", "type": "string", "optional": true, "description": "Overlay message to display when paused in debugger." }
    1660             ],
    1661             "description": "Sets overlay message."
    16621655        }
    16631656    ],
  • trunk/Source/WebInspectorUI/Versions/Inspector-iOS-11.0.json

    r239183 r242019  
    17301730                { "name": "savedResultIndex", "type": "integer", "optional": true, "description": "If the result was saved, this is the $n index that can be used to access the value." }
    17311731            ]
    1732         },
    1733         {
    1734             "name": "setOverlayMessage",
    1735             "description": "Sets overlay message.",
    1736             "parameters": [
    1737                 { "name": "message", "type": "string", "optional": true, "description": "Overlay message to display when paused in debugger." }
    1738             ]
    17391732        }
    17401733    ],
  • trunk/Source/WebInspectorUI/Versions/Inspector-iOS-11.3.json

    r239183 r242019  
    19541954                { "name": "savedResultIndex", "type": "integer", "optional": true, "description": "If the result was saved, this is the $n index that can be used to access the value." }
    19551955            ]
    1956         },
    1957         {
    1958             "name": "setOverlayMessage",
    1959             "description": "Sets overlay message.",
    1960             "parameters": [
    1961                 { "name": "message", "type": "string", "optional": true, "description": "Overlay message to display when paused in debugger." }
    1962             ]
    19631956        }
    19641957    ],
  • trunk/Source/WebInspectorUI/Versions/Inspector-iOS-12.0.json

    r239183 r242019  
    19691969                { "name": "savedResultIndex", "type": "integer", "optional": true, "description": "If the result was saved, this is the $n index that can be used to access the value." }
    19701970            ]
    1971         },
    1972         {
    1973             "name": "setOverlayMessage",
    1974             "description": "Sets overlay message.",
    1975             "parameters": [
    1976                 { "name": "message", "type": "string", "optional": true, "description": "Overlay message to display when paused in debugger." }
    1977             ]
    19781971        }
    19791972    ],
  • trunk/Source/WebInspectorUI/Versions/Inspector-iOS-12.2.json

    r240488 r242019  
    20202020                { "name": "savedResultIndex", "type": "integer", "optional": true, "description": "If the result was saved, this is the $n index that can be used to access the value." }
    20212021            ]
    2022         },
    2023         {
    2024             "name": "setOverlayMessage",
    2025             "description": "Sets overlay message.",
    2026             "parameters": [
    2027                 { "name": "message", "type": "string", "optional": true, "description": "Overlay message to display when paused in debugger." }
    2028             ]
    20292022        }
    20302023    ],
  • trunk/Source/WebInspectorUI/Versions/Inspector-iOS-8.0.json

    r239183 r242019  
    333333            ],
    334334            "description": "Evaluates expression on a given call frame."
    335         },
    336         {
    337             "name": "setOverlayMessage",
    338             "parameters": [
    339                 { "name": "message", "type": "string", "optional": true, "description": "Overlay message to display when paused in debugger." }
    340             ],
    341             "description": "Sets overlay message."
    342335        }
    343336    ],
  • trunk/Source/WebInspectorUI/Versions/Inspector-iOS-9.0.json

    r239183 r242019  
    15321532            ],
    15331533            "description": "Evaluates expression on a given call frame."
    1534         },
    1535         {
    1536             "name": "setOverlayMessage",
    1537             "parameters": [
    1538                 { "name": "message", "type": "string", "optional": true, "description": "Overlay message to display when paused in debugger." }
    1539             ],
    1540             "description": "Sets overlay message."
    15411534        }
    15421535    ],
  • trunk/Source/WebInspectorUI/Versions/Inspector-iOS-9.3.json

    r239183 r242019  
    15911591            ],
    15921592            "description": "Evaluates expression on a given call frame."
    1593         },
    1594         {
    1595             "name": "setOverlayMessage",
    1596             "parameters": [
    1597                 { "name": "message", "type": "string", "optional": true, "description": "Overlay message to display when paused in debugger." }
    1598             ],
    1599             "description": "Sets overlay message."
    16001593        }
    16011594    ],
Note: See TracChangeset for help on using the changeset viewer.