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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 | 151 |
152 return true; | 152 return true; |
153 } | 153 } |
154 | 154 |
155 static Node* hoveredNodeForPoint(LocalFrame* frame, const IntPoint& pointInRootF
rame, bool ignorePointerEventsNone) | 155 static Node* hoveredNodeForPoint(LocalFrame* frame, const IntPoint& pointInRootF
rame, bool ignorePointerEventsNone) |
156 { | 156 { |
157 HitTestRequest::HitTestRequestType hitType = HitTestRequest::Move | HitTestR
equest::ReadOnly | HitTestRequest::AllowChildFrameContent; | 157 HitTestRequest::HitTestRequestType hitType = HitTestRequest::Move | HitTestR
equest::ReadOnly | HitTestRequest::AllowChildFrameContent; |
158 if (ignorePointerEventsNone) | 158 if (ignorePointerEventsNone) |
159 hitType |= HitTestRequest::IgnorePointerEventsNone; | 159 hitType |= HitTestRequest::IgnorePointerEventsNone; |
160 HitTestRequest request(hitType); | 160 HitTestRequest request(hitType); |
161 HitTestResult result(frame->view()->rootFrameToContents(pointInRootFrame)); | 161 HitTestResult result(request, frame->view()->rootFrameToContents(pointInRoot
Frame)); |
162 frame->contentRenderer()->hitTest(request, result); | 162 frame->contentRenderer()->hitTest(result); |
163 Node* node = result.innerPossiblyPseudoNode(); | 163 Node* node = result.innerPossiblyPseudoNode(); |
164 while (node && node->nodeType() == Node::TEXT_NODE) | 164 while (node && node->nodeType() == Node::TEXT_NODE) |
165 node = node->parentNode(); | 165 node = node->parentNode(); |
166 return node; | 166 return node; |
167 } | 167 } |
168 | 168 |
169 static Node* hoveredNodeForEvent(LocalFrame* frame, const PlatformGestureEvent&
event, bool ignorePointerEventsNone) | 169 static Node* hoveredNodeForEvent(LocalFrame* frame, const PlatformGestureEvent&
event, bool ignorePointerEventsNone) |
170 { | 170 { |
171 return hoveredNodeForPoint(frame, event.position(), ignorePointerEventsNone)
; | 171 return hoveredNodeForPoint(frame, event.position(), ignorePointerEventsNone)
; |
172 } | 172 } |
(...skipping 1353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1526 bool result = InspectorHighlight::getBoxModel(node, model); | 1526 bool result = InspectorHighlight::getBoxModel(node, model); |
1527 if (!result) | 1527 if (!result) |
1528 *errorString = "Could not compute box model."; | 1528 *errorString = "Could not compute box model."; |
1529 } | 1529 } |
1530 | 1530 |
1531 void InspectorDOMAgent::getNodeForLocation(ErrorString* errorString, int x, int
y, int* nodeId) | 1531 void InspectorDOMAgent::getNodeForLocation(ErrorString* errorString, int x, int
y, int* nodeId) |
1532 { | 1532 { |
1533 if (!pushDocumentUponHandlelessOperation(errorString)) | 1533 if (!pushDocumentUponHandlelessOperation(errorString)) |
1534 return; | 1534 return; |
1535 HitTestRequest request(HitTestRequest::Move | HitTestRequest::ReadOnly | Hit
TestRequest::AllowChildFrameContent); | 1535 HitTestRequest request(HitTestRequest::Move | HitTestRequest::ReadOnly | Hit
TestRequest::AllowChildFrameContent); |
1536 HitTestResult result(IntPoint(x, y)); | 1536 HitTestResult result(request, IntPoint(x, y)); |
1537 m_document->frame()->contentRenderer()->hitTest(request, result); | 1537 m_document->frame()->contentRenderer()->hitTest(result); |
1538 Node* node = result.innerPossiblyPseudoNode(); | 1538 Node* node = result.innerPossiblyPseudoNode(); |
1539 while (node && node->nodeType() == Node::TEXT_NODE) | 1539 while (node && node->nodeType() == Node::TEXT_NODE) |
1540 node = node->parentNode(); | 1540 node = node->parentNode(); |
1541 if (!node) { | 1541 if (!node) { |
1542 *errorString = "No node found at given location"; | 1542 *errorString = "No node found at given location"; |
1543 return; | 1543 return; |
1544 } | 1544 } |
1545 *nodeId = pushNodePathToFrontend(node); | 1545 *nodeId = pushNodePathToFrontend(node); |
1546 } | 1546 } |
1547 | 1547 |
(...skipping 751 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2299 visitor->trace(m_searchResults); | 2299 visitor->trace(m_searchResults); |
2300 #endif | 2300 #endif |
2301 visitor->trace(m_hoveredNodeForInspectMode); | 2301 visitor->trace(m_hoveredNodeForInspectMode); |
2302 visitor->trace(m_history); | 2302 visitor->trace(m_history); |
2303 visitor->trace(m_domEditor); | 2303 visitor->trace(m_domEditor); |
2304 visitor->trace(m_listener); | 2304 visitor->trace(m_listener); |
2305 InspectorBaseAgent::trace(visitor); | 2305 InspectorBaseAgent::trace(visitor); |
2306 } | 2306 } |
2307 | 2307 |
2308 } // namespace blink | 2308 } // namespace blink |
OLD | NEW |