OLD | NEW |
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 1393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1404 .setWidth(modelObject ? adjustForAbsoluteZoom(modelObject->pixelSnappedO
ffsetWidth(), modelObject) : boundingBox.width()) | 1404 .setWidth(modelObject ? adjustForAbsoluteZoom(modelObject->pixelSnappedO
ffsetWidth(), modelObject) : boundingBox.width()) |
1405 .setHeight(modelObject ? adjustForAbsoluteZoom(modelObject->pixelSnapped
OffsetHeight(), modelObject) : boundingBox.height()); | 1405 .setHeight(modelObject ? adjustForAbsoluteZoom(modelObject->pixelSnapped
OffsetHeight(), modelObject) : boundingBox.height()); |
1406 if (shapeOutsideInfo) | 1406 if (shapeOutsideInfo) |
1407 model->setShapeOutside(shapeOutsideInfo); | 1407 model->setShapeOutside(shapeOutsideInfo); |
1408 } | 1408 } |
1409 | 1409 |
1410 void InspectorDOMAgent::getNodeForLocation(ErrorString* errorString, int x, int
y, int* nodeId) | 1410 void InspectorDOMAgent::getNodeForLocation(ErrorString* errorString, int x, int
y, int* nodeId) |
1411 { | 1411 { |
1412 if (!pushDocumentUponHandlelessOperation(errorString)) | 1412 if (!pushDocumentUponHandlelessOperation(errorString)) |
1413 return; | 1413 return; |
1414 | 1414 HitTestRequest request(HitTestRequest::Move | HitTestRequest::ReadOnly | Hit
TestRequest::AllowChildFrameContent); |
1415 Node* node = hoveredNodeForPoint(m_document->frame(), IntPoint(x, y), false)
; | 1415 HitTestResult result(IntPoint(x, y)); |
| 1416 m_document->frame()->contentRenderer()->hitTest(request, result); |
| 1417 Node* node = result.innerPossiblyPseudoNode(); |
| 1418 while (node && node->nodeType() == Node::TEXT_NODE) |
| 1419 node = node->parentNode(); |
1416 if (!node) { | 1420 if (!node) { |
1417 *errorString = "No node found at given location"; | 1421 *errorString = "No node found at given location"; |
1418 return; | 1422 return; |
1419 } | 1423 } |
1420 *nodeId = pushNodePathToFrontend(node); | 1424 *nodeId = pushNodePathToFrontend(node); |
1421 } | 1425 } |
1422 | 1426 |
1423 void InspectorDOMAgent::resolveNode(ErrorString* errorString, int nodeId, const
String* const objectGroup, RefPtr<TypeBuilder::Runtime::RemoteObject>& result) | 1427 void InspectorDOMAgent::resolveNode(ErrorString* errorString, int nodeId, const
String* const objectGroup, RefPtr<TypeBuilder::Runtime::RemoteObject>& result) |
1424 { | 1428 { |
1425 String objectGroupName = objectGroup ? *objectGroup : ""; | 1429 String objectGroupName = objectGroup ? *objectGroup : ""; |
(...skipping 675 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2101 if (!m_documentNodeToIdMap->contains(m_document.get())) { | 2105 if (!m_documentNodeToIdMap->contains(m_document.get())) { |
2102 RefPtr<TypeBuilder::DOM::Node> root; | 2106 RefPtr<TypeBuilder::DOM::Node> root; |
2103 getDocument(errorString, root); | 2107 getDocument(errorString, root); |
2104 return errorString->isEmpty(); | 2108 return errorString->isEmpty(); |
2105 } | 2109 } |
2106 return true; | 2110 return true; |
2107 } | 2111 } |
2108 | 2112 |
2109 } // namespace WebCore | 2113 } // namespace WebCore |
2110 | 2114 |
OLD | NEW |