| OLD | NEW |
| 1 /** | 1 /** |
| 2 * Copyright (C) 2007 Rob Buis <buis@kde.org> | 2 * Copyright (C) 2007 Rob Buis <buis@kde.org> |
| 3 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> | 3 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> |
| 4 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 4 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
| 5 * | 5 * |
| 6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
| 7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
| 8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
| 9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
| 10 * | 10 * |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 FloatRectWillBeLayoutRect fragmentRect(fragment.x, fragment.y - baseline
, fragment.width, fragment.height); | 255 FloatRectWillBeLayoutRect fragmentRect(fragment.x, fragment.y - baseline
, fragment.width, fragment.height); |
| 256 fragment.buildFragmentTransform(fragmentTransform); | 256 fragment.buildFragmentTransform(fragmentTransform); |
| 257 fragmentRect = fragmentTransform.mapRect(fragmentRect.toFloatRect()); | 257 fragmentRect = fragmentTransform.mapRect(fragmentRect.toFloatRect()); |
| 258 | 258 |
| 259 textRect.unite(fragmentRect); | 259 textRect.unite(fragmentRect); |
| 260 } | 260 } |
| 261 | 261 |
| 262 return textRect; | 262 return textRect; |
| 263 } | 263 } |
| 264 | 264 |
| 265 bool SVGInlineTextBox::nodeAtPoint(const HitTestRequest& request, HitTestResult&
result, const HitTestLocation& locationInContainer, const LayoutPoint& accumula
tedOffset, LayoutUnit, LayoutUnit) | 265 bool SVGInlineTextBox::nodeAtPoint(HitTestResult& result, const HitTestLocation&
locationInContainer, const LayoutPoint& accumulatedOffset, LayoutUnit, LayoutUn
it) |
| 266 { | 266 { |
| 267 // FIXME: integrate with InlineTextBox::nodeAtPoint better. | 267 // FIXME: integrate with InlineTextBox::nodeAtPoint better. |
| 268 ASSERT(!isLineBreak()); | 268 ASSERT(!isLineBreak()); |
| 269 | 269 |
| 270 PointerEventsHitRules hitRules(PointerEventsHitRules::SVG_TEXT_HITTESTING, r
equest, layoutObject().style()->pointerEvents()); | 270 PointerEventsHitRules hitRules(PointerEventsHitRules::SVG_TEXT_HITTESTING, r
esult.hitTestRequest(), layoutObject().style()->pointerEvents()); |
| 271 bool isVisible = layoutObject().style()->visibility() == VISIBLE; | 271 bool isVisible = layoutObject().style()->visibility() == VISIBLE; |
| 272 if (isVisible || !hitRules.requireVisible) { | 272 if (isVisible || !hitRules.requireVisible) { |
| 273 if (hitRules.canHitBoundingBox | 273 if (hitRules.canHitBoundingBox |
| 274 || (hitRules.canHitStroke && (layoutObject().style()->svgStyle().has
Stroke() || !hitRules.requireStroke)) | 274 || (hitRules.canHitStroke && (layoutObject().style()->svgStyle().has
Stroke() || !hitRules.requireStroke)) |
| 275 || (hitRules.canHitFill && (layoutObject().style()->svgStyle().hasFi
ll() || !hitRules.requireFill))) { | 275 || (hitRules.canHitFill && (layoutObject().style()->svgStyle().hasFi
ll() || !hitRules.requireFill))) { |
| 276 FloatPointWillBeLayoutPoint boxOrigin(x(), y()); | 276 FloatPointWillBeLayoutPoint boxOrigin(x(), y()); |
| 277 boxOrigin.moveBy(accumulatedOffset); | 277 boxOrigin.moveBy(accumulatedOffset); |
| 278 FloatRectWillBeLayoutRect rect(boxOrigin, size()); | 278 FloatRectWillBeLayoutRect rect(boxOrigin, size()); |
| 279 // FIXME: both calls to rawValue() below is temporary and should be
removed once the transition | 279 // FIXME: both calls to rawValue() below is temporary and should be
removed once the transition |
| 280 // to LayoutUnit-based types is complete (crbug.com/321237) | 280 // to LayoutUnit-based types is complete (crbug.com/321237) |
| 281 if (locationInContainer.intersects(rect.rawValue())) { | 281 if (locationInContainer.intersects(rect.rawValue())) { |
| 282 layoutObject().updateHitTestResult(result, locationInContainer.p
oint() - toLayoutSize(accumulatedOffset)); | 282 layoutObject().updateHitTestResult(result, locationInContainer.p
oint() - toLayoutSize(accumulatedOffset)); |
| 283 if (!result.addNodeToListBasedTestResult(layoutObject().node(),
request, locationInContainer, rect.rawValue())) | 283 if (!result.addNodeToListBasedTestResult(layoutObject().node(),
locationInContainer, rect.rawValue())) |
| 284 return true; | 284 return true; |
| 285 } | 285 } |
| 286 } | 286 } |
| 287 } | 287 } |
| 288 return false; | 288 return false; |
| 289 } | 289 } |
| 290 | 290 |
| 291 } // namespace blink | 291 } // namespace blink |
| OLD | NEW |