RESOLVED FIXED 90880
Web Inspector: adding pause icon for JavaScript debugging
https://bugs.webkit.org/show_bug.cgi?id=90880
Summary Web Inspector: adding pause icon for JavaScript debugging
Sergey Rogulenko
Reported 2012-07-10 06:34:45 PDT
Adding pause icon for JavaScript debugging
Attachments
Patch (10.13 KB, patch)
2012-07-10 06:39 PDT, Sergey Rogulenko
no flags
Patch (18.46 KB, patch)
2012-07-10 10:46 PDT, Sergey Rogulenko
no flags
The screen on the left is the original page, the screen on the right is how it looks, when you are standing paused on a break point. (57.29 KB, image/png)
2012-07-11 01:44 PDT, Sergey Rogulenko
no flags
Patch (23.32 KB, patch)
2012-07-11 05:00 PDT, Sergey Rogulenko
no flags
Patch (24.06 KB, patch)
2012-07-11 07:40 PDT, Sergey Rogulenko
no flags
Patch (24.93 KB, patch)
2012-07-12 02:38 PDT, Sergey Rogulenko
no flags
Patch (25.31 KB, patch)
2012-07-12 05:29 PDT, Sergey Rogulenko
no flags
Patch (19.25 KB, patch)
2012-07-13 09:48 PDT, Sergey Rogulenko
no flags
Patch (25.42 KB, patch)
2012-07-16 03:12 PDT, Sergey Rogulenko
no flags
Patch (28.55 KB, patch)
2012-07-16 03:47 PDT, Sergey Rogulenko
no flags
Patch (84.41 KB, patch)
2012-07-16 06:49 PDT, Sergey Rogulenko
no flags
Patch (85.85 KB, patch)
2012-07-16 07:11 PDT, Sergey Rogulenko
no flags
Patch (89.36 KB, patch)
2012-07-16 07:48 PDT, Sergey Rogulenko
no flags
Patch (101.45 KB, patch)
2012-07-16 08:55 PDT, Sergey Rogulenko
no flags
Patch (98.36 KB, patch)
2012-07-16 09:52 PDT, Sergey Rogulenko
no flags
Patch (31.70 KB, patch)
2012-07-16 10:25 PDT, Sergey Rogulenko
no flags
Patch (31.05 KB, patch)
2012-07-16 11:16 PDT, Sergey Rogulenko
no flags
Patch (28.54 KB, patch)
2012-07-17 05:29 PDT, Sergey Rogulenko
no flags
Patch (40.42 KB, patch)
2012-07-17 10:47 PDT, Sergey Rogulenko
no flags
Patch (40.61 KB, patch)
2012-07-17 10:56 PDT, Sergey Rogulenko
no flags
Patch (38.04 KB, patch)
2012-07-18 03:11 PDT, Sergey Rogulenko
no flags
Patch (38.01 KB, patch)
2012-07-18 05:24 PDT, Sergey Rogulenko
no flags
Patch (38.12 KB, patch)
2012-07-18 06:31 PDT, Sergey Rogulenko
no flags
Sergey Rogulenko
Comment 1 2012-07-10 06:39:23 PDT
Alexander Pavlov (apavlov)
Comment 2 2012-07-10 08:37:56 PDT
Comment on attachment 151453 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=151453&action=review > Source/WebKit/chromium/ChangeLog:16 > + (DashBoard): Is this going to be implemented for ports other than Chromium? > Source/WebCore/inspector/InspectorDebuggerAgent.cpp:649 > + pageAgent->showPauseWarning(); My guess is that exposing InspectorClient in InspectorPageAgent would be a more flexible approach than adding a one-off method to the cross-agents API (as opposed to the other similar methods). Also, having such calls AFTER the internal state change seems a bit cleaner. > Source/WebCore/inspector/InspectorDebuggerAgent.cpp:674 > + pageAgent->hidePauseWarning(); Ditto > Source/WebCore/inspector/InspectorPageAgent.cpp:970 > +void InspectorPageAgent::showPauseWarning() Order of methods in a CPP file must correspond to that in the respective header file. > Source/WebCore/inspector/InspectorPageAgent.h:131 > + void showPauseWarning(); These can be replaced by a single InspectorClient* client(); as discussed above. > Source/WebKit/chromium/src/WebDevToolsAgentImpl.cpp:81 > +static const int pauseWarning = 100; The name is not intuitive enough. Something like "jsPausedSign" (or even "dashBoard" if it is going to be used for something else) would be a bit more clear. > Source/WebKit/chromium/src/WebDevToolsAgentImpl.cpp:387 > + FrameView* frameView = this->frameView(); Seems like no methods are called on the frameView? > Source/WebKit/chromium/src/WebDevToolsAgentImpl.cpp:394 > + FloatSize fs = FloatSize(m_webView->size()); Acronyms are not used as names in WebKit. You might as well static_cast m_webView->size()'s components to float rather than create a new FloatSize instance. > Source/WebKit/chromium/src/WebDevToolsAgentImpl.cpp:399 > + WebCore::FrameView* frameView() This can be removed with its only call site.
Andrey Kosyakov
Comment 3 2012-07-10 09:04:28 PDT
Comment on attachment 151453 [details] Patch As discussed, approach generally looks good, but it needs a bit more polish on both UI and implementation. Removing r? for the time being.
Sergey Rogulenko
Comment 4 2012-07-10 10:46:36 PDT
Timothy Hatcher
Comment 5 2012-07-10 11:08:25 PDT
It is not clear what this is about. Please add a description and/or mock up.
Sergey Rogulenko
Comment 6 2012-07-11 01:44:14 PDT
Created attachment 151645 [details] The screen on the left is the original page, the screen on the right is how it looks, when you are standing paused on a break point.
Sergey Rogulenko
Comment 7 2012-07-11 05:00:03 PDT
Sergey Rogulenko
Comment 8 2012-07-11 07:40:33 PDT
Sergey Rogulenko
Comment 9 2012-07-12 02:38:18 PDT
Sergey Rogulenko
Comment 10 2012-07-12 05:29:21 PDT
Andrey Kosyakov
Comment 11 2012-07-12 05:44:22 PDT
Comment on attachment 151920 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=151920&action=review Can we disable dashboard when "inspect element" mode is on? > Source/WebKit/chromium/src/WebDevToolsAgentImpl.cpp:372 > +class DevToolsDashBoard : public WebPageOverlay { Can you please move it to a file of its own? > Source/WebKit/chromium/src/WebDevToolsAgentImpl.cpp:443 > + DEFINE_STATIC_LOCAL(RefPtr<Image>, buttonImageDefault, (Image::loadPlatformResource("mediaplayerPlayDisabled"))); > + DEFINE_STATIC_LOCAL(RefPtr<Image>, buttonImage, (Image::loadPlatformResource("mediaplayerPlay"))); > + DEFINE_STATIC_LOCAL(RefPtr<Image>, buttonImageDown, (Image::loadPlatformResource("mediaplayerPlayDown"))); > + DEFINE_STATIC_LOCAL(RefPtr<Image>, buttonImageHover, (Image::loadPlatformResource("mediaplayerPlayHover"))); I think we could pass resource ids from the outside, so we can reuse the class for other buttons. I think you can just pass the root name (e.g. "mediaplayerPlay") and derive the rest by adding specific states (Disabled/Play/Down/etc) > Source/WebKit/chromium/src/WebDevToolsAgentImpl.cpp:459 > + void getState(bool& isFocused, bool& isPressed) does this have to be public? > Source/WebKit/chromium/src/WebDevToolsAgentImpl.cpp:465 > + void updateState(bool isFocused, bool isPressed) ditto
Pavel Feldman
Comment 12 2012-07-12 06:24:06 PDT
Comment on attachment 151920 [details] Patch r- as per our discussion offline - lets reuse existing DOM highlight plumbing.
Sergey Rogulenko
Comment 13 2012-07-13 09:48:20 PDT
Timothy Hatcher
Comment 14 2012-07-13 09:52:18 PDT
Comment on attachment 152280 [details] Patch I preferred the approach where the client was repsosible for showing/drawing this. Can you make this be PLATFORM(CHROMUM) or !PLATFORM(MAC)?
Timothy Hatcher
Comment 15 2012-07-13 09:54:47 PDT
Comment on attachment 152280 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=152280&action=review > Source/WebCore/inspector/DOMNodeHighlighter.cpp:490 > +InspectorDashBoard::InspectorDashBoard(InstrumentingAgents* instrumentingAgents, InspectorClient* client, InspectorPageAgent* pageAgent) DashBoard is one word. So this should be InspectorDashboard. Though, I'm not sure this should even be a separate class. Also classes in WebCore get their own file.
Timothy Hatcher
Comment 16 2012-07-13 09:55:48 PDT
Ugh, sorry for all the typos earlier.
Pavel Feldman
Comment 17 2012-07-13 10:00:19 PDT
Comment on attachment 152280 [details] Patch r- as per Timothy's comments.
Pavel Feldman
Comment 18 2012-07-13 10:21:06 PDT
Comment on attachment 152280 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=152280&action=review As we agreed offline, lets do the following: 1) Convert DOMNodeHighlighter into the InspectorOverlay class 2) Put its instance into the InspectorPageAgent and configure it from within InspectorDOMAgent and PageDebuggerAgent 3) Make sure that getHighlight is still available on this new overlay so that Timothy could access it and paint highlight on the embedder level. Timothy, this should not change the way things work for you. >> Source/WebCore/inspector/DOMNodeHighlighter.cpp:490 >> +InspectorDashBoard::InspectorDashBoard(InstrumentingAgents* instrumentingAgents, InspectorClient* client, InspectorPageAgent* pageAgent) > > DashBoard is one word. So this should be InspectorDashboard. Though, I'm not sure this should even be a separate class. Also classes in WebCore get their own file. You don't need instrumentingAgents here. > Source/WebCore/inspector/InspectorDOMAgent.cpp:206 > + , m_dashBoard(InspectorDashBoard::create(instrumentingAgents, client, pageAgent)) Dashboard should not belong to DOMAgent. > Source/WebCore/inspector/InspectorDOMAgent.cpp:1091 > + if (InspectorInstrumentation::isDebuggerPaused(m_instrumentingAgents)) DOM agent should not be debugger-aware. > Source/WebCore/inspector/InspectorInstrumentation.h:101 > + static bool isDebuggerPaused(InstrumentingAgents*); Why do you need this?
Sergey Rogulenko
Comment 19 2012-07-16 03:12:07 PDT
Sergey Rogulenko
Comment 20 2012-07-16 03:47:27 PDT
Andrey Kosyakov
Comment 21 2012-07-16 05:08:23 PDT
Comment on attachment 152506 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=152506&action=review > Source/WebCore/inspector/DOMNodeHighlighter.cpp:495 > + , m_highlightData(0) { } style: { } each on its own line. > Source/WebCore/inspector/DOMNodeHighlighter.cpp:502 > + else > + if (m_shouldShowPauseWarning) style: merge to "else if" > Source/WebCore/inspector/DOMNodeHighlighter.cpp:549 > + if (m_client) { nit: if (!m_client) return; > Source/WebCore/inspector/DOMNodeHighlighter.cpp:576 > + Frame* frame = m_pageAgent->mainFrame(); This seems to be the only place we use page agent. Please consider storing page instead, so we avoid circular dependencies. > Source/WebCore/inspector/DOMNodeHighlighter.h:83 > +class InspectorOverlay { You'll need to rename the file. > Source/WebCore/inspector/InspectorDOMAgent.cpp:1601 > void InspectorDOMAgent::getHighlight(Highlight* highlight) const Does DOM agent need this still? > Source/WebCore/inspector/InspectorDebuggerAgent.h:138 > + virtual bool isPageDebuggerAgent() = 0; Having BaseClass::isSomeDerivedClass() is very unfortunate. Making it pure virtual -- doubly so. Can we avoid this by just checking for a non-null InspectorOverlay? > Source/WebCore/inspector/InspectorPageAgent.cpp:319 > + , m_overlay(InspectorOverlay::create(this, client)) I'd put overlay ownership to InspectorController, so that it's life-time is explicit and we avoid another reasons for agents to depend on each other. Pavel, WDYT?
Sergey Rogulenko
Comment 22 2012-07-16 06:49:36 PDT
Early Warning System Bot
Comment 23 2012-07-16 07:01:40 PDT
Build Bot
Comment 24 2012-07-16 07:02:57 PDT
Early Warning System Bot
Comment 25 2012-07-16 07:03:08 PDT
Sergey Rogulenko
Comment 26 2012-07-16 07:11:14 PDT
Gyuyoung Kim
Comment 27 2012-07-16 07:23:04 PDT
Early Warning System Bot
Comment 28 2012-07-16 07:27:13 PDT
Build Bot
Comment 29 2012-07-16 07:28:43 PDT
Build Bot
Comment 30 2012-07-16 07:29:22 PDT
WebKit Review Bot
Comment 31 2012-07-16 07:37:12 PDT
Comment on attachment 152526 [details] Patch Attachment 152526 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/13245901
Early Warning System Bot
Comment 32 2012-07-16 07:42:58 PDT
Sergey Rogulenko
Comment 33 2012-07-16 07:48:54 PDT
Sergey Rogulenko
Comment 34 2012-07-16 08:55:46 PDT
Build Bot
Comment 35 2012-07-16 09:02:59 PDT
Sergey Rogulenko
Comment 36 2012-07-16 09:52:52 PDT
Sergey Rogulenko
Comment 37 2012-07-16 10:25:55 PDT
Andrey Kosyakov
Comment 38 2012-07-16 10:44:06 PDT
Comment on attachment 152558 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=152558&action=review > Source/WebCore/inspector/DOMNodeHighlighter.cpp:547 > +void InspectorOverlay::update() InspectorOverlay should be in a file of its own. > Source/WebCore/inspector/InspectorPageAgent.cpp:851 > +void InspectorPageAgent::drawInspectorOverlay(GraphicsContext& context) > +{ > + m_overlay->draw(context); > +} Why do we need this method on InspectorPageAgent?
Sergey Rogulenko
Comment 39 2012-07-16 11:16:09 PDT
Pavel Feldman
Comment 40 2012-07-16 11:43:42 PDT
Comment on attachment 152567 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=152567&action=review > Source/WebCore/inspector/DOMNodeHighlighter.cpp:492 > + , m_shouldShowPauseWarning(false) This is not a warning, simply "m_pausedInDebugger" > Source/WebCore/inspector/DOMNodeHighlighter.cpp:502 > + else if (m_shouldShowPauseWarning) I would not make these mutually exclusive - nuke the "else"! > Source/WebCore/inspector/DOMNodeHighlighter.cpp:503 > + drawPauseWarning(context); drawIsPausedInDebugger. > Source/WebCore/inspector/DOMNodeHighlighter.cpp:569 > +void InspectorOverlay::drawPauseWarning(GraphicsContext& context) drawIsPausedInDebugger > Source/WebCore/inspector/DOMNodeHighlighter.cpp:589 > + String text = "Paused in debugger."; Ok, we need to figure out how we localize it now. > Source/WebCore/inspector/DOMNodeHighlighter.h:95 > + void setShouldShowPauseWarning(bool); setIsPausedInDebugger > Source/WebCore/inspector/InspectorController.cpp:299 > + m_overlay->draw(context); Nit: We need to rename "draw" to "paint" everywhere in overlay at some point. > Source/WebCore/inspector/InspectorDOMAgent.cpp:1036 > // This method requires m_highlightData to have been filled in by its client. Now that highlightData lives in the InspectorOverlay, there is no need to mirror it here. > Source/WebCore/inspector/InspectorDebuggerAgent.cpp:109 > + m_overlay->setShouldShowPauseWarning(false); You should sniff for these from within PageDebuggerAgent. > Source/WebCore/inspector/InspectorDebuggerAgent.h:128 > + InspectorDebuggerAgent(InstrumentingAgents*, InspectorState*, InjectedScriptManager*, InspectorOverlay*); InspectorDebuggerAgent should not be affected. Only PageDebuggerAgent should be. > Source/WebCore/inspector/InspectorPageAgent.h:51 > +class GraphicsContext; Remove this?
Sergey Rogulenko
Comment 41 2012-07-17 05:29:29 PDT
Andrey Kosyakov
Comment 42 2012-07-17 05:49:09 PDT
Comment on attachment 152744 [details] Patch LGTM, though I liked the previous approach where highlight was mutually exclusive with pause screen.
Pavel Feldman
Comment 43 2012-07-17 06:57:20 PDT
Comment on attachment 152744 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=152744&action=review > Source/WebCore/inspector/DOMNodeHighlighter.cpp:492 > + , m_isPausedInDebugger(false) Nit: we rarely use "is" prefix. > Source/WebCore/inspector/DOMNodeHighlighter.cpp:501 > + drawHighlight(context); Nit: You could simply call drawHighlight here and bail out from there in case of no highlightData. > Source/WebCore/inspector/DOMNodeHighlighter.cpp:541 > +void InspectorOverlay::setIsPausedInDebugger(bool flag) setPausedInDebugger, sorry about that. > Source/WebCore/inspector/InspectorDOMAgent.cpp:1038 > + m_overlay->setHighlight(m_document.get(), m_highlightData.get()); m_document will expire upon reset. > Source/WebCore/inspector/InspectorDOMAgent.cpp:1606 > + m_overlay->getHighlight(m_highlightData->node ? m_highlightData->node->document() : m_document.get(), m_highlightData.get(), highlight); I was hoping m_highlightData could go away from the DOMAgent.
Sergey Rogulenko
Comment 44 2012-07-17 10:47:04 PDT
Early Warning System Bot
Comment 45 2012-07-17 10:53:33 PDT
Early Warning System Bot
Comment 46 2012-07-17 10:53:56 PDT
Gyuyoung Kim
Comment 47 2012-07-17 10:55:16 PDT
Build Bot
Comment 48 2012-07-17 10:55:39 PDT
Sergey Rogulenko
Comment 49 2012-07-17 10:56:32 PDT
Pavel Feldman
Comment 50 2012-07-17 11:16:51 PDT
Comment on attachment 152787 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=152787&action=review > Source/WebCore/inspector/DOMNodeHighlighter.cpp:73 > +static Color parseColor(const RefPtr<InspectorObject>* colorObject) Overlay is a utility class, it should not depend on the inspector transport objects. > Source/WebCore/inspector/DOMNodeHighlighter.cpp:585 > + m_highlightData = adoptPtr(new HighlightData()); I think this method should receive PassRefPtr<HighlightData> instead. > Source/WebCore/inspector/DOMNodeHighlighter.cpp:594 > + m_highlightData = adoptPtr(new HighlightData()); ditto > Source/WebCore/inspector/DOMNodeHighlighter.cpp:611 > + highlightConfig->getBoolean("showInfo", &showInfo); ditto
Sergey Rogulenko
Comment 51 2012-07-18 03:11:21 PDT
Andrey Kosyakov
Comment 52 2012-07-18 05:15:09 PDT
Comment on attachment 152976 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=152976&action=review > Source/WebCore/inspector/DOMNodeHighlighter.cpp:567 > + if (!m_client) > + return; Do we need this check?
Sergey Rogulenko
Comment 53 2012-07-18 05:24:01 PDT
Pavel Feldman
Comment 54 2012-07-18 06:18:01 PDT
Comment on attachment 152994 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=152994&action=review Please fix OwnPtr nits prior to landing. > Source/WebCore/inspector/DOMNodeHighlighter.cpp:533 > + if (m_highlightData) { // FIXME: Clear entire highlight data here, store config upon setInspectModeEnabled > Source/WebCore/inspector/DOMNodeHighlighter.h:96 > + void setHighlightData(PassOwnPtr<HighlightData>); I.e. highlightNode will merge with the setHighlightData. > Source/WebCore/inspector/InspectorDOMAgent.cpp:985 > + m_overlay->highlightNode(node); You should pass m_inspectModeHighlightData here (in the subsequent change). > Source/WebCore/inspector/InspectorDOMAgent.cpp:1009 > + HighlightData* highlightData = new HighlightData(); You should always adoptPtr upon creation. > Source/WebCore/inspector/InspectorDOMAgent.cpp:1029 > + HighlightData* highlightData = new HighlightData(); ditto > Source/WebCore/inspector/InspectorDOMAgent.cpp:1054 > + HighlightData* highlightData = new HighlightData(); ditto
Sergey Rogulenko
Comment 55 2012-07-18 06:31:22 PDT
Andrey Kosyakov
Comment 56 2012-07-18 07:05:22 PDT
Vsevolod Vlasov
Comment 57 2012-07-18 09:26:48 PDT
Comment on attachment 153003 [details] Patch Clearing r?
Note You need to log in before you can comment on or make changes to this bug.