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

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

Issue 23819007: Have Node::document() return a reference instead of a pointer (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase on master Created 7 years, 3 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
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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 123
124 bool RenderSVGModelObject::nodeAtPoint(const HitTestRequest&, HitTestResult&, co nst HitTestLocation&, const LayoutPoint&, HitTestAction) 124 bool RenderSVGModelObject::nodeAtPoint(const HitTestRequest&, HitTestResult&, co nst HitTestLocation&, const LayoutPoint&, HitTestAction)
125 { 125 {
126 ASSERT_NOT_REACHED(); 126 ASSERT_NOT_REACHED();
127 return false; 127 return false;
128 } 128 }
129 129
130 static void getElementCTM(SVGElement* element, AffineTransform& transform) 130 static void getElementCTM(SVGElement* element, AffineTransform& transform)
131 { 131 {
132 ASSERT(element); 132 ASSERT(element);
133 element->document()->updateLayoutIgnorePendingStylesheets(); 133 element->document().updateLayoutIgnorePendingStylesheets();
134 134
135 SVGElement* stopAtElement = SVGLocatable::nearestViewportElement(element); 135 SVGElement* stopAtElement = SVGLocatable::nearestViewportElement(element);
136 ASSERT(stopAtElement); 136 ASSERT(stopAtElement);
137 137
138 AffineTransform localTransform; 138 AffineTransform localTransform;
139 Node* current = element; 139 Node* current = element;
140 140
141 while (current && current->isSVGElement()) { 141 while (current && current->isSVGElement()) {
142 SVGElement* currentElement = toSVGElement(current); 142 SVGElement* currentElement = toSVGElement(current);
143 localTransform = currentElement->renderer()->localToParentTransform(); 143 localTransform = currentElement->renderer()->localToParentTransform();
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 if (!isGraphicsElement(renderer)) 199 if (!isGraphicsElement(renderer))
200 return false; 200 return false;
201 AffineTransform ctm; 201 AffineTransform ctm;
202 SVGElement* svgElement = toSVGElement(renderer->node()); 202 SVGElement* svgElement = toSVGElement(renderer->node());
203 getElementCTM(svgElement, ctm); 203 getElementCTM(svgElement, ctm);
204 ASSERT(svgElement->renderer()); 204 ASSERT(svgElement->renderer());
205 return rect.contains(ctm.mapRect(svgElement->renderer()->repaintRectInLocalC oordinates())); 205 return rect.contains(ctm.mapRect(svgElement->renderer()->repaintRectInLocalC oordinates()));
206 } 206 }
207 207
208 } // namespace WebCore 208 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/rendering/svg/RenderSVGInlineText.cpp ('k') | Source/core/rendering/svg/RenderSVGResource.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698