Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1117)

Unified Diff: Source/core/inspector/InspectorOverlay.cpp

Issue 662603002: [DevTools] Adjust svg elements highlight to the root FrameView origin. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Testing Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/inspector/InspectorOverlay.cpp
diff --git a/Source/core/inspector/InspectorOverlay.cpp b/Source/core/inspector/InspectorOverlay.cpp
index 8ede7d22ea0c93f336fca63139b8d0acabc1bc26..596ce39818398bdc034264e452d86c108110b875 100644
--- a/Source/core/inspector/InspectorOverlay.cpp
+++ b/Source/core/inspector/InspectorOverlay.cpp
@@ -315,8 +315,12 @@ static void buildNodeHighlight(Node& node, const HighlightConfig& highlightConfi
if (renderer->node() && renderer->node()->isSVGElement() && !renderer->isSVGRoot()) {
Vector<FloatQuad> quads;
renderer->absoluteQuads(quads);
- for (size_t i = 0; i < quads.size(); ++i)
+ FrameView* containingView = renderer->frameView();
+ for (size_t i = 0; i < quads.size(); ++i) {
+ if (containingView)
+ contentsQuadToScreen(containingView, quads[i]);
highlight->appendQuad(quads[i], highlightConfig.content, highlightConfig.contentOutline);
+ }
return;
}
@@ -833,6 +837,19 @@ bool InspectorOverlay::getBoxModel(Node* node, RefPtr<TypeBuilder::DOM::BoxModel
return true;
}
+String InspectorOverlay::getHighlightJSONForNode(Node* node)
caseq 2014/10/24 13:31:44 Can we return JSONObject for better reuse? It's ne
dgozman 2014/10/24 14:45:21 Done.
+{
+ HighlightConfig config;
caseq 2014/10/24 13:31:44 So we end up with a set of path that are all the s
dgozman 2014/10/24 14:45:21 Nice idea! Done.
+ config.showInfo = true;
+ config.showRulers = true;
+ config.showExtensionLines = true;
+ Highlight highlight;
+ appendPathsForShapeOutside(highlight, config, node);
+ buildNodeHighlight(*node, config, &highlight);
+ RefPtr<JSONObject> json(highlight.asJSONObject());
+ return json->toPrettyJSONString();
+}
+
void InspectorOverlay::freePage()
{
if (m_overlayPage) {

Powered by Google App Engine
This is Rietveld 408576698