OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007, 2008 Rob Buis <buis@kde.org> | 2 * Copyright (C) 2007, 2008 Rob Buis <buis@kde.org> |
3 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> | 3 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> |
4 * Copyright (C) 2007 Eric Seidel <eric@webkit.org> | 4 * Copyright (C) 2007 Eric Seidel <eric@webkit.org> |
5 * Copyright (C) 2009 Google, Inc. All rights reserved. | 5 * Copyright (C) 2009 Google, Inc. All rights reserved. |
6 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> | 6 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> |
7 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. | 7 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. |
8 * | 8 * |
9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 // LayoutSVGRoot's mapLocalToAncestor method expects CSS box coordinates. | 153 // LayoutSVGRoot's mapLocalToAncestor method expects CSS box coordinates. |
154 if (parent->isSVGRoot()) | 154 if (parent->isSVGRoot()) |
155 transformState.applyTransform( | 155 transformState.applyTransform( |
156 toLayoutSVGRoot(parent)->localToBorderBoxTransform()); | 156 toLayoutSVGRoot(parent)->localToBorderBoxTransform()); |
157 | 157 |
158 parent->mapLocalToAncestor(ancestor, transformState, flags); | 158 parent->mapLocalToAncestor(ancestor, transformState, flags); |
159 } | 159 } |
160 | 160 |
161 void SVGLayoutSupport::mapAncestorToLocal(const LayoutObject& object, | 161 void SVGLayoutSupport::mapAncestorToLocal(const LayoutObject& object, |
162 const LayoutBoxModelObject* ancestor, | 162 const LayoutBoxModelObject* ancestor, |
163 TransformState& transformState, | 163 TransformState& transformState) { |
164 MapCoordinatesFlags flags) { | |
165 // |object| is either a LayoutSVGModelObject or a LayoutSVGBlock here. In | 164 // |object| is either a LayoutSVGModelObject or a LayoutSVGBlock here. In |
166 // the former case, |object| can never be an ancestor while in the latter | 165 // the former case, |object| can never be an ancestor while in the latter |
167 // the caller is responsible for doing the ancestor check. Because of this, | 166 // the caller is responsible for doing the ancestor check. Because of this, |
168 // computing the transform to the SVG root is always what we want to do here. | 167 // computing the transform to the SVG root is always what we want to do here. |
169 ASSERT(ancestor != &object); | 168 ASSERT(ancestor != &object); |
170 ASSERT(object.isSVGContainer() || object.isSVGShape() || | 169 ASSERT(object.isSVGContainer() || object.isSVGShape() || |
171 object.isSVGImage() || object.isSVGText() || | 170 object.isSVGImage() || object.isSVGText() || |
172 object.isSVGForeignObject()); | 171 object.isSVGForeignObject()); |
173 AffineTransform localToSVGRoot; | 172 AffineTransform localToSVGRoot; |
174 const LayoutSVGRoot& svgRoot = | 173 const LayoutSVGRoot& svgRoot = |
175 computeTransformToSVGRoot(object, localToSVGRoot); | 174 computeTransformToSVGRoot(object, localToSVGRoot); |
176 | 175 |
177 MapCoordinatesFlags mode = flags | UseTransforms | ApplyContainerFlip; | 176 MapCoordinatesFlags mode = UseTransforms | ApplyContainerFlip; |
178 svgRoot.mapAncestorToLocal(ancestor, transformState, mode); | 177 svgRoot.mapAncestorToLocal(ancestor, transformState, mode); |
179 | 178 |
180 transformState.applyTransform(localToSVGRoot); | 179 transformState.applyTransform(localToSVGRoot); |
181 } | 180 } |
182 | 181 |
183 const LayoutObject* SVGLayoutSupport::pushMappingToContainer( | 182 const LayoutObject* SVGLayoutSupport::pushMappingToContainer( |
184 const LayoutObject* object, | 183 const LayoutObject* object, |
185 const LayoutBoxModelObject* ancestorToStopAt, | 184 const LayoutBoxModelObject* ancestorToStopAt, |
186 LayoutGeometryMap& geometryMap) { | 185 LayoutGeometryMap& geometryMap) { |
187 DCHECK_NE(ancestorToStopAt, object); | 186 DCHECK_NE(ancestorToStopAt, object); |
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
646 } | 645 } |
647 | 646 |
648 LayoutObject* SVGLayoutSupport::findClosestLayoutSVGText( | 647 LayoutObject* SVGLayoutSupport::findClosestLayoutSVGText( |
649 LayoutObject* layoutObject, | 648 LayoutObject* layoutObject, |
650 const FloatPoint& point) { | 649 const FloatPoint& point) { |
651 return searchTreeForFindClosestLayoutSVGText(layoutObject, point) | 650 return searchTreeForFindClosestLayoutSVGText(layoutObject, point) |
652 .candidateLayoutObject; | 651 .candidateLayoutObject; |
653 } | 652 } |
654 | 653 |
655 } // namespace blink | 654 } // namespace blink |
OLD | NEW |