Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(103)

Side by Side Diff: Source/core/layout/svg/LayoutSVGText.cpp

Issue 1303653002: Introduce LayoutObject::createPositionWithAffinity(int offset) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-08-19T12:20:28 Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/core/layout/svg/LayoutSVGInlineText.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 428 matching lines...) Expand 10 before | Expand all | Expand 10 after
439 } 439 }
440 } 440 }
441 441
442 return false; 442 return false;
443 } 443 }
444 444
445 PositionWithAffinity LayoutSVGText::positionForPoint(const LayoutPoint& pointInC ontents) 445 PositionWithAffinity LayoutSVGText::positionForPoint(const LayoutPoint& pointInC ontents)
446 { 446 {
447 RootInlineBox* rootBox = firstRootBox(); 447 RootInlineBox* rootBox = firstRootBox();
448 if (!rootBox) 448 if (!rootBox)
449 return createPositionWithAffinity(0, DOWNSTREAM); 449 return createPositionWithAffinity(0);
450 450
451 ASSERT(!rootBox->nextRootBox()); 451 ASSERT(!rootBox->nextRootBox());
452 ASSERT(childrenInline()); 452 ASSERT(childrenInline());
453 453
454 InlineBox* closestBox = toSVGRootInlineBox(rootBox)->closestLeafChildForPosi tion(pointInContents); 454 InlineBox* closestBox = toSVGRootInlineBox(rootBox)->closestLeafChildForPosi tion(pointInContents);
455 if (!closestBox) 455 if (!closestBox)
456 return createPositionWithAffinity(0, DOWNSTREAM); 456 return createPositionWithAffinity(0);
457 457
458 return closestBox->layoutObject().positionForPoint(LayoutPoint(pointInConten ts.x(), closestBox->y())); 458 return closestBox->layoutObject().positionForPoint(LayoutPoint(pointInConten ts.x(), closestBox->y()));
459 } 459 }
460 460
461 void LayoutSVGText::absoluteQuads(Vector<FloatQuad>& quads, bool* wasFixed) cons t 461 void LayoutSVGText::absoluteQuads(Vector<FloatQuad>& quads, bool* wasFixed) cons t
462 { 462 {
463 quads.append(localToAbsoluteQuad(strokeBoundingBox(), 0 /* mode */, wasFixed )); 463 quads.append(localToAbsoluteQuad(strokeBoundingBox(), 0 /* mode */, wasFixed ));
464 } 464 }
465 465
466 void LayoutSVGText::paint(const PaintInfo& paintInfo, const LayoutPoint&) 466 void LayoutSVGText::paint(const PaintInfo& paintInfo, const LayoutPoint&)
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
506 SVGResourcesCache::clientWillBeRemovedFromTree(child); 506 SVGResourcesCache::clientWillBeRemovedFromTree(child);
507 507
508 Vector<SVGTextLayoutAttributes*, 2> affectedAttributes; 508 Vector<SVGTextLayoutAttributes*, 2> affectedAttributes;
509 FontCachePurgePreventer fontCachePurgePreventer; 509 FontCachePurgePreventer fontCachePurgePreventer;
510 subtreeChildWillBeRemoved(child, affectedAttributes); 510 subtreeChildWillBeRemoved(child, affectedAttributes);
511 LayoutSVGBlock::removeChild(child); 511 LayoutSVGBlock::removeChild(child);
512 subtreeChildWasRemoved(affectedAttributes); 512 subtreeChildWasRemoved(affectedAttributes);
513 } 513 }
514 514
515 } 515 }
OLDNEW
« no previous file with comments | « Source/core/layout/svg/LayoutSVGInlineText.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698