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

Side by Side Diff: Source/core/inspector/InspectorDOMAgent.cpp

Issue 237313003: CSS shapes support in Web Inspector (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Code review comments Created 6 years, 7 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2009 Apple Inc. All rights reserved.
3 * Copyright (C) 2011 Google Inc. All rights reserved. 3 * Copyright (C) 2011 Google Inc. All rights reserved.
4 * Copyright (C) 2009 Joseph Pecoraro 4 * Copyright (C) 2009 Joseph Pecoraro
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 9 *
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 1379 matching lines...) Expand 10 before | Expand all | Expand 10 after
1390 *errorString = "Could not compute box model."; 1390 *errorString = "Could not compute box model.";
1391 return; 1391 return;
1392 } 1392 }
1393 1393
1394 RenderObject* renderer = node->renderer(); 1394 RenderObject* renderer = node->renderer();
1395 LocalFrame* frame = node->document().frame(); 1395 LocalFrame* frame = node->document().frame();
1396 FrameView* view = frame->view(); 1396 FrameView* view = frame->view();
1397 1397
1398 IntRect boundingBox = pixelSnappedIntRect(view->contentsToRootView(renderer- >absoluteBoundingBoxRect())); 1398 IntRect boundingBox = pixelSnappedIntRect(view->contentsToRootView(renderer- >absoluteBoundingBoxRect()));
1399 RenderBoxModelObject* modelObject = renderer->isBoxModelObject() ? toRenderB oxModelObject(renderer) : 0; 1399 RenderBoxModelObject* modelObject = renderer->isBoxModelObject() ? toRenderB oxModelObject(renderer) : 0;
1400 RefPtr<TypeBuilder::DOM::ShapeOutsideInfo> shapeOutsideInfo = m_overlay->bui ldObjectForShapeOutside(node);
1400 1401
1401 model = TypeBuilder::DOM::BoxModel::create() 1402 model = TypeBuilder::DOM::BoxModel::create()
1402 .setContent(buildArrayForQuad(quads.at(3))) 1403 .setContent(buildArrayForQuad(quads.at(3)))
1403 .setPadding(buildArrayForQuad(quads.at(2))) 1404 .setPadding(buildArrayForQuad(quads.at(2)))
1404 .setBorder(buildArrayForQuad(quads.at(1))) 1405 .setBorder(buildArrayForQuad(quads.at(1)))
1405 .setMargin(buildArrayForQuad(quads.at(0))) 1406 .setMargin(buildArrayForQuad(quads.at(0)))
1406 .setWidth(modelObject ? adjustForAbsoluteZoom(modelObject->pixelSnappedO ffsetWidth(), modelObject) : boundingBox.width()) 1407 .setWidth(modelObject ? adjustForAbsoluteZoom(modelObject->pixelSnappedO ffsetWidth(), modelObject) : boundingBox.width())
1407 .setHeight(modelObject ? adjustForAbsoluteZoom(modelObject->pixelSnapped OffsetHeight(), modelObject) : boundingBox.height()); 1408 .setHeight(modelObject ? adjustForAbsoluteZoom(modelObject->pixelSnapped OffsetHeight(), modelObject) : boundingBox.height());
1409 if (shapeOutsideInfo)
1410 model->setShapeOutside(shapeOutsideInfo);
1408 } 1411 }
1409 1412
1410 void InspectorDOMAgent::getNodeForLocation(ErrorString* errorString, int x, int y, int* nodeId) 1413 void InspectorDOMAgent::getNodeForLocation(ErrorString* errorString, int x, int y, int* nodeId)
1411 { 1414 {
1412 if (!pushDocumentUponHandlelessOperation(errorString)) 1415 if (!pushDocumentUponHandlelessOperation(errorString))
1413 return; 1416 return;
1414 1417
1415 Node* node = hoveredNodeForPoint(m_document->frame(), IntPoint(x, y), false) ; 1418 Node* node = hoveredNodeForPoint(m_document->frame(), IntPoint(x, y), false) ;
1416 if (!node) { 1419 if (!node) {
1417 *errorString = "No node found at given location"; 1420 *errorString = "No node found at given location";
(...skipping 684 matching lines...) Expand 10 before | Expand all | Expand 10 after
2102 if (!m_documentNodeToIdMap.contains(m_document)) { 2105 if (!m_documentNodeToIdMap.contains(m_document)) {
2103 RefPtr<TypeBuilder::DOM::Node> root; 2106 RefPtr<TypeBuilder::DOM::Node> root;
2104 getDocument(errorString, root); 2107 getDocument(errorString, root);
2105 return errorString->isEmpty(); 2108 return errorString->isEmpty();
2106 } 2109 }
2107 return true; 2110 return true;
2108 } 2111 }
2109 2112
2110 } // namespace WebCore 2113 } // namespace WebCore
2111 2114
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698