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

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

Issue 1032823003: Refactor HitTestResult to store the HitTestRequest (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Updated as per review comments Created 5 years, 8 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) 2009 Google, Inc. 3 * Copyright (C) 2009 Google, Inc.
4 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 4 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 115
116 // If our bounds changed, notify the parents. 116 // If our bounds changed, notify the parents.
117 if (updateCachedBoundariesInParents) 117 if (updateCachedBoundariesInParents)
118 LayoutSVGBlock::setNeedsBoundariesUpdate(); 118 LayoutSVGBlock::setNeedsBoundariesUpdate();
119 119
120 // Invalidate all resources of this client if our layout changed. 120 // Invalidate all resources of this client if our layout changed.
121 if (layoutChanged) 121 if (layoutChanged)
122 SVGResourcesCache::clientLayoutChanged(this); 122 SVGResourcesCache::clientLayoutChanged(this);
123 } 123 }
124 124
125 bool LayoutSVGForeignObject::nodeAtFloatPoint(const HitTestRequest& request, Hit TestResult& result, const FloatPoint& pointInParent, HitTestAction hitTestAction ) 125 bool LayoutSVGForeignObject::nodeAtFloatPoint(HitTestResult& result, const Float Point& pointInParent, HitTestAction hitTestAction)
126 { 126 {
127 // Embedded content is drawn in the foreground phase. 127 // Embedded content is drawn in the foreground phase.
128 if (hitTestAction != HitTestForeground) 128 if (hitTestAction != HitTestForeground)
129 return false; 129 return false;
130 130
131 AffineTransform localTransform = this->localTransform(); 131 AffineTransform localTransform = this->localTransform();
132 if (!localTransform.isInvertible()) 132 if (!localTransform.isInvertible())
133 return false; 133 return false;
134 134
135 FloatPoint localPoint = localTransform.inverse().mapPoint(pointInParent); 135 FloatPoint localPoint = localTransform.inverse().mapPoint(pointInParent);
136 136
137 // Early exit if local point is not contained in clipped viewport area 137 // Early exit if local point is not contained in clipped viewport area
138 if (SVGLayoutSupport::isOverflowHidden(this) && !m_viewport.contains(localPo int)) 138 if (SVGLayoutSupport::isOverflowHidden(this) && !m_viewport.contains(localPo int))
139 return false; 139 return false;
140 140
141 // FOs establish a stacking context, so we need to hit-test all layers. 141 // FOs establish a stacking context, so we need to hit-test all layers.
142 HitTestLocation hitTestLocation(roundedLayoutPoint(localPoint)); 142 HitTestLocation hitTestLocation(roundedLayoutPoint(localPoint));
143 return LayoutBlock::nodeAtPoint(request, result, hitTestLocation, LayoutPoin t(), HitTestForeground) 143 return LayoutBlock::nodeAtPoint(result, hitTestLocation, LayoutPoint(), HitT estForeground)
144 || LayoutBlock::nodeAtPoint(request, result, hitTestLocation, LayoutPoin t(), HitTestFloat) 144 || LayoutBlock::nodeAtPoint(result, hitTestLocation, LayoutPoint(), HitT estFloat)
145 || LayoutBlock::nodeAtPoint(request, result, hitTestLocation, LayoutPoin t(), HitTestChildBlockBackgrounds); 145 || LayoutBlock::nodeAtPoint(result, hitTestLocation, LayoutPoint(), HitT estChildBlockBackgrounds);
146 } 146 }
147 147
148 } 148 }
OLDNEW
« no previous file with comments | « Source/core/layout/svg/LayoutSVGForeignObject.h ('k') | Source/core/layout/svg/LayoutSVGHiddenContainer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698