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

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

Issue 1775363002: Avoiding losing too much precision when hit-testing SVG <text> (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use HitTestLocation(const FloatPoint&) Created 4 years, 9 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 | « third_party/WebKit/Source/core/layout/svg/LayoutSVGForeignObject.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 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 if ((hitRules.canHitBoundingBox && !objectBoundingBox().isEmpty()) 413 if ((hitRules.canHitBoundingBox && !objectBoundingBox().isEmpty())
414 || (hitRules.canHitStroke && (style()->svgStyle().hasStroke() || !hi tRules.requireStroke)) 414 || (hitRules.canHitStroke && (style()->svgStyle().hasStroke() || !hi tRules.requireStroke))
415 || (hitRules.canHitFill && (style()->svgStyle().hasFill() || !hitRul es.requireFill))) { 415 || (hitRules.canHitFill && (style()->svgStyle().hasFill() || !hitRul es.requireFill))) {
416 FloatPoint localPoint; 416 FloatPoint localPoint;
417 if (!SVGLayoutSupport::transformToUserSpaceAndCheckClipping(this, lo calToParentTransform(), pointInParent, localPoint)) 417 if (!SVGLayoutSupport::transformToUserSpaceAndCheckClipping(this, lo calToParentTransform(), pointInParent, localPoint))
418 return false; 418 return false;
419 419
420 if (hitRules.canHitBoundingBox && !objectBoundingBox().contains(loca lPoint)) 420 if (hitRules.canHitBoundingBox && !objectBoundingBox().contains(loca lPoint))
421 return false; 421 return false;
422 422
423 HitTestLocation hitTestLocation(LayoutPoint(flooredIntPoint(localPoi nt))); 423 HitTestLocation hitTestLocation(localPoint);
424 return LayoutBlock::nodeAtPoint(result, hitTestLocation, LayoutPoint (), hitTestAction); 424 return LayoutBlock::nodeAtPoint(result, hitTestLocation, LayoutPoint (), hitTestAction);
425 } 425 }
426 } 426 }
427 427
428 return false; 428 return false;
429 } 429 }
430 430
431 PositionWithAffinity LayoutSVGText::positionForPoint(const LayoutPoint& pointInC ontents) 431 PositionWithAffinity LayoutSVGText::positionForPoint(const LayoutPoint& pointInC ontents)
432 { 432 {
433 RootInlineBox* rootBox = firstRootBox(); 433 RootInlineBox* rootBox = firstRootBox();
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
521 paintInvalidationState.pushDelayedPaintInvalidationTarget(*this); 521 paintInvalidationState.pushDelayedPaintInvalidationTarget(*this);
522 522
523 ForceHorriblySlowRectMapping slowRectMapping(&paintInvalidationState); 523 ForceHorriblySlowRectMapping slowRectMapping(&paintInvalidationState);
524 PaintInvalidationState childTreeWalkState(paintInvalidationState, *this, pai ntInvalidationState.paintInvalidationContainer()); 524 PaintInvalidationState childTreeWalkState(paintInvalidationState, *this, pai ntInvalidationState.paintInvalidationContainer());
525 if (reason == PaintInvalidationSVGResourceChange) 525 if (reason == PaintInvalidationSVGResourceChange)
526 childTreeWalkState.setForceSubtreeInvalidationWithinContainer(); 526 childTreeWalkState.setForceSubtreeInvalidationWithinContainer();
527 invalidatePaintOfSubtreesIfNeeded(childTreeWalkState); 527 invalidatePaintOfSubtreesIfNeeded(childTreeWalkState);
528 } 528 }
529 529
530 } // namespace blink 530 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/svg/LayoutSVGForeignObject.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698