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

Side by Side Diff: Source/WebCore/rendering/svg/RenderSVGModelObject.cpp

Issue 10763008: Merge 120731 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1180/
Patch Set: Created 8 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
« no previous file with comments | « LayoutTests/svg/custom/intersection-list-crash-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) 2009, Google Inc. All rights reserved. 2 * Copyright (c) 2009, Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 return renderer->isSVGShape() || renderer->isSVGText() || renderer->isSVGIma ge() || renderer->node()->hasTagName(SVGNames::useTag); 164 return renderer->isSVGShape() || renderer->isSVGText() || renderer->isSVGIma ge() || renderer->node()->hasTagName(SVGNames::useTag);
165 } 165 }
166 166
167 bool RenderSVGModelObject::checkIntersection(RenderObject* renderer, const Float Rect& rect) 167 bool RenderSVGModelObject::checkIntersection(RenderObject* renderer, const Float Rect& rect)
168 { 168 {
169 if (!renderer || renderer->style()->pointerEvents() == PE_NONE) 169 if (!renderer || renderer->style()->pointerEvents() == PE_NONE)
170 return false; 170 return false;
171 if (!isGraphicsElement(renderer)) 171 if (!isGraphicsElement(renderer))
172 return false; 172 return false;
173 AffineTransform ctm; 173 AffineTransform ctm;
174 getElementCTM(static_cast<SVGElement*>(renderer->node()), ctm); 174 SVGElement* svgElement = static_cast<SVGElement*>(renderer->node());
175 return intersectsAllowingEmpty(rect, ctm.mapRect(renderer->repaintRectInLoca lCoordinates())); 175 getElementCTM(svgElement, ctm);
176 ASSERT(svgElement->renderer());
177 return intersectsAllowingEmpty(rect, ctm.mapRect(svgElement->renderer()->rep aintRectInLocalCoordinates()));
176 } 178 }
177 179
178 bool RenderSVGModelObject::checkEnclosure(RenderObject* renderer, const FloatRec t& rect) 180 bool RenderSVGModelObject::checkEnclosure(RenderObject* renderer, const FloatRec t& rect)
179 { 181 {
180 if (!renderer || renderer->style()->pointerEvents() == PE_NONE) 182 if (!renderer || renderer->style()->pointerEvents() == PE_NONE)
181 return false; 183 return false;
182 if (!isGraphicsElement(renderer)) 184 if (!isGraphicsElement(renderer))
183 return false; 185 return false;
184 AffineTransform ctm; 186 AffineTransform ctm;
185 getElementCTM(static_cast<SVGElement*>(renderer->node()), ctm); 187 SVGElement* svgElement = static_cast<SVGElement*>(renderer->node());
186 return rect.contains(ctm.mapRect(renderer->repaintRectInLocalCoordinates())) ; 188 getElementCTM(svgElement, ctm);
189 ASSERT(svgElement->renderer());
190 return rect.contains(ctm.mapRect(svgElement->renderer()->repaintRectInLocalC oordinates()));
187 } 191 }
188 192
189 } // namespace WebCore 193 } // namespace WebCore
190 194
191 #endif // ENABLE(SVG) 195 #endif // ENABLE(SVG)
OLDNEW
« no previous file with comments | « LayoutTests/svg/custom/intersection-list-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698