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

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

Issue 318663002: Allow hitting the SVG root when its display-type is 'block' (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 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
« no previous file with comments | « LayoutTests/svg/hittest/svg-root-display-block-expected.txt ('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) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) 2004, 2005, 2007, 2008, 2009 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005, 2007, 2008, 2009 Rob Buis <buis@kde.org>
4 * Copyright (C) 2007 Eric Seidel <eric@webkit.org> 4 * Copyright (C) 2007 Eric Seidel <eric@webkit.org>
5 * Copyright (C) 2009 Google, Inc. 5 * Copyright (C) 2009 Google, Inc.
6 * Copyright (C) Research In Motion Limited 2011. All rights reserved. 6 * Copyright (C) Research In Motion Limited 2011. All rights reserved.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 // FIXME: nodeAtFloatPoint() doesn't handle rect-based hit tests yet . 441 // FIXME: nodeAtFloatPoint() doesn't handle rect-based hit tests yet .
442 if (child->nodeAtFloatPoint(request, result, localPoint, hitTestActi on)) { 442 if (child->nodeAtFloatPoint(request, result, localPoint, hitTestActi on)) {
443 updateHitTestResult(result, pointInBorderBox); 443 updateHitTestResult(result, pointInBorderBox);
444 if (!result.addNodeToRectBasedTestResult(child->node(), request, locationInContainer)) 444 if (!result.addNodeToRectBasedTestResult(child->node(), request, locationInContainer))
445 return true; 445 return true;
446 } 446 }
447 } 447 }
448 } 448 }
449 449
450 // If we didn't early exit above, we've just hit the container <svg> element . Unlike SVG 1.1, 2nd Edition allows container elements to be hit. 450 // If we didn't early exit above, we've just hit the container <svg> element . Unlike SVG 1.1, 2nd Edition allows container elements to be hit.
451 if (hitTestAction == HitTestBlockBackground && visibleToHitTestRequest(reque st)) { 451 if ((hitTestAction == HitTestBlockBackground || hitTestAction == HitTestChil dBlockBackground) && visibleToHitTestRequest(request)) {
452 // Only return true here, if the last hit testing phase 'BlockBackground ' is executed. If we'd return true in the 'Foreground' phase, 452 // Only return true here, if the last hit testing phase 'BlockBackground ' (or 'ChildBlockBackground' - depending on context) is executed.
453 // hit testing would stop immediately. For SVG only trees this doesn't m atter. Though when we have a <foreignObject> subtree we need 453 // If we'd return true in the 'Foreground' phase, hit testing would stop immediately. For SVG only trees this doesn't matter.
454 // to be able to detect hits on the background of a <div> element. If we 'd return true here in the 'Foreground' phase, we are not able 454 // Though when we have a <foreignObject> subtree we need to be able to d etect hits on the background of a <div> element.
455 // to detect these hits anymore. 455 // If we'd return true here in the 'Foreground' phase, we are not able t o detect these hits anymore.
456 LayoutRect boundsRect(accumulatedOffset + location(), size()); 456 LayoutRect boundsRect(accumulatedOffset + location(), size());
457 if (locationInContainer.intersects(boundsRect)) { 457 if (locationInContainer.intersects(boundsRect)) {
458 updateHitTestResult(result, pointInBorderBox); 458 updateHitTestResult(result, pointInBorderBox);
459 if (!result.addNodeToRectBasedTestResult(node(), request, locationIn Container, boundsRect)) 459 if (!result.addNodeToRectBasedTestResult(node(), request, locationIn Container, boundsRect))
460 return true; 460 return true;
461 } 461 }
462 } 462 }
463 463
464 return false; 464 return false;
465 } 465 }
466 466
467 } 467 }
OLDNEW
« no previous file with comments | « LayoutTests/svg/hittest/svg-root-display-block-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698