| 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) { |
| 164 // |object| is either a LayoutSVGModelObject or a LayoutSVGBlock here. In | 165 // |object| is either a LayoutSVGModelObject or a LayoutSVGBlock here. In |
| 165 // the former case, |object| can never be an ancestor while in the latter | 166 // the former case, |object| can never be an ancestor while in the latter |
| 166 // the caller is responsible for doing the ancestor check. Because of this, | 167 // the caller is responsible for doing the ancestor check. Because of this, |
| 167 // computing the transform to the SVG root is always what we want to do here. | 168 // computing the transform to the SVG root is always what we want to do here. |
| 168 ASSERT(ancestor != &object); | 169 ASSERT(ancestor != &object); |
| 169 ASSERT(object.isSVGContainer() || object.isSVGShape() || | 170 ASSERT(object.isSVGContainer() || object.isSVGShape() || |
| 170 object.isSVGImage() || object.isSVGText() || | 171 object.isSVGImage() || object.isSVGText() || |
| 171 object.isSVGForeignObject()); | 172 object.isSVGForeignObject()); |
| 172 AffineTransform localToSVGRoot; | 173 AffineTransform localToSVGRoot; |
| 173 const LayoutSVGRoot& svgRoot = | 174 const LayoutSVGRoot& svgRoot = |
| 174 computeTransformToSVGRoot(object, localToSVGRoot); | 175 computeTransformToSVGRoot(object, localToSVGRoot); |
| 175 | 176 |
| 176 MapCoordinatesFlags mode = UseTransforms | ApplyContainerFlip; | 177 MapCoordinatesFlags mode = flags | UseTransforms | ApplyContainerFlip; |
| 177 svgRoot.mapAncestorToLocal(ancestor, transformState, mode); | 178 svgRoot.mapAncestorToLocal(ancestor, transformState, mode); |
| 178 | 179 |
| 179 transformState.applyTransform(localToSVGRoot); | 180 transformState.applyTransform(localToSVGRoot); |
| 180 } | 181 } |
| 181 | 182 |
| 182 const LayoutObject* SVGLayoutSupport::pushMappingToContainer( | 183 const LayoutObject* SVGLayoutSupport::pushMappingToContainer( |
| 183 const LayoutObject* object, | 184 const LayoutObject* object, |
| 184 const LayoutBoxModelObject* ancestorToStopAt, | 185 const LayoutBoxModelObject* ancestorToStopAt, |
| 185 LayoutGeometryMap& geometryMap) { | 186 LayoutGeometryMap& geometryMap) { |
| 186 DCHECK_NE(ancestorToStopAt, object); | 187 DCHECK_NE(ancestorToStopAt, object); |
| (...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 645 } | 646 } |
| 646 | 647 |
| 647 LayoutObject* SVGLayoutSupport::findClosestLayoutSVGText( | 648 LayoutObject* SVGLayoutSupport::findClosestLayoutSVGText( |
| 648 LayoutObject* layoutObject, | 649 LayoutObject* layoutObject, |
| 649 const FloatPoint& point) { | 650 const FloatPoint& point) { |
| 650 return searchTreeForFindClosestLayoutSVGText(layoutObject, point) | 651 return searchTreeForFindClosestLayoutSVGText(layoutObject, point) |
| 651 .candidateLayoutObject; | 652 .candidateLayoutObject; |
| 652 } | 653 } |
| 653 | 654 |
| 654 } // namespace blink | 655 } // namespace blink |
| OLD | NEW |