Bug 58992 - Web Inspector: Metrics pane editing and visual feedback improvements
Summary: Web Inspector: Metrics pane editing and visual feedback improvements
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Alexander Pavlov (apavlov)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-20 07:51 PDT by Alexander Pavlov (apavlov)
Modified: 2011-04-21 05:21 PDT (History)
13 users (show)

See Also:


Attachments
[PATCH] Suggested solution (36.76 KB, patch)
2011-04-20 08:46 PDT, Alexander Pavlov (apavlov)
pfeldman: review-
Details | Formatted Diff | Diff
[PATCH] Comments addressed (38.58 KB, patch)
2011-04-20 10:19 PDT, Alexander Pavlov (apavlov)
pfeldman: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Pavlov (apavlov) 2011-04-20 07:51:41 PDT
- The visual box model components should be highlighted on hover both in the Metrics pane and in the inspected page.
- The edit boxes for dimensions should honor [Page]Up/Down for increments/decrements, just like in the Styles pane.
Comment 1 Alexander Pavlov (apavlov) 2011-04-20 08:46:20 PDT
Created attachment 90344 [details]
[PATCH] Suggested solution
Comment 2 Pavel Feldman 2011-04-20 09:19:28 PDT
Comment on attachment 90344 [details]
[PATCH] Suggested solution

View in context: https://bugs.webkit.org/attachment.cgi?id=90344&action=review

> Source/WebCore/inspector/DOMNodeHighlighter.cpp:94
> +void drawHighlightForBox(GraphicsContext& context, const FloatQuad& contentQuad, const FloatQuad& paddingQuad, const FloatQuad& borderQuad, const FloatQuad& marginQuad, const String& mode)

mode -> enum

> Source/WebCore/inspector/Inspector.json:900
> +                    { "name": "mode", "type": "string", "optional": true, "description": "The box model component(s) to highlight: \"content\", \"padding\", \"border\", \"margin\", \"all\" (default: \"all\")." },

"enum": ["content", "padding", ...]

> Source/WebCore/inspector/InspectorDOMAgent.h:181
> +    void highlight(ErrorString*, Node*, const String& mode = "all");

Do not use default values unless necessary.

> Source/WebCore/inspector/front-end/MetricsSidebarPane.js:224
> +                widthElement.addEventListener("click", this.startEditing.bind(this, widthElement, "width", "width", style), false);

why did this change?

> Source/WebCore/inspector/front-end/MetricsSidebarPane.js:262
> +        WebInspector.highlightDOMNode(0, "");

mode should be optional.

> Source/WebCore/inspector/front-end/inspector.js:320
> +            DOMAgent.highlightDOMNode(nodeId, mode);

mode || "all"
Comment 3 Alexander Pavlov (apavlov) 2011-04-20 10:19:01 PDT
Created attachment 90357 [details]
[PATCH] Comments addressed
Comment 4 Alexander Pavlov (apavlov) 2011-04-20 10:20:16 PDT
(In reply to comment #2)
> (From update of attachment 90344 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=90344&action=review
> 
> > Source/WebCore/inspector/DOMNodeHighlighter.cpp:94
> > +void drawHighlightForBox(GraphicsContext& context, const FloatQuad& contentQuad, const FloatQuad& paddingQuad, const FloatQuad& borderQuad, const FloatQuad& marginQuad, const String& mode)
> 
> mode -> enum

Done

> > Source/WebCore/inspector/Inspector.json:900
> > +                    { "name": "mode", "type": "string", "optional": true, "description": "The box model component(s) to highlight: \"content\", \"padding\", \"border\", \"margin\", \"all\" (default: \"all\")." },
> 
> "enum": ["content", "padding", ...]

Done

> > Source/WebCore/inspector/InspectorDOMAgent.h:181
> > +    void highlight(ErrorString*, Node*, const String& mode = "all");
> 
> Do not use default values unless necessary.

Done

> > Source/WebCore/inspector/front-end/MetricsSidebarPane.js:224
> > +                widthElement.addEventListener("click", this.startEditing.bind(this, widthElement, "width", "width", style), false);
> 
> why did this change?

Inadvertent change, reverted

> > Source/WebCore/inspector/front-end/MetricsSidebarPane.js:262
> > +        WebInspector.highlightDOMNode(0, "");
> 
> mode should be optional.

Done

> > Source/WebCore/inspector/front-end/inspector.js:320
> > +            DOMAgent.highlightDOMNode(nodeId, mode);
> 
> mode || "all"

Done
Comment 5 WebKit Review Bot 2011-04-20 10:20:44 PDT
Attachment 90357 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCor..." exit_code: 1

Source/WebCore/inspector/DOMNodeHighlighter.h:47:  The parameter name "mode" adds no information, so it should be removed.  [readability/parameter_name] [5]
Total errors found: 1 in 12 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 6 Alexander Pavlov (apavlov) 2011-04-21 02:57:05 PDT
Committed r84481: <http://trac.webkit.org/changeset/84481>
Comment 7 Alexander Pavlov (apavlov) 2011-04-21 02:58:06 PDT
This is an upstream of Chromium issue http://code.google.com/p/chromium/issues/detail?id=77773
Comment 8 WebKit Review Bot 2011-04-21 05:21:21 PDT
http://trac.webkit.org/changeset/84481 might have broken Leopard Intel Debug (Tests)