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

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

Issue 10750009: Merge 120731 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1132/
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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 return renderer->isSVGShape() || renderer->isSVGText() || renderer->isSVGIma ge() || renderer->node()->hasTagName(SVGNames::useTag); 159 return renderer->isSVGShape() || renderer->isSVGText() || renderer->isSVGIma ge() || renderer->node()->hasTagName(SVGNames::useTag);
160 } 160 }
161 161
162 bool RenderSVGModelObject::checkIntersection(RenderObject* renderer, const Float Rect& rect) 162 bool RenderSVGModelObject::checkIntersection(RenderObject* renderer, const Float Rect& rect)
163 { 163 {
164 if (!renderer || renderer->style()->pointerEvents() == PE_NONE) 164 if (!renderer || renderer->style()->pointerEvents() == PE_NONE)
165 return false; 165 return false;
166 if (!isGraphicsElement(renderer)) 166 if (!isGraphicsElement(renderer))
167 return false; 167 return false;
168 AffineTransform ctm; 168 AffineTransform ctm;
169 getElementCTM(static_cast<SVGElement*>(renderer->node()), ctm); 169 SVGElement* svgElement = static_cast<SVGElement*>(renderer->node());
170 return intersectsAllowingEmpty(rect, ctm.mapRect(renderer->repaintRectInLoca lCoordinates())); 170 getElementCTM(svgElement, ctm);
171 ASSERT(svgElement->renderer());
172 return intersectsAllowingEmpty(rect, ctm.mapRect(svgElement->renderer()->rep aintRectInLocalCoordinates()));
171 } 173 }
172 174
173 bool RenderSVGModelObject::checkEnclosure(RenderObject* renderer, const FloatRec t& rect) 175 bool RenderSVGModelObject::checkEnclosure(RenderObject* renderer, const FloatRec t& rect)
174 { 176 {
175 if (!renderer || renderer->style()->pointerEvents() == PE_NONE) 177 if (!renderer || renderer->style()->pointerEvents() == PE_NONE)
176 return false; 178 return false;
177 if (!isGraphicsElement(renderer)) 179 if (!isGraphicsElement(renderer))
178 return false; 180 return false;
179 AffineTransform ctm; 181 AffineTransform ctm;
180 getElementCTM(static_cast<SVGElement*>(renderer->node()), ctm); 182 SVGElement* svgElement = static_cast<SVGElement*>(renderer->node());
181 return rect.contains(ctm.mapRect(renderer->repaintRectInLocalCoordinates())) ; 183 getElementCTM(svgElement, ctm);
184 ASSERT(svgElement->renderer());
185 return rect.contains(ctm.mapRect(svgElement->renderer()->repaintRectInLocalC oordinates()));
182 } 186 }
183 187
184 } // namespace WebCore 188 } // namespace WebCore
185 189
186 #endif // ENABLE(SVG) 190 #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