OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |