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

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

Issue 430463002: DevTools: highlight page regions as paths, not quads (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: review comments addressed Created 6 years, 5 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 | « no previous file | Source/core/inspector/InspectorOverlay.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/inspector/InspectorDOMAgent.cpp
diff --git a/Source/core/inspector/InspectorDOMAgent.cpp b/Source/core/inspector/InspectorDOMAgent.cpp
index d72daf6c3bd4abea1a8986d509ce720b5309dd99..ba9d8aead3030442c29949a76e6eb5c5fb776795 100644
--- a/Source/core/inspector/InspectorDOMAgent.cpp
+++ b/Source/core/inspector/InspectorDOMAgent.cpp
@@ -1234,6 +1234,9 @@ PassOwnPtr<HighlightConfig> InspectorDOMAgent::highlightConfigFromInspectorObjec
highlightConfig->border = parseConfigColor("borderColor", highlightInspectorObject);
highlightConfig->margin = parseConfigColor("marginColor", highlightInspectorObject);
highlightConfig->eventTarget = parseConfigColor("eventTargetColor", highlightInspectorObject);
+ highlightConfig->shape = parseConfigColor("shapeColor", highlightInspectorObject);
+ highlightConfig->shapeMargin = parseConfigColor("shapeMarginColor", highlightInspectorObject);
+
return highlightConfig.release();
}
@@ -1430,50 +1433,16 @@ void InspectorDOMAgent::setFileInputFiles(ErrorString* errorString, int nodeId,
toHTMLInputElement(node)->setFiles(fileList);
}
-static RefPtr<TypeBuilder::Array<double> > buildArrayForQuad(const FloatQuad& quad)
-{
- RefPtr<TypeBuilder::Array<double> > array = TypeBuilder::Array<double>::create();
- array->addItem(quad.p1().x());
- array->addItem(quad.p1().y());
- array->addItem(quad.p2().x());
- array->addItem(quad.p2().y());
- array->addItem(quad.p3().x());
- array->addItem(quad.p3().y());
- array->addItem(quad.p4().x());
- array->addItem(quad.p4().y());
- return array.release();
-}
-
void InspectorDOMAgent::getBoxModel(ErrorString* errorString, int nodeId, RefPtr<TypeBuilder::DOM::BoxModel>& model)
{
Node* node = assertNode(errorString, nodeId);
if (!node)
return;
- Vector<FloatQuad> quads;
- bool isInlineOrBox = m_overlay->getBoxModel(node, &quads);
- if (!isInlineOrBox) {
+ bool result = m_overlay->getBoxModel(node, model);
+ if (!result)
*errorString = "Could not compute box model.";
- return;
- }
- RenderObject* renderer = node->renderer();
- LocalFrame* frame = node->document().frame();
- FrameView* view = frame->view();
-
- IntRect boundingBox = pixelSnappedIntRect(view->contentsToRootView(renderer->absoluteBoundingBoxRect()));
- RenderBoxModelObject* modelObject = renderer->isBoxModelObject() ? toRenderBoxModelObject(renderer) : 0;
- RefPtr<TypeBuilder::DOM::ShapeOutsideInfo> shapeOutsideInfo = m_overlay->buildObjectForShapeOutside(node);
-
- model = TypeBuilder::DOM::BoxModel::create()
- .setContent(buildArrayForQuad(quads.at(3)))
- .setPadding(buildArrayForQuad(quads.at(2)))
- .setBorder(buildArrayForQuad(quads.at(1)))
- .setMargin(buildArrayForQuad(quads.at(0)))
- .setWidth(modelObject ? adjustForAbsoluteZoom(modelObject->pixelSnappedOffsetWidth(), modelObject) : boundingBox.width())
- .setHeight(modelObject ? adjustForAbsoluteZoom(modelObject->pixelSnappedOffsetHeight(), modelObject) : boundingBox.height());
- if (shapeOutsideInfo)
- model->setShapeOutside(shapeOutsideInfo);
}
void InspectorDOMAgent::getNodeForLocation(ErrorString* errorString, int x, int y, int* nodeId)
« no previous file with comments | « no previous file | Source/core/inspector/InspectorOverlay.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698