| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2008, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2008, 2011 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies) | 3 * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies) |
| 4 * | 4 * |
| 5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
| 6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
| 7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
| 8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
| 9 * | 9 * |
| 10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 #include "sky/engine/core/dom/DocumentMarkerController.h" | 26 #include "sky/engine/core/dom/DocumentMarkerController.h" |
| 27 #include "sky/engine/core/dom/NodeRenderingTraversal.h" | 27 #include "sky/engine/core/dom/NodeRenderingTraversal.h" |
| 28 #include "sky/engine/core/dom/shadow/ShadowRoot.h" | 28 #include "sky/engine/core/dom/shadow/ShadowRoot.h" |
| 29 #include "sky/engine/core/editing/FrameSelection.h" | 29 #include "sky/engine/core/editing/FrameSelection.h" |
| 30 #include "sky/engine/core/fetch/ImageResource.h" | 30 #include "sky/engine/core/fetch/ImageResource.h" |
| 31 #include "sky/engine/core/frame/LocalFrame.h" | 31 #include "sky/engine/core/frame/LocalFrame.h" |
| 32 #include "sky/engine/core/html/HTMLAnchorElement.h" | 32 #include "sky/engine/core/html/HTMLAnchorElement.h" |
| 33 #include "sky/engine/core/html/HTMLImageElement.h" | 33 #include "sky/engine/core/html/HTMLImageElement.h" |
| 34 #include "sky/engine/core/html/parser/HTMLParserIdioms.h" | 34 #include "sky/engine/core/html/parser/HTMLParserIdioms.h" |
| 35 #include "sky/engine/core/rendering/RenderImage.h" | 35 #include "sky/engine/core/rendering/RenderImage.h" |
| 36 #include "sky/engine/platform/scroll/Scrollbar.h" | |
| 37 | 36 |
| 38 namespace blink { | 37 namespace blink { |
| 39 | 38 |
| 40 HitTestResult::HitTestResult() | 39 HitTestResult::HitTestResult() |
| 41 : m_isOverWidget(false) | 40 : m_isOverWidget(false) |
| 42 { | 41 { |
| 43 } | 42 } |
| 44 | 43 |
| 45 HitTestResult::HitTestResult(const LayoutPoint& point) | 44 HitTestResult::HitTestResult(const LayoutPoint& point) |
| 46 : m_hitTestLocation(point) | 45 : m_hitTestLocation(point) |
| (...skipping 17 matching lines...) Expand all Loading... |
| 64 } | 63 } |
| 65 | 64 |
| 66 HitTestResult::HitTestResult(const HitTestResult& other) | 65 HitTestResult::HitTestResult(const HitTestResult& other) |
| 67 : m_hitTestLocation(other.m_hitTestLocation) | 66 : m_hitTestLocation(other.m_hitTestLocation) |
| 68 , m_innerNode(other.innerNode()) | 67 , m_innerNode(other.innerNode()) |
| 69 , m_innerPossiblyPseudoNode(other.m_innerPossiblyPseudoNode) | 68 , m_innerPossiblyPseudoNode(other.m_innerPossiblyPseudoNode) |
| 70 , m_innerNonSharedNode(other.innerNonSharedNode()) | 69 , m_innerNonSharedNode(other.innerNonSharedNode()) |
| 71 , m_pointInInnerNodeFrame(other.m_pointInInnerNodeFrame) | 70 , m_pointInInnerNodeFrame(other.m_pointInInnerNodeFrame) |
| 72 , m_localPoint(other.localPoint()) | 71 , m_localPoint(other.localPoint()) |
| 73 , m_innerURLElement(other.URLElement()) | 72 , m_innerURLElement(other.URLElement()) |
| 74 , m_scrollbar(other.scrollbar()) | |
| 75 , m_isOverWidget(other.isOverWidget()) | 73 , m_isOverWidget(other.isOverWidget()) |
| 76 { | 74 { |
| 77 // Only copy the NodeSet in case of rect hit test. | 75 // Only copy the NodeSet in case of rect hit test. |
| 78 m_rectBasedTestResult = adoptPtr(other.m_rectBasedTestResult ? new NodeSet(*
other.m_rectBasedTestResult) : 0); | 76 m_rectBasedTestResult = adoptPtr(other.m_rectBasedTestResult ? new NodeSet(*
other.m_rectBasedTestResult) : 0); |
| 79 } | 77 } |
| 80 | 78 |
| 81 HitTestResult::~HitTestResult() | 79 HitTestResult::~HitTestResult() |
| 82 { | 80 { |
| 83 } | 81 } |
| 84 | 82 |
| 85 HitTestResult& HitTestResult::operator=(const HitTestResult& other) | 83 HitTestResult& HitTestResult::operator=(const HitTestResult& other) |
| 86 { | 84 { |
| 87 m_hitTestLocation = other.m_hitTestLocation; | 85 m_hitTestLocation = other.m_hitTestLocation; |
| 88 m_innerNode = other.innerNode(); | 86 m_innerNode = other.innerNode(); |
| 89 m_innerPossiblyPseudoNode = other.innerPossiblyPseudoNode(); | 87 m_innerPossiblyPseudoNode = other.innerPossiblyPseudoNode(); |
| 90 m_innerNonSharedNode = other.innerNonSharedNode(); | 88 m_innerNonSharedNode = other.innerNonSharedNode(); |
| 91 m_pointInInnerNodeFrame = other.m_pointInInnerNodeFrame; | 89 m_pointInInnerNodeFrame = other.m_pointInInnerNodeFrame; |
| 92 m_localPoint = other.localPoint(); | 90 m_localPoint = other.localPoint(); |
| 93 m_innerURLElement = other.URLElement(); | 91 m_innerURLElement = other.URLElement(); |
| 94 m_scrollbar = other.scrollbar(); | |
| 95 m_isOverWidget = other.isOverWidget(); | 92 m_isOverWidget = other.isOverWidget(); |
| 96 | 93 |
| 97 // Only copy the NodeSet in case of rect hit test. | 94 // Only copy the NodeSet in case of rect hit test. |
| 98 m_rectBasedTestResult = adoptPtr(other.m_rectBasedTestResult ? new NodeSet(*
other.m_rectBasedTestResult) : 0); | 95 m_rectBasedTestResult = adoptPtr(other.m_rectBasedTestResult ? new NodeSet(*
other.m_rectBasedTestResult) : 0); |
| 99 | 96 |
| 100 return *this; | 97 return *this; |
| 101 } | 98 } |
| 102 | 99 |
| 103 PositionWithAffinity HitTestResult::position() const | 100 PositionWithAffinity HitTestResult::position() const |
| 104 { | 101 { |
| (...skipping 21 matching lines...) Expand all Loading... |
| 126 void HitTestResult::setInnerNonSharedNode(Node* n) | 123 void HitTestResult::setInnerNonSharedNode(Node* n) |
| 127 { | 124 { |
| 128 m_innerNonSharedNode = n; | 125 m_innerNonSharedNode = n; |
| 129 } | 126 } |
| 130 | 127 |
| 131 void HitTestResult::setURLElement(Element* n) | 128 void HitTestResult::setURLElement(Element* n) |
| 132 { | 129 { |
| 133 m_innerURLElement = n; | 130 m_innerURLElement = n; |
| 134 } | 131 } |
| 135 | 132 |
| 136 void HitTestResult::setScrollbar(Scrollbar* s) | |
| 137 { | |
| 138 m_scrollbar = s; | |
| 139 } | |
| 140 | |
| 141 LocalFrame* HitTestResult::innerNodeFrame() const | 133 LocalFrame* HitTestResult::innerNodeFrame() const |
| 142 { | 134 { |
| 143 if (m_innerNonSharedNode) | 135 if (m_innerNonSharedNode) |
| 144 return m_innerNonSharedNode->document().frame(); | 136 return m_innerNonSharedNode->document().frame(); |
| 145 if (m_innerNode) | 137 if (m_innerNode) |
| 146 return m_innerNode->document().frame(); | 138 return m_innerNode->document().frame(); |
| 147 return 0; | 139 return 0; |
| 148 } | 140 } |
| 149 | 141 |
| 150 bool HitTestResult::isSelected() const | 142 bool HitTestResult::isSelected() const |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 mutableRectBasedTestResult().add(node); | 278 mutableRectBasedTestResult().add(node); |
| 287 | 279 |
| 288 bool regionFilled = rect.contains(locationInContainer.boundingBox()); | 280 bool regionFilled = rect.contains(locationInContainer.boundingBox()); |
| 289 return !regionFilled; | 281 return !regionFilled; |
| 290 } | 282 } |
| 291 | 283 |
| 292 void HitTestResult::append(const HitTestResult& other) | 284 void HitTestResult::append(const HitTestResult& other) |
| 293 { | 285 { |
| 294 ASSERT(isRectBasedTest() && other.isRectBasedTest()); | 286 ASSERT(isRectBasedTest() && other.isRectBasedTest()); |
| 295 | 287 |
| 296 if (!m_scrollbar && other.scrollbar()) { | |
| 297 setScrollbar(other.scrollbar()); | |
| 298 } | |
| 299 | |
| 300 if (!m_innerNode && other.innerNode()) { | 288 if (!m_innerNode && other.innerNode()) { |
| 301 m_innerNode = other.innerNode(); | 289 m_innerNode = other.innerNode(); |
| 302 m_innerPossiblyPseudoNode = other.innerPossiblyPseudoNode(); | 290 m_innerPossiblyPseudoNode = other.innerPossiblyPseudoNode(); |
| 303 m_innerNonSharedNode = other.innerNonSharedNode(); | 291 m_innerNonSharedNode = other.innerNonSharedNode(); |
| 304 m_localPoint = other.localPoint(); | 292 m_localPoint = other.localPoint(); |
| 305 m_pointInInnerNodeFrame = other.m_pointInInnerNodeFrame; | 293 m_pointInInnerNodeFrame = other.m_pointInInnerNodeFrame; |
| 306 m_innerURLElement = other.URLElement(); | 294 m_innerURLElement = other.URLElement(); |
| 307 m_isOverWidget = other.isOverWidget(); | 295 m_isOverWidget = other.isOverWidget(); |
| 308 } | 296 } |
| 309 | 297 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 346 { | 334 { |
| 347 for (Node* node = m_innerNode.get(); node; node = NodeRenderingTraversal::pa
rent(node)) { | 335 for (Node* node = m_innerNode.get(); node; node = NodeRenderingTraversal::pa
rent(node)) { |
| 348 if (node->isElementNode()) | 336 if (node->isElementNode()) |
| 349 return toElement(node); | 337 return toElement(node); |
| 350 } | 338 } |
| 351 | 339 |
| 352 return 0; | 340 return 0; |
| 353 } | 341 } |
| 354 | 342 |
| 355 } // namespace blink | 343 } // namespace blink |
| OLD | NEW |