Changeset 242019 in webkit
- Timestamp:
- Feb 24, 2019 8:41:53 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 19 deleted
- 46 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ChangeLog
r241939 r242019 1 2019-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 1 12 2019-02-22 Adrian Perez de Castro <aperez@igalia.com> 2 13 -
trunk/LayoutTests/ChangeLog
r242018 r242019 1 2019-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 1 26 2019-02-24 Devin Rousso <drousso@apple.com> 2 27 -
trunk/LayoutTests/platform/mac/TestExpectations
r242017 r242019 1063 1063 webkit.org/b/170127 inspector/dom-debugger/dom-breakpoints.html [ Pass Timeout ] 1064 1064 webkit.org/b/148636 inspector/dom/getAccessibilityPropertiesForNode.html [ Pass Timeout ] 1065 webkit.org/b/148636 inspector/dom/highlight-shape-outside.html [ Pass Timeout ]1066 1065 webkit.org/b/154610 inspector/dom-debugger/node-removed.html [ Pass Timeout ] 1067 1066 webkit.org/b/153039 [ Debug ] inspector/heap/garbageCollected.html [ Pass Timeout ] -
trunk/Source/JavaScriptCore/CMakeLists.txt
r241769 r242019 1097 1097 ${JAVASCRIPTCORE_DIR}/inspector/protocol/LayerTree.json 1098 1098 ${JAVASCRIPTCORE_DIR}/inspector/protocol/Network.json 1099 ${JAVASCRIPTCORE_DIR}/inspector/protocol/OverlayTypes.json1100 1099 ${JAVASCRIPTCORE_DIR}/inspector/protocol/Page.json 1101 1100 ${JAVASCRIPTCORE_DIR}/inspector/protocol/Recording.json -
trunk/Source/JavaScriptCore/ChangeLog
r242015 r242019 1 2019-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 1 23 2019-02-24 Yusuke Suzuki <ysuzuki@apple.com> 2 24 -
trunk/Source/JavaScriptCore/DerivedSources-input.xcfilelist
r240993 r242019 95 95 $(PROJECT_DIR)/inspector/protocol/Memory.json 96 96 $(PROJECT_DIR)/inspector/protocol/Network.json 97 $(PROJECT_DIR)/inspector/protocol/OverlayTypes.json98 97 $(PROJECT_DIR)/inspector/protocol/Page.json 99 98 $(PROJECT_DIR)/inspector/protocol/Recording.json -
trunk/Source/JavaScriptCore/DerivedSources.make
r241660 r242019 244 244 $(JavaScriptCore)/inspector/protocol/LayerTree.json \ 245 245 $(JavaScriptCore)/inspector/protocol/Network.json \ 246 $(JavaScriptCore)/inspector/protocol/OverlayTypes.json \247 246 $(JavaScriptCore)/inspector/protocol/Page.json \ 248 247 $(JavaScriptCore)/inspector/protocol/Recording.json \ -
trunk/Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.cpp
r241244 r242019 856 856 m_scriptDebugServer.setPauseOnExceptionsState(pauseState); 857 857 } 858 }859 860 void InspectorDebuggerAgent::setOverlayMessage(ErrorString&, const String*)861 {862 858 } 863 859 -
trunk/Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.h
r239427 r242019 81 81 void setPauseOnAssertions(ErrorString&, bool enabled) final; 82 82 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;84 83 85 84 bool isPaused() const; -
trunk/Source/JavaScriptCore/inspector/protocol/Debugger.json
r239703 r242019 286 286 { "name": "wasThrown", "type": "boolean", "optional": true, "description": "True if the result was thrown during the evaluation." }, 287 287 { "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." }295 288 ] 296 289 } -
trunk/Source/WebCore/CMakeLists.txt
r241328 r242019 1763 1763 WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS() 1764 1764 1765 # Generate InspectorOverlayPage.h1766 add_custom_command(1767 OUTPUT ${DERIVED_SOURCES_WEBCORE_DIR}/InspectorOverlayPage.h ${DERIVED_SOURCES_WEBCORE_DIR}/InspectorOverlayPage.combined.html1768 MAIN_DEPENDENCY inspector/InspectorOverlayPage.html1769 DEPENDS ${JavaScriptCore_SCRIPTS_DIR}/xxd.pl ${JavaScriptCore_SCRIPTS_DIR}/inline-and-minify-stylesheets-and-scripts.py1770 DEPENDS inspector/InspectorOverlayPage.css inspector/InspectorOverlayPage.js1771 COMMAND ${PYTHON_EXECUTABLE} ${JavaScriptCore_SCRIPTS_DIR}/inline-and-minify-stylesheets-and-scripts.py ${WEBCORE_DIR}/inspector/InspectorOverlayPage.html ${DERIVED_SOURCES_WEBCORE_DIR}/InspectorOverlayPage.combined.html1772 COMMAND ${PERL_EXECUTABLE} ${JavaScriptCore_SCRIPTS_DIR}/xxd.pl InspectorOverlayPage_html ${DERIVED_SOURCES_WEBCORE_DIR}/InspectorOverlayPage.combined.html ${DERIVED_SOURCES_WEBCORE_DIR}/InspectorOverlayPage.h1773 VERBATIM)1774 list(APPEND WebCore_SOURCES ${DERIVED_SOURCES_WEBCORE_DIR}/InspectorOverlayPage.h)1775 1776 1765 1777 1766 # Generate CommandLineAPIModuleSource.h -
trunk/Source/WebCore/ChangeLog
r242014 r242019 1 2019-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 1 92 2019-02-20 Darin Adler <darin@apple.com> 2 93 -
trunk/Source/WebCore/DerivedSources-input.xcfilelist
r241328 r242019 857 857 $(PROJECT_DIR)/inspector/InspectorAuditDOMObject.idl 858 858 $(PROJECT_DIR)/inspector/InspectorFrontendHost.idl 859 $(PROJECT_DIR)/inspector/InspectorOverlayPage.css860 $(PROJECT_DIR)/inspector/InspectorOverlayPage.html861 $(PROJECT_DIR)/inspector/InspectorOverlayPage.js862 859 $(PROJECT_DIR)/loader/appcache/DOMApplicationCache.idl 863 860 $(PROJECT_DIR)/make-hash-tools.pl -
trunk/Source/WebCore/DerivedSources-output.xcfilelist
r241328 r242019 30 30 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/HTTPHeaderNames.gperf 31 31 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/HTTPHeaderNames.h 32 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/InspectorOverlayPage.h33 32 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/InternalSettingsGenerated.cpp 34 33 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/InternalSettingsGenerated.h -
trunk/Source/WebCore/DerivedSources.make
r241328 r242019 1726 1726 # Inspector interfaces 1727 1727 1728 all : InspectorOverlayPage.h1729 1730 InspectorOverlayPage.h : InspectorOverlayPage.html InspectorOverlayPage.css InspectorOverlayPage.js1731 $(PYTHON) $(JavaScriptCore_SCRIPTS_DIR)/inline-and-minify-stylesheets-and-scripts.py $(WebCore)/inspector/InspectorOverlayPage.html ./InspectorOverlayPage.combined.html1732 $(PERL) $(JavaScriptCore_SCRIPTS_DIR)/xxd.pl InspectorOverlayPage_html ./InspectorOverlayPage.combined.html InspectorOverlayPage.h1733 $(DELETE) InspectorOverlayPage.combined.html1734 1735 1728 all : CommandLineAPIModuleSource.h 1736 1729 -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r241997 r242019 9562 9562 7A674BD90F9EBF4E006CF099 /* PageGroupLoadDeferrer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PageGroupLoadDeferrer.cpp; sourceTree = "<group>"; }; 9563 9563 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>"; };9565 9564 7A929CA11C598378004DF226 /* ResourceLoadStatistics.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ResourceLoadStatistics.cpp; sourceTree = "<group>"; }; 9566 9565 7A929CA21C598378004DF226 /* ResourceLoadStatistics.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ResourceLoadStatistics.h; sourceTree = "<group>"; }; … … 11435 11434 A516E8B4136E04DB0076C3C0 /* LocalizedDateCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LocalizedDateCache.h; sourceTree = "<group>"; }; 11436 11435 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>"; };11439 11436 A52B348C1FA3BD79008B6246 /* ServiceWorkerDebuggable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ServiceWorkerDebuggable.h; sourceTree = "<group>"; }; 11440 11437 A52B348E1FA3BD79008B6246 /* ServiceWorkerDebuggable.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ServiceWorkerDebuggable.cpp; sourceTree = "<group>"; }; … … 17063 17060 7C522D4915B477E8009B7C95 /* InspectorOverlay.cpp */, 17064 17061 7C522D4A15B478B2009B7C95 /* InspectorOverlay.h */, 17065 A518225417E2A0D400A9BA1D /* InspectorOverlayPage.css */,17066 7A7256B915EB9F5B007323A7 /* InspectorOverlayPage.html */,17067 A518225517E2A0D400A9BA1D /* InspectorOverlayPage.js */,17068 17062 6A7279891F16C29B003F39B8 /* InspectorShaderProgram.cpp */, 17069 17063 6A7279881F16C29B003F39B8 /* InspectorShaderProgram.h */, -
trunk/Source/WebCore/inspector/InspectorController.cpp
r240457 r242019 193 193 auto pageContext = pageAgentContext(); 194 194 195 auto debuggerAgent = std::make_unique<PageDebuggerAgent>(pageContext, m_pageAgent , m_overlay.get());195 auto debuggerAgent = std::make_unique<PageDebuggerAgent>(pageContext, m_pageAgent); 196 196 auto debuggerAgentPtr = debuggerAgent.get(); 197 197 … … 304 304 305 305 // Clean up inspector resources. 306 m_overlay->freePage();307 306 m_injectedScriptManager->discardInjectedScripts(); 308 307 … … 341 340 342 341 // Clean up inspector resources. 343 m_overlay->freePage();344 342 m_injectedScriptManager->disconnect(); 345 343 … … 393 391 { 394 392 m_overlay->getHighlight(highlight, coordinateSystem); 395 }396 397 Ref<JSON::ArrayOf<Inspector::Protocol::OverlayTypes::NodeHighlightData>> InspectorController::buildObjectForHighlightedNodes() const398 {399 return m_overlay->buildObjectForHighlightedNodes();400 393 } 401 394 -
trunk/Source/WebCore/inspector/InspectorController.h
r238206 r242019 45 45 class FrontendRouter; 46 46 class InspectorAgent; 47 48 namespace Protocol {49 namespace OverlayTypes {50 class NodeHighlightData;51 }52 }53 47 } 54 48 … … 104 98 WEBCORE_EXPORT void setIndicating(bool); 105 99 106 WEBCORE_EXPORT Ref<JSON::ArrayOf<Inspector::Protocol::OverlayTypes::NodeHighlightData>> buildObjectForHighlightedNodes() const;107 108 100 WEBCORE_EXPORT void didComposite(Frame&); 109 101 -
trunk/Source/WebCore/inspector/InspectorOverlay.cpp
r239247 r242019 1 1 /* 2 2 * Copyright (C) 2011 Google Inc. All rights reserved. 3 * Copyright (C) 2019 Apple Inc. All rights reserved. 3 4 * 4 5 * Redistribution and use in source and binary forms, with or without … … 30 31 #include "InspectorOverlay.h" 31 32 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" 35 37 #include "Element.h" 36 #include "EmptyClients.h" 38 #include "FloatPoint.h" 39 #include "FloatSize.h" 40 #include "FontCascade.h" 41 #include "FontCascadeDescription.h" 37 42 #include "Frame.h" 38 43 #include "FrameView.h" 39 44 #include "GraphicsContext.h" 40 45 #include "InspectorClient.h" 41 #include "InspectorOverlayPage.h" 42 #include "LibWebRTCProvider.h" 46 #include "IntPoint.h" 47 #include "IntRect.h" 48 #include "IntSize.h" 43 49 #include "Node.h" 50 #include "NodeList.h" 44 51 #include "Page.h" 45 #include "PageConfiguration.h" 46 #include "PolygonShape.h" 52 #include "Path.h" 47 53 #include "PseudoElement.h" 48 #include "RTCController.h" 49 #include "RectangleShape.h" 54 #include "RenderBox.h" 50 55 #include "RenderBoxModelObject.h" 51 #include "RenderElement.h"52 56 #include "RenderInline.h" 53 #include "RenderView.h" 54 #include "ScriptController.h" 55 #include "ScriptSourceCode.h" 57 #include "RenderObject.h" 56 58 #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> 65 61 66 62 namespace WebCore { … … 68 64 using namespace Inspector; 69 65 66 static constexpr float elementDataSpacing = 2; 67 static constexpr float elementDataArrowSize = 7; 68 static constexpr float elementDataBorderSize = 1; 69 70 static constexpr float rulerSize = 15; 71 static constexpr float rulerLabelSize = 13; 72 static constexpr float rulerStepIncrement = 50; 73 static constexpr float rulerStepLength = 8; 74 static constexpr float rulerSubStepIncrement = 5; 75 static constexpr float rulerSubStepLength = 5; 76 77 static 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 87 static FloatPoint localPointToRootPoint(const FrameView* view, const FloatPoint& point) 88 { 89 return view->contentsToRootView(roundedIntPoint(point)); 90 } 91 70 92 static void contentsQuadToCoordinateSystem(const FrameView* mainView, const FrameView* view, FloatQuad& quad, InspectorOverlay::CoordinateSystem coordinateSystem) 71 93 { 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())); 76 98 77 99 if (coordinateSystem == InspectorOverlay::CoordinateSystem::View) … … 79 101 } 80 102 81 static void contentsQuadToPage(const FrameView* mainView, const FrameView* view, FloatQuad& quad) 82 { 83 contentsQuadToCoordinateSystem(mainView, view, quad, InspectorOverlay::CoordinateSystem::View); 103 static 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; 84 116 } 85 117 … … 167 199 } 168 200 201 static 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 215 static 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 228 static 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 245 static 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 278 static 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 169 362 InspectorOverlay::InspectorOverlay(Page& page, InspectorClient* client) 170 363 : m_page(page) … … 181 374 return; 182 375 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 }); 186 379 187 380 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); 196 408 } 197 409 … … 217 429 } 218 430 219 void InspectorOverlay::setPausedInDebuggerMessage(const String* message)220 {221 m_pausedInDebuggerMessage = message ? *message : String();222 update();223 }224 225 431 void InspectorOverlay::hideHighlight() 226 432 { … … 269 475 void InspectorOverlay::setIndicating(bool indicating) 270 476 { 477 if (m_indicating == indicating) 478 return; 479 271 480 m_indicating = indicating; 272 481 273 if (m_indicating)274 evaluateInOverlay("showPageIndication"_s);275 else276 evaluateInOverlay("hidePageIndication"_s);277 278 482 update(); 279 483 } … … 281 485 bool InspectorOverlay::shouldShowOverlay() const 282 486 { 283 return m_highlightNode || m_highlightNodeList || m_highlightQuad || m_indicating || m_show ingPaintRects || m_showRulers || !m_pausedInDebuggerMessage.isNull();487 return m_highlightNode || m_highlightNodeList || m_highlightQuad || m_indicating || m_showPaintRects || m_showRulers; 284 488 } 285 489 … … 295 499 return; 296 500 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 504 void InspectorOverlay::setShowPaintRects(bool showPaintRects) 505 { 506 if (m_showPaintRects == showPaintRects) 507 return; 508 509 m_showPaintRects = showPaintRects; 510 if (!m_showPaintRects) { 388 511 m_paintRects.clear(); 389 512 m_paintRectUpdateTimer.stop(); 390 drawPaintRects(); 391 forcePaint(); 513 update(); 392 514 } 393 515 } … … 395 517 void InspectorOverlay::showPaintRect(const FloatRect& rect) 396 518 { 397 if (!m_show ingPaintRects)519 if (!m_showPaintRects) 398 520 return; 399 521 … … 410 532 } 411 533 412 drawPaintRects(); 413 forcePaint(); 534 update(); 414 535 } 415 536 … … 436 557 m_paintRectUpdateTimer.stop(); 437 558 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 563 void 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 580 void InspectorOverlay::drawQuadHighlight(GraphicsContext& context, const FloatQuad& quad) 581 { 462 582 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 595 void 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 606 void 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 656 void 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 } 565 739 } 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 } 602 764 } 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 801 void 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(); 614 811 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()); 631 854 } 632 855 … … 635 858 WebCore::AXObjectCache::enableAccessibility(); 636 859 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 } 822 1000 } 823 1001 -
trunk/Source/WebCore/inspector/InspectorOverlay.h
r231881 r242019 1 1 /* 2 2 * Copyright (C) 2011 Google Inc. All rights reserved. 3 * Copyright (C) 2019 Apple Inc. All rights reserved. 3 4 * 4 5 * Redistribution and use in source and binary forms, with or without … … 31 32 #include "Color.h" 32 33 #include "FloatQuad.h" 33 #include "LayoutRect.h" 34 #include "NodeList.h" 34 #include "FloatRect.h" 35 35 #include "Timer.h" 36 #include <JavaScriptCore/InspectorProtocolObjects.h>37 36 #include <wtf/Deque.h> 38 #include <wtf/ JSONValues.h>37 #include <wtf/MonotonicTime.h> 39 38 #include <wtf/RefPtr.h> 40 39 #include <wtf/Vector.h> … … 43 42 namespace WebCore { 44 43 45 class Color;46 44 class GraphicsContext; 47 45 class InspectorClient; 48 class IntRect;49 46 class Node; 47 class NodeList; 50 48 class Page; 51 49 … … 107 105 void getHighlight(Highlight&, CoordinateSystem) const; 108 106 109 void setPausedInDebuggerMessage(const String*);110 111 107 void hideHighlight(); 112 108 void highlightNodeList(RefPtr<NodeList>&&, const HighlightConfig&); 113 109 void highlightNode(Node*, const HighlightConfig&); 114 110 void highlightQuad(std::unique_ptr<FloatQuad>, const HighlightConfig&); 115 116 void setShow ingPaintRects(bool);111 112 void setShowPaintRects(bool); 117 113 void showPaintRect(const FloatRect&); 118 114 119 115 void setShowRulers(bool); 120 116 121 117 Node* highlightedNode() const; 122 118 … … 125 121 void setIndicating(bool indicating); 126 122 127 RefPtr<Inspector::Protocol::OverlayTypes::NodeHighlightData> buildHighlightObjectForNode(Node*, HighlightType) const; 128 Ref<JSON::ArrayOf<Inspector::Protocol::OverlayTypes::NodeHighlightData>> buildObjectForHighlightedNodes() const;123 private: 124 using TimeRectPair = std::pair<MonotonicTime, FloatRect>; 129 125 130 void freePage();131 private:132 126 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 138 136 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);147 137 148 138 Page& m_page; 149 139 InspectorClient* m_client; 150 String m_pausedInDebuggerMessage; 140 151 141 RefPtr<Node> m_highlightNode; 152 142 RefPtr<NodeList> m_highlightNodeList; 153 143 HighlightConfig m_nodeHighlightConfig; 144 154 145 std::unique_ptr<FloatQuad> m_highlightQuad; 155 std::unique_ptr<Page> m_overlayPage;156 146 HighlightConfig m_quadHighlightConfig; 157 158 using TimeRectPair = std::pair<MonotonicTime, FloatRect>; 147 159 148 Deque<TimeRectPair> m_paintRects; 160 149 Timer m_paintRectUpdateTimer; 150 161 151 bool m_indicating {false}; 162 bool m_show ingPaintRects {false};152 bool m_showPaintRects {false}; 163 153 bool m_showRulers {false}; 164 154 }; -
trunk/Source/WebCore/inspector/agents/InspectorPageAgent.cpp
r240644 r242019 325 325 ErrorString unused; 326 326 setShowPaintRects(unused, false); 327 setShowRulers(unused, false); 327 328 overrideUserAgent(unused, nullptr); 328 329 setEmulatedMedia(unused, emptyString()); … … 634 635 return; 635 636 636 m_overlay->setShow ingPaintRects(show);637 m_overlay->setShowPaintRects(show); 637 638 } 638 639 -
trunk/Source/WebCore/inspector/agents/page/PageDebuggerAgent.cpp
r236762 r242019 38 38 #include "EventTarget.h" 39 39 #include "Frame.h" 40 #include "InspectorOverlay.h"41 40 #include "InspectorPageAgent.h" 42 41 #include "InstrumentingAgents.h" … … 58 57 using namespace Inspector; 59 58 60 PageDebuggerAgent::PageDebuggerAgent(PageAgentContext& context, InspectorPageAgent* pageAgent , InspectorOverlay* overlay)59 PageDebuggerAgent::PageDebuggerAgent(PageAgentContext& context, InspectorPageAgent* pageAgent) 61 60 : WebDebuggerAgent(context) 62 61 , m_page(context.inspectedPage) 63 62 , m_pageAgent(pageAgent) 64 , m_overlay(overlay)65 63 { 66 64 } … … 136 134 } 137 135 138 void PageDebuggerAgent::setOverlayMessage(ErrorString&, const String* message)139 {140 m_overlay->setPausedInDebuggerMessage(message);141 }142 143 136 void PageDebuggerAgent::didClearMainFrameWindowObject() 144 137 { -
trunk/Source/WebCore/inspector/agents/page/PageDebuggerAgent.h
r231659 r242019 39 39 class EventListener; 40 40 class EventTarget; 41 class InspectorOverlay;42 41 class InspectorPageAgent; 43 42 class Page; … … 49 48 WTF_MAKE_FAST_ALLOCATED; 50 49 public: 51 PageDebuggerAgent(PageAgentContext&, InspectorPageAgent* , InspectorOverlay*);50 PageDebuggerAgent(PageAgentContext&, InspectorPageAgent*); 52 51 virtual ~PageDebuggerAgent() = default; 53 52 … … 86 85 87 86 Inspector::InjectedScript injectedScriptForEval(ErrorString&, const int* executionContextId) override; 88 void setOverlayMessage(ErrorString&, const String*) final;89 87 90 88 Page& m_page; 91 89 92 90 InspectorPageAgent* m_pageAgent; 93 InspectorOverlay* m_overlay { nullptr };94 91 95 92 HashMap<const RegisteredEventListener*, int> m_registeredEventListeners; -
trunk/Source/WebCore/testing/Internals.cpp
r241788 r242019 1544 1544 } 1545 1545 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 1555 1546 ExceptionOr<unsigned> Internals::markerCountForNode(Node& node, const String& markerType) 1556 1547 { -
trunk/Source/WebCore/testing/Internals.h
r241788 r242019 226 226 227 227 ExceptionOr<Ref<DOMRectList>> inspectorHighlightRects(); 228 ExceptionOr<String> inspectorHighlightObject();229 228 230 229 ExceptionOr<unsigned> markerCountForNode(Node&, const String&); -
trunk/Source/WebCore/testing/Internals.idl
r241788 r242019 244 244 245 245 [MayThrowException] DOMRectList inspectorHighlightRects(); 246 [MayThrowException] DOMString inspectorHighlightObject();247 246 248 247 [MayThrowException] unsigned long markerCountForNode(Node node, DOMString markerType); -
trunk/Source/WebInspectorUI/ChangeLog
r242018 r242019 1 2019-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 1 32 2019-02-24 Devin Rousso <drousso@apple.com> 2 33 -
trunk/Source/WebInspectorUI/UserInterface/Base/Main.js
r241870 r242019 622 622 } 623 623 624 // COMPATIBILITY (iOS 11.3) 625 if (target.PageAgent.setShowRulers && WI.settings.showRulers.value) 626 target.PageAgent.setShowRulers(true); 627 624 628 // COMPATIBILITY (iOS 8): Page.setShowPaintRects did not exist. 625 629 if (target.PageAgent.setShowPaintRects && WI.settings.showPaintRects.value) -
trunk/Source/WebInspectorUI/UserInterface/Protocol/Legacy/10.0/InspectorBackendCommands.js
r239183 r242019 198 198 InspectorBackend.registerCommand("Debugger.setPauseOnExceptions", [{"name": "state", "type": "string", "optional": false}], []); 199 199 InspectorBackend.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}], []);201 200 InspectorBackend.activateDomain("Debugger"); 202 201 -
trunk/Source/WebInspectorUI/UserInterface/Protocol/Legacy/10.3/InspectorBackendCommands.js
r239183 r242019 203 203 InspectorBackend.registerCommand("Debugger.setPauseOnAssertions", [{"name": "enabled", "type": "boolean", "optional": false}], []); 204 204 InspectorBackend.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}], []);206 205 InspectorBackend.activateDomain("Debugger"); 207 206 -
trunk/Source/WebInspectorUI/UserInterface/Protocol/Legacy/11.0/InspectorBackendCommands.js
r239183 r242019 215 215 InspectorBackend.registerCommand("Debugger.setPauseOnAssertions", [{"name": "enabled", "type": "boolean", "optional": false}], []); 216 216 InspectorBackend.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}], []);218 217 InspectorBackend.activateDomain("Debugger"); 219 218 -
trunk/Source/WebInspectorUI/UserInterface/Protocol/Legacy/11.3/InspectorBackendCommands.js
r239183 r242019 242 242 InspectorBackend.registerCommand("Debugger.setPauseOnAssertions", [{"name": "enabled", "type": "boolean", "optional": false}], []); 243 243 InspectorBackend.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}], []);245 244 InspectorBackend.activateDomain("Debugger"); 246 245 -
trunk/Source/WebInspectorUI/UserInterface/Protocol/Legacy/12.0/InspectorBackendCommands.js
r239183 r242019 244 244 InspectorBackend.registerCommand("Debugger.setPauseForInternalScripts", [{"name": "shouldPause", "type": "boolean", "optional": false}], []); 245 245 InspectorBackend.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}], []);247 246 InspectorBackend.activateDomain("Debugger"); 248 247 -
trunk/Source/WebInspectorUI/UserInterface/Protocol/Legacy/12.2/InspectorBackendCommands.js
r240488 r242019 250 250 InspectorBackend.registerCommand("Debugger.setPauseForInternalScripts", [{"name": "shouldPause", "type": "boolean", "optional": false}], []); 251 251 InspectorBackend.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}], []);253 252 InspectorBackend.activateDomain("Debugger"); 254 253 -
trunk/Source/WebInspectorUI/UserInterface/Protocol/Legacy/8.0/InspectorBackendCommands.js
r239183 r242019 74 74 InspectorBackend.registerCommand("Debugger.setPauseOnExceptions", [{"name": "state", "type": "string", "optional": false}], []); 75 75 InspectorBackend.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}], []);77 76 InspectorBackend.activateDomain("Debugger"); 78 77 -
trunk/Source/WebInspectorUI/UserInterface/Protocol/Legacy/9.0/InspectorBackendCommands.js
r239183 r242019 188 188 InspectorBackend.registerCommand("Debugger.setPauseOnExceptions", [{"name": "state", "type": "string", "optional": false}], []); 189 189 InspectorBackend.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}], []);191 190 InspectorBackend.activateDomain("Debugger"); 192 191 -
trunk/Source/WebInspectorUI/UserInterface/Protocol/Legacy/9.3/InspectorBackendCommands.js
r239183 r242019 195 195 InspectorBackend.registerCommand("Debugger.setPauseOnExceptions", [{"name": "state", "type": "string", "optional": false}], []); 196 196 InspectorBackend.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}], []);198 197 InspectorBackend.activateDomain("Debugger"); 199 198 -
trunk/Source/WebInspectorUI/Versions/Inspector-iOS-10.0.json
r239183 r242019 1612 1612 ], 1613 1613 "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."1621 1614 } 1622 1615 ], -
trunk/Source/WebInspectorUI/Versions/Inspector-iOS-10.3.json
r239183 r242019 1653 1653 ], 1654 1654 "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."1662 1655 } 1663 1656 ], -
trunk/Source/WebInspectorUI/Versions/Inspector-iOS-11.0.json
r239183 r242019 1730 1730 { "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." } 1731 1731 ] 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 ]1739 1732 } 1740 1733 ], -
trunk/Source/WebInspectorUI/Versions/Inspector-iOS-11.3.json
r239183 r242019 1954 1954 { "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." } 1955 1955 ] 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 ]1963 1956 } 1964 1957 ], -
trunk/Source/WebInspectorUI/Versions/Inspector-iOS-12.0.json
r239183 r242019 1969 1969 { "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." } 1970 1970 ] 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 ]1978 1971 } 1979 1972 ], -
trunk/Source/WebInspectorUI/Versions/Inspector-iOS-12.2.json
r240488 r242019 2020 2020 { "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." } 2021 2021 ] 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 ]2029 2022 } 2030 2023 ], -
trunk/Source/WebInspectorUI/Versions/Inspector-iOS-8.0.json
r239183 r242019 333 333 ], 334 334 "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."342 335 } 343 336 ], -
trunk/Source/WebInspectorUI/Versions/Inspector-iOS-9.0.json
r239183 r242019 1532 1532 ], 1533 1533 "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."1541 1534 } 1542 1535 ], -
trunk/Source/WebInspectorUI/Versions/Inspector-iOS-9.3.json
r239183 r242019 1591 1591 ], 1592 1592 "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."1600 1593 } 1601 1594 ],
Note: See TracChangeset
for help on using the changeset viewer.