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

Side by Side Diff: Source/core/rendering/svg/RenderSVGText.cpp

Issue 411613002: [SVG] Reject hit-test queries when the element has a singular transform (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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 | Annotate | Revision Log
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 411 matching lines...) Expand 10 before | Expand all | Expand 10 after
422 } 422 }
423 423
424 bool RenderSVGText::nodeAtFloatPoint(const HitTestRequest& request, HitTestResul t& result, const FloatPoint& pointInParent, HitTestAction hitTestAction) 424 bool RenderSVGText::nodeAtFloatPoint(const HitTestRequest& request, HitTestResul t& result, const FloatPoint& pointInParent, HitTestAction hitTestAction)
425 { 425 {
426 PointerEventsHitRules hitRules(PointerEventsHitRules::SVG_TEXT_HITTESTING, r equest, style()->pointerEvents()); 426 PointerEventsHitRules hitRules(PointerEventsHitRules::SVG_TEXT_HITTESTING, r equest, style()->pointerEvents());
427 bool isVisible = (style()->visibility() == VISIBLE); 427 bool isVisible = (style()->visibility() == VISIBLE);
428 if (isVisible || !hitRules.requireVisible) { 428 if (isVisible || !hitRules.requireVisible) {
429 if ((hitRules.canHitBoundingBox && !objectBoundingBox().isEmpty()) 429 if ((hitRules.canHitBoundingBox && !objectBoundingBox().isEmpty())
430 || (hitRules.canHitStroke && (style()->svgStyle().hasStroke() || !hi tRules.requireStroke)) 430 || (hitRules.canHitStroke && (style()->svgStyle().hasStroke() || !hi tRules.requireStroke))
431 || (hitRules.canHitFill && (style()->svgStyle().hasFill() || !hitRul es.requireFill))) { 431 || (hitRules.canHitFill && (style()->svgStyle().hasFill() || !hitRul es.requireFill))) {
432 FloatPoint localPoint = localToParentTransform().inverse().mapPoint( pointInParent); 432 FloatPoint localPoint;
433 if (!SVGRenderSupport::transformToUserSpaceAndCheckClipping(this, lo calToParentTransform(), pointInParent, localPoint))
434 return false;
433 435
434 if (!SVGRenderSupport::pointInClippingArea(this, localPoint))
435 return false;
436 if (hitRules.canHitBoundingBox && !objectBoundingBox().contains(loca lPoint)) 436 if (hitRules.canHitBoundingBox && !objectBoundingBox().contains(loca lPoint))
437 return false; 437 return false;
438 438
439 HitTestLocation hitTestLocation(LayoutPoint(flooredIntPoint(localPoi nt))); 439 HitTestLocation hitTestLocation(LayoutPoint(flooredIntPoint(localPoi nt)));
440 return RenderBlock::nodeAtPoint(request, result, hitTestLocation, La youtPoint(), hitTestAction); 440 return RenderBlock::nodeAtPoint(request, result, hitTestLocation, La youtPoint(), hitTestAction);
441 } 441 }
442 } 442 }
443 443
444 return false; 444 return false;
445 } 445 }
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
528 SVGResourcesCache::clientWillBeRemovedFromTree(child); 528 SVGResourcesCache::clientWillBeRemovedFromTree(child);
529 529
530 Vector<SVGTextLayoutAttributes*, 2> affectedAttributes; 530 Vector<SVGTextLayoutAttributes*, 2> affectedAttributes;
531 FontCachePurgePreventer fontCachePurgePreventer; 531 FontCachePurgePreventer fontCachePurgePreventer;
532 subtreeChildWillBeRemoved(child, affectedAttributes); 532 subtreeChildWillBeRemoved(child, affectedAttributes);
533 RenderSVGBlock::removeChild(child); 533 RenderSVGBlock::removeChild(child);
534 subtreeChildWasRemoved(affectedAttributes); 534 subtreeChildWasRemoved(affectedAttributes);
535 } 535 }
536 536
537 } 537 }
OLDNEW
« no previous file with comments | « Source/core/rendering/svg/RenderSVGShape.cpp ('k') | Source/core/rendering/svg/SVGRenderSupport.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698