| 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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 , m_cacheable(other.m_cacheable) | 89 , m_cacheable(other.m_cacheable) |
| 90 , m_innerNode(other.innerNode()) | 90 , m_innerNode(other.innerNode()) |
| 91 , m_innerPossiblyPseudoNode(other.m_innerPossiblyPseudoNode) | 91 , m_innerPossiblyPseudoNode(other.m_innerPossiblyPseudoNode) |
| 92 , m_pointInInnerNodeFrame(other.m_pointInInnerNodeFrame) | 92 , m_pointInInnerNodeFrame(other.m_pointInInnerNodeFrame) |
| 93 , m_localPoint(other.localPoint()) | 93 , m_localPoint(other.localPoint()) |
| 94 , m_innerURLElement(other.URLElement()) | 94 , m_innerURLElement(other.URLElement()) |
| 95 , m_scrollbar(other.scrollbar()) | 95 , m_scrollbar(other.scrollbar()) |
| 96 , m_isOverWidget(other.isOverWidget()) | 96 , m_isOverWidget(other.isOverWidget()) |
| 97 { | 97 { |
| 98 // Only copy the NodeSet in case of list hit test. | 98 // Only copy the NodeSet in case of list hit test. |
| 99 m_listBasedTestResult = adoptPtrWillBeNoop(other.m_listBasedTestResult ? new
NodeSet(*other.m_listBasedTestResult) : 0); | 99 m_listBasedTestResult = (other.m_listBasedTestResult ? new NodeSet(*other.m_
listBasedTestResult) : 0); |
| 100 } | 100 } |
| 101 | 101 |
| 102 HitTestResult::~HitTestResult() | 102 HitTestResult::~HitTestResult() |
| 103 { | 103 { |
| 104 } | 104 } |
| 105 | 105 |
| 106 HitTestResult& HitTestResult::operator=(const HitTestResult& other) | 106 HitTestResult& HitTestResult::operator=(const HitTestResult& other) |
| 107 { | 107 { |
| 108 m_hitTestLocation = other.m_hitTestLocation; | 108 m_hitTestLocation = other.m_hitTestLocation; |
| 109 m_hitTestRequest = other.m_hitTestRequest; | 109 m_hitTestRequest = other.m_hitTestRequest; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 135 m_innerNode = other.innerNode(); | 135 m_innerNode = other.innerNode(); |
| 136 m_innerPossiblyPseudoNode = other.innerPossiblyPseudoNode(); | 136 m_innerPossiblyPseudoNode = other.innerPossiblyPseudoNode(); |
| 137 m_pointInInnerNodeFrame = other.m_pointInInnerNodeFrame; | 137 m_pointInInnerNodeFrame = other.m_pointInInnerNodeFrame; |
| 138 m_localPoint = other.localPoint(); | 138 m_localPoint = other.localPoint(); |
| 139 m_innerURLElement = other.URLElement(); | 139 m_innerURLElement = other.URLElement(); |
| 140 m_scrollbar = other.scrollbar(); | 140 m_scrollbar = other.scrollbar(); |
| 141 m_isOverWidget = other.isOverWidget(); | 141 m_isOverWidget = other.isOverWidget(); |
| 142 m_cacheable = other.m_cacheable; | 142 m_cacheable = other.m_cacheable; |
| 143 | 143 |
| 144 // Only copy the NodeSet in case of list hit test. | 144 // Only copy the NodeSet in case of list hit test. |
| 145 m_listBasedTestResult = adoptPtrWillBeNoop(other.m_listBasedTestResult ? new
NodeSet(*other.m_listBasedTestResult) : 0); | 145 m_listBasedTestResult = (other.m_listBasedTestResult ? new NodeSet(*other.m_
listBasedTestResult) : 0); |
| 146 } | 146 } |
| 147 | 147 |
| 148 DEFINE_TRACE(HitTestResult) | 148 DEFINE_TRACE(HitTestResult) |
| 149 { | 149 { |
| 150 visitor->trace(m_innerNode); | 150 visitor->trace(m_innerNode); |
| 151 visitor->trace(m_innerPossiblyPseudoNode); | 151 visitor->trace(m_innerPossiblyPseudoNode); |
| 152 visitor->trace(m_innerURLElement); | 152 visitor->trace(m_innerURLElement); |
| 153 visitor->trace(m_scrollbar); | 153 visitor->trace(m_scrollbar); |
| 154 #if ENABLE(OILPAN) | 154 #if ENABLE(OILPAN) |
| 155 visitor->trace(m_listBasedTestResult); | 155 visitor->trace(m_listBasedTestResult); |
| (...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 485 if (other.m_listBasedTestResult) { | 485 if (other.m_listBasedTestResult) { |
| 486 NodeSet& set = mutableListBasedTestResult(); | 486 NodeSet& set = mutableListBasedTestResult(); |
| 487 for (NodeSet::const_iterator it = other.m_listBasedTestResult->begin(),
last = other.m_listBasedTestResult->end(); it != last; ++it) | 487 for (NodeSet::const_iterator it = other.m_listBasedTestResult->begin(),
last = other.m_listBasedTestResult->end(); it != last; ++it) |
| 488 set.add(it->get()); | 488 set.add(it->get()); |
| 489 } | 489 } |
| 490 } | 490 } |
| 491 | 491 |
| 492 const HitTestResult::NodeSet& HitTestResult::listBasedTestResult() const | 492 const HitTestResult::NodeSet& HitTestResult::listBasedTestResult() const |
| 493 { | 493 { |
| 494 if (!m_listBasedTestResult) | 494 if (!m_listBasedTestResult) |
| 495 m_listBasedTestResult = adoptPtrWillBeNoop(new NodeSet); | 495 m_listBasedTestResult = (new NodeSet); |
| 496 return *m_listBasedTestResult; | 496 return *m_listBasedTestResult; |
| 497 } | 497 } |
| 498 | 498 |
| 499 HitTestResult::NodeSet& HitTestResult::mutableListBasedTestResult() | 499 HitTestResult::NodeSet& HitTestResult::mutableListBasedTestResult() |
| 500 { | 500 { |
| 501 if (!m_listBasedTestResult) | 501 if (!m_listBasedTestResult) |
| 502 m_listBasedTestResult = adoptPtrWillBeNoop(new NodeSet); | 502 m_listBasedTestResult = (new NodeSet); |
| 503 return *m_listBasedTestResult; | 503 return *m_listBasedTestResult; |
| 504 } | 504 } |
| 505 | 505 |
| 506 void HitTestResult::resolveRectBasedTest(Node* resolvedInnerNode, const LayoutPo
int& resolvedPointInMainFrame) | 506 void HitTestResult::resolveRectBasedTest(Node* resolvedInnerNode, const LayoutPo
int& resolvedPointInMainFrame) |
| 507 { | 507 { |
| 508 ASSERT(isRectBasedTest()); | 508 ASSERT(isRectBasedTest()); |
| 509 ASSERT(m_hitTestLocation.containsPoint(FloatPoint(resolvedPointInMainFrame))
); | 509 ASSERT(m_hitTestLocation.containsPoint(FloatPoint(resolvedPointInMainFrame))
); |
| 510 m_hitTestLocation = HitTestLocation(resolvedPointInMainFrame); | 510 m_hitTestLocation = HitTestLocation(resolvedPointInMainFrame); |
| 511 m_pointInInnerNodeFrame = resolvedPointInMainFrame; | 511 m_pointInInnerNodeFrame = resolvedPointInMainFrame; |
| 512 m_innerNode = nullptr; | 512 m_innerNode = nullptr; |
| (...skipping 28 matching lines...) Expand all Loading... |
| 541 else if (isHTMLMapElement(m_innerNode)) | 541 else if (isHTMLMapElement(m_innerNode)) |
| 542 imageMapImageElement = toHTMLMapElement(m_innerNode)->imageElement(); | 542 imageMapImageElement = toHTMLMapElement(m_innerNode)->imageElement(); |
| 543 | 543 |
| 544 if (!imageMapImageElement) | 544 if (!imageMapImageElement) |
| 545 return m_innerNode.get(); | 545 return m_innerNode.get(); |
| 546 | 546 |
| 547 return imageMapImageElement; | 547 return imageMapImageElement; |
| 548 } | 548 } |
| 549 | 549 |
| 550 } // namespace blink | 550 } // namespace blink |
| OLD | NEW |