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 17 matching lines...) Expand all Loading... |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #include "config.h" | 31 #include "config.h" |
32 | 32 |
33 #include "core/rendering/svg/RenderSVGModelObject.h" | 33 #include "core/rendering/svg/RenderSVGModelObject.h" |
34 | 34 |
35 #include "SVGNames.h" | 35 #include "SVGNames.h" |
36 #include "core/rendering/svg/RenderSVGRoot.h" | 36 #include "core/rendering/svg/RenderSVGRoot.h" |
37 #include "core/rendering/svg/SVGResourcesCache.h" | 37 #include "core/rendering/svg/SVGResourcesCache.h" |
38 #include "core/svg/SVGElement.h" | 38 #include "core/svg/SVGGraphicsElement.h" |
39 | 39 |
40 namespace WebCore { | 40 namespace WebCore { |
41 | 41 |
42 RenderSVGModelObject::RenderSVGModelObject(SVGElement* node) | 42 RenderSVGModelObject::RenderSVGModelObject(SVGElement* node) |
43 : RenderObject(node) | 43 : RenderObject(node) |
44 { | 44 { |
45 } | 45 } |
46 | 46 |
47 LayoutRect RenderSVGModelObject::clippedOverflowRectForRepaint(const RenderLayer
ModelObject* repaintContainer) const | 47 LayoutRect RenderSVGModelObject::clippedOverflowRectForRepaint(const RenderLayer
ModelObject* repaintContainer) const |
48 { | 48 { |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 { | 121 { |
122 ASSERT_NOT_REACHED(); | 122 ASSERT_NOT_REACHED(); |
123 return false; | 123 return false; |
124 } | 124 } |
125 | 125 |
126 static void getElementCTM(SVGElement* element, AffineTransform& transform) | 126 static void getElementCTM(SVGElement* element, AffineTransform& transform) |
127 { | 127 { |
128 ASSERT(element); | 128 ASSERT(element); |
129 element->document().updateLayoutIgnorePendingStylesheets(); | 129 element->document().updateLayoutIgnorePendingStylesheets(); |
130 | 130 |
131 SVGElement* stopAtElement = SVGLocatable::nearestViewportElement(element); | 131 SVGElement* stopAtElement = SVGGraphicsElement::nearestViewportElement(eleme
nt); |
132 ASSERT(stopAtElement); | 132 ASSERT(stopAtElement); |
133 | 133 |
134 AffineTransform localTransform; | 134 AffineTransform localTransform; |
135 Node* current = element; | 135 Node* current = element; |
136 | 136 |
137 while (current && current->isSVGElement()) { | 137 while (current && current->isSVGElement()) { |
138 SVGElement* currentElement = toSVGElement(current); | 138 SVGElement* currentElement = toSVGElement(current); |
139 localTransform = currentElement->renderer()->localToParentTransform(); | 139 localTransform = currentElement->renderer()->localToParentTransform(); |
140 transform = localTransform.multiply(transform); | 140 transform = localTransform.multiply(transform); |
141 // For getCTM() computation, stop at the nearest viewport element | 141 // For getCTM() computation, stop at the nearest viewport element |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 if (!isGraphicsElement(renderer)) | 195 if (!isGraphicsElement(renderer)) |
196 return false; | 196 return false; |
197 AffineTransform ctm; | 197 AffineTransform ctm; |
198 SVGElement* svgElement = toSVGElement(renderer->node()); | 198 SVGElement* svgElement = toSVGElement(renderer->node()); |
199 getElementCTM(svgElement, ctm); | 199 getElementCTM(svgElement, ctm); |
200 ASSERT(svgElement->renderer()); | 200 ASSERT(svgElement->renderer()); |
201 return rect.contains(ctm.mapRect(svgElement->renderer()->repaintRectInLocalC
oordinates())); | 201 return rect.contains(ctm.mapRect(svgElement->renderer()->repaintRectInLocalC
oordinates())); |
202 } | 202 } |
203 | 203 |
204 } // namespace WebCore | 204 } // namespace WebCore |
OLD | NEW |