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

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

Issue 1032823003: Refactor HitTestResult to store the HitTestRequest (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 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
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 396 matching lines...) Expand 10 before | Expand all | Expand 10 after
407 clearNeedsLayout(); 407 clearNeedsLayout();
408 } 408 }
409 409
410 RootInlineBox* LayoutSVGText::createRootInlineBox() 410 RootInlineBox* LayoutSVGText::createRootInlineBox()
411 { 411 {
412 RootInlineBox* box = new SVGRootInlineBox(*this); 412 RootInlineBox* box = new SVGRootInlineBox(*this);
413 box->setHasVirtualLogicalHeight(); 413 box->setHasVirtualLogicalHeight();
414 return box; 414 return box;
415 } 415 }
416 416
417 bool LayoutSVGText::nodeAtFloatPoint(const HitTestRequest& request, HitTestResul t& result, const FloatPoint& pointInParent, HitTestAction hitTestAction) 417 bool LayoutSVGText::nodeAtFloatPoint(HitTestResult& result, const FloatPoint& po intInParent, HitTestAction hitTestAction)
418 { 418 {
419 PointerEventsHitRules hitRules(PointerEventsHitRules::SVG_TEXT_HITTESTING, r equest, style()->pointerEvents()); 419 PointerEventsHitRules hitRules(PointerEventsHitRules::SVG_TEXT_HITTESTING, r esult.hitTestRequest(), style()->pointerEvents());
420 bool isVisible = (style()->visibility() == VISIBLE); 420 bool isVisible = (style()->visibility() == VISIBLE);
421 if (isVisible || !hitRules.requireVisible) { 421 if (isVisible || !hitRules.requireVisible) {
422 if ((hitRules.canHitBoundingBox && !objectBoundingBox().isEmpty()) 422 if ((hitRules.canHitBoundingBox && !objectBoundingBox().isEmpty())
423 || (hitRules.canHitStroke && (style()->svgStyle().hasStroke() || !hi tRules.requireStroke)) 423 || (hitRules.canHitStroke && (style()->svgStyle().hasStroke() || !hi tRules.requireStroke))
424 || (hitRules.canHitFill && (style()->svgStyle().hasFill() || !hitRul es.requireFill))) { 424 || (hitRules.canHitFill && (style()->svgStyle().hasFill() || !hitRul es.requireFill))) {
425 FloatPoint localPoint; 425 FloatPoint localPoint;
426 if (!SVGLayoutSupport::transformToUserSpaceAndCheckClipping(this, lo calToParentTransform(), pointInParent, localPoint)) 426 if (!SVGLayoutSupport::transformToUserSpaceAndCheckClipping(this, lo calToParentTransform(), pointInParent, localPoint))
427 return false; 427 return false;
428 428
429 if (hitRules.canHitBoundingBox && !objectBoundingBox().contains(loca lPoint)) 429 if (hitRules.canHitBoundingBox && !objectBoundingBox().contains(loca lPoint))
430 return false; 430 return false;
431 431
432 HitTestLocation hitTestLocation(LayoutPoint(flooredIntPoint(localPoi nt))); 432 HitTestLocation hitTestLocation(LayoutPoint(flooredIntPoint(localPoi nt)));
433 return LayoutBlock::nodeAtPoint(request, result, hitTestLocation, La youtPoint(), hitTestAction); 433 return LayoutBlock::nodeAtPoint(result, hitTestLocation, LayoutPoint (), hitTestAction);
434 } 434 }
435 } 435 }
436 436
437 return false; 437 return false;
438 } 438 }
439 439
440 PositionWithAffinity LayoutSVGText::positionForPoint(const LayoutPoint& pointInC ontents) 440 PositionWithAffinity LayoutSVGText::positionForPoint(const LayoutPoint& pointInC ontents)
441 { 441 {
442 RootInlineBox* rootBox = firstRootBox(); 442 RootInlineBox* rootBox = firstRootBox();
443 if (!rootBox) 443 if (!rootBox)
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
501 SVGResourcesCache::clientWillBeRemovedFromTree(child); 501 SVGResourcesCache::clientWillBeRemovedFromTree(child);
502 502
503 Vector<SVGTextLayoutAttributes*, 2> affectedAttributes; 503 Vector<SVGTextLayoutAttributes*, 2> affectedAttributes;
504 FontCachePurgePreventer fontCachePurgePreventer; 504 FontCachePurgePreventer fontCachePurgePreventer;
505 subtreeChildWillBeRemoved(child, affectedAttributes); 505 subtreeChildWillBeRemoved(child, affectedAttributes);
506 LayoutSVGBlock::removeChild(child); 506 LayoutSVGBlock::removeChild(child);
507 subtreeChildWasRemoved(affectedAttributes); 507 subtreeChildWasRemoved(affectedAttributes);
508 } 508 }
509 509
510 } 510 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698