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

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: Fixed review comments 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
« no previous file with comments | « Source/core/inspector/InspectorOverlay.h ('k') | Source/core/testing/Internals.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/inspector/InspectorOverlay.cpp
diff --git a/Source/core/inspector/InspectorOverlay.cpp b/Source/core/inspector/InspectorOverlay.cpp
index 8ede7d22ea0c93f336fca63139b8d0acabc1bc26..32016f3b1f56f21c13adb4c2c7a4e42263f4ecd1 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,26 @@ bool InspectorOverlay::getBoxModel(Node* node, RefPtr<TypeBuilder::DOM::BoxModel
return true;
}
+PassRefPtr<JSONObject> InspectorOverlay::highlightJSONForNode(Node* node)
+{
+ HighlightConfig config;
+ config.content = Color(255, 0, 0, 0);
+ config.contentOutline = Color(128, 0, 0, 0);
+ config.padding = Color(0, 255, 0, 0);
+ config.border = Color(0, 0, 255, 0);
+ config.margin = Color(255, 255, 255, 0);
+ config.eventTarget = Color(128, 128, 128, 0);
+ config.shape = Color(0, 0, 0, 0);
+ config.shapeMargin = Color(128, 128, 128, 0);
+ config.showInfo = true;
+ config.showRulers = true;
+ config.showExtensionLines = true;
+ Highlight highlight;
+ appendPathsForShapeOutside(highlight, config, node);
+ buildNodeHighlight(*node, config, &highlight);
+ return highlight.asJSONObject();
+}
+
void InspectorOverlay::freePage()
{
if (m_overlayPage) {
« no previous file with comments | « Source/core/inspector/InspectorOverlay.h ('k') | Source/core/testing/Internals.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698