| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 | 69 |
| 70 SmartClip::SmartClip(LocalFrame* frame) : m_frame(frame) {} | 70 SmartClip::SmartClip(LocalFrame* frame) : m_frame(frame) {} |
| 71 | 71 |
| 72 SmartClipData SmartClip::dataForRect(const IntRect& cropRectInViewport) { | 72 SmartClipData SmartClip::dataForRect(const IntRect& cropRectInViewport) { |
| 73 Node* bestNode = | 73 Node* bestNode = |
| 74 findBestOverlappingNode(m_frame->document(), cropRectInViewport); | 74 findBestOverlappingNode(m_frame->document(), cropRectInViewport); |
| 75 if (!bestNode) | 75 if (!bestNode) |
| 76 return SmartClipData(); | 76 return SmartClipData(); |
| 77 | 77 |
| 78 if (Node* nodeFromFrame = nodeInsideFrame(bestNode)) { | 78 if (Node* nodeFromFrame = nodeInsideFrame(bestNode)) { |
| 79 // FIXME: This code only hit-tests a single iframe. It seems like we ought s
upport nested frames. | 79 // FIXME: This code only hit-tests a single iframe. It seems like we ought |
| 80 // support nested frames. |
| 80 if (Node* bestNodeInFrame = | 81 if (Node* bestNodeInFrame = |
| 81 findBestOverlappingNode(nodeFromFrame, cropRectInViewport)) | 82 findBestOverlappingNode(nodeFromFrame, cropRectInViewport)) |
| 82 bestNode = bestNodeInFrame; | 83 bestNode = bestNodeInFrame; |
| 83 } | 84 } |
| 84 | 85 |
| 85 HeapVector<Member<Node>> hitNodes; | 86 HeapVector<Member<Node>> hitNodes; |
| 86 collectOverlappingChildNodes(bestNode, cropRectInViewport, hitNodes); | 87 collectOverlappingChildNodes(bestNode, cropRectInViewport, hitNodes); |
| 87 | 88 |
| 88 if (hitNodes.isEmpty() || hitNodes.size() == bestNode->countChildren()) { | 89 if (hitNodes.isEmpty() || hitNodes.size() == bestNode->countChildren()) { |
| 89 hitNodes.clear(); | 90 hitNodes.clear(); |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 | 263 |
| 263 result.append(nodeValue); | 264 result.append(nodeValue); |
| 264 } | 265 } |
| 265 } | 266 } |
| 266 } | 267 } |
| 267 | 268 |
| 268 return result.toString(); | 269 return result.toString(); |
| 269 } | 270 } |
| 270 | 271 |
| 271 } // namespace blink | 272 } // namespace blink |
| OLD | NEW |