OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006 Apple Computer, Inc. | 2 * Copyright (C) 2006 Apple Computer, Inc. |
3 * Copyright (C) 2006 Alexander Kellett <lypanov@kde.org> | 3 * Copyright (C) 2006 Alexander Kellett <lypanov@kde.org> |
4 * Copyright (C) 2006 Oliver Hunt <ojh16@student.canterbury.ac.nz> | 4 * Copyright (C) 2006 Oliver Hunt <ojh16@student.canterbury.ac.nz> |
5 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> | 5 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> |
6 * Copyright (C) 2008 Rob Buis <buis@kde.org> | 6 * Copyright (C) 2008 Rob Buis <buis@kde.org> |
7 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> | 7 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> |
8 * Copyright (C) Research In Motion Limited 2010-2012. All rights reserved. | 8 * Copyright (C) Research In Motion Limited 2010-2012. All rights reserved. |
9 * Copyright (C) 2012 Google Inc. | 9 * Copyright (C) 2012 Google Inc. |
10 * | 10 * |
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
445 | 445 |
446 return false; | 446 return false; |
447 } | 447 } |
448 | 448 |
449 PositionWithAffinity LayoutSVGText::positionForPoint(const LayoutPoint& pointInC
ontents) | 449 PositionWithAffinity LayoutSVGText::positionForPoint(const LayoutPoint& pointInC
ontents) |
450 { | 450 { |
451 RootInlineBox* rootBox = firstRootBox(); | 451 RootInlineBox* rootBox = firstRootBox(); |
452 if (!rootBox) | 452 if (!rootBox) |
453 return createPositionWithAffinity(0); | 453 return createPositionWithAffinity(0); |
454 | 454 |
| 455 LayoutPoint clippedPointInContents(pointInContents); |
| 456 clippedPointInContents.clampNegativeToZero(); |
| 457 |
455 ASSERT(!rootBox->nextRootBox()); | 458 ASSERT(!rootBox->nextRootBox()); |
456 ASSERT(childrenInline()); | 459 ASSERT(childrenInline()); |
457 | 460 |
458 InlineBox* closestBox = toSVGRootInlineBox(rootBox)->closestLeafChildForPosi
tion(pointInContents); | 461 InlineBox* closestBox = toSVGRootInlineBox(rootBox)->closestLeafChildForPosi
tion(clippedPointInContents); |
459 if (!closestBox) | 462 if (!closestBox) |
460 return createPositionWithAffinity(0); | 463 return createPositionWithAffinity(0); |
461 | 464 |
462 return closestBox->lineLayoutItem().positionForPoint(LayoutPoint(pointInCont
ents.x(), closestBox->y())); | 465 return closestBox->lineLayoutItem().positionForPoint(LayoutPoint(clippedPoin
tInContents.x(), closestBox->y())); |
463 } | 466 } |
464 | 467 |
465 void LayoutSVGText::absoluteQuads(Vector<FloatQuad>& quads, bool* wasFixed) cons
t | 468 void LayoutSVGText::absoluteQuads(Vector<FloatQuad>& quads, bool* wasFixed) cons
t |
466 { | 469 { |
467 quads.append(localToAbsoluteQuad(strokeBoundingBox(), 0 /* mode */, wasFixed
)); | 470 quads.append(localToAbsoluteQuad(strokeBoundingBox(), 0 /* mode */, wasFixed
)); |
468 } | 471 } |
469 | 472 |
470 void LayoutSVGText::paint(const PaintInfo& paintInfo, const LayoutPoint&) const | 473 void LayoutSVGText::paint(const PaintInfo& paintInfo, const LayoutPoint&) const |
471 { | 474 { |
472 SVGTextPainter(*this).paint(paintInfo); | 475 SVGTextPainter(*this).paint(paintInfo); |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
530 paintInvalidationState.pushDelayedPaintInvalidationTarget(*this); | 533 paintInvalidationState.pushDelayedPaintInvalidationTarget(*this); |
531 | 534 |
532 ForceHorriblySlowRectMapping slowRectMapping(&paintInvalidationState); | 535 ForceHorriblySlowRectMapping slowRectMapping(&paintInvalidationState); |
533 PaintInvalidationState childTreeWalkState(paintInvalidationState, *this, pai
ntInvalidationState.paintInvalidationContainer()); | 536 PaintInvalidationState childTreeWalkState(paintInvalidationState, *this, pai
ntInvalidationState.paintInvalidationContainer()); |
534 if (reason == PaintInvalidationSVGResourceChange) | 537 if (reason == PaintInvalidationSVGResourceChange) |
535 childTreeWalkState.setForceSubtreeInvalidationWithinContainer(); | 538 childTreeWalkState.setForceSubtreeInvalidationWithinContainer(); |
536 invalidatePaintOfSubtreesIfNeeded(childTreeWalkState); | 539 invalidatePaintOfSubtreesIfNeeded(childTreeWalkState); |
537 } | 540 } |
538 | 541 |
539 } | 542 } |
OLD | NEW |