| 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 18 matching lines...) Expand all Loading... |
| 29 #include "core/layout/Layer.h" | 29 #include "core/layout/Layer.h" |
| 30 #include "core/layout/LayoutGeometryMap.h" | 30 #include "core/layout/LayoutGeometryMap.h" |
| 31 #include "core/layout/PaintInfo.h" | 31 #include "core/layout/PaintInfo.h" |
| 32 #include "core/layout/SubtreeLayoutScope.h" | 32 #include "core/layout/SubtreeLayoutScope.h" |
| 33 #include "core/layout/svg/LayoutSVGInlineText.h" | 33 #include "core/layout/svg/LayoutSVGInlineText.h" |
| 34 #include "core/layout/svg/LayoutSVGResourceClipper.h" | 34 #include "core/layout/svg/LayoutSVGResourceClipper.h" |
| 35 #include "core/layout/svg/LayoutSVGResourceFilter.h" | 35 #include "core/layout/svg/LayoutSVGResourceFilter.h" |
| 36 #include "core/layout/svg/LayoutSVGResourceMasker.h" | 36 #include "core/layout/svg/LayoutSVGResourceMasker.h" |
| 37 #include "core/layout/svg/LayoutSVGShape.h" | 37 #include "core/layout/svg/LayoutSVGShape.h" |
| 38 #include "core/layout/svg/LayoutSVGText.h" | 38 #include "core/layout/svg/LayoutSVGText.h" |
| 39 #include "core/layout/svg/LayoutSVGViewportContainer.h" |
| 39 #include "core/layout/svg/SVGResources.h" | 40 #include "core/layout/svg/SVGResources.h" |
| 40 #include "core/layout/svg/SVGResourcesCache.h" | 41 #include "core/layout/svg/SVGResourcesCache.h" |
| 41 #include "core/rendering/svg/RenderSVGRoot.h" | 42 #include "core/rendering/svg/RenderSVGRoot.h" |
| 42 #include "core/rendering/svg/RenderSVGViewportContainer.h" | |
| 43 #include "core/svg/SVGElement.h" | 43 #include "core/svg/SVGElement.h" |
| 44 #include "platform/geometry/TransformState.h" | 44 #include "platform/geometry/TransformState.h" |
| 45 | 45 |
| 46 namespace blink { | 46 namespace blink { |
| 47 | 47 |
| 48 static inline LayoutRect enclosingIntRectIfNotEmpty(const FloatRect& rect) | 48 static inline LayoutRect enclosingIntRectIfNotEmpty(const FloatRect& rect) |
| 49 { | 49 { |
| 50 if (rect.isEmpty()) | 50 if (rect.isEmpty()) |
| 51 return LayoutRect(); | 51 return LayoutRect(); |
| 52 return enclosingIntRect(rect); | 52 return enclosingIntRect(rect); |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 } | 200 } |
| 201 | 201 |
| 202 inline bool SVGLayoutSupport::layoutSizeOfNearestViewportChanged(const LayoutObj
ect* start) | 202 inline bool SVGLayoutSupport::layoutSizeOfNearestViewportChanged(const LayoutObj
ect* start) |
| 203 { | 203 { |
| 204 while (start && !start->isSVGRoot() && !start->isSVGViewportContainer()) | 204 while (start && !start->isSVGRoot() && !start->isSVGViewportContainer()) |
| 205 start = start->parent(); | 205 start = start->parent(); |
| 206 | 206 |
| 207 ASSERT(start); | 207 ASSERT(start); |
| 208 ASSERT(start->isSVGRoot() || start->isSVGViewportContainer()); | 208 ASSERT(start->isSVGRoot() || start->isSVGViewportContainer()); |
| 209 if (start->isSVGViewportContainer()) | 209 if (start->isSVGViewportContainer()) |
| 210 return toRenderSVGViewportContainer(start)->isLayoutSizeChanged(); | 210 return toLayoutSVGViewportContainer(start)->isLayoutSizeChanged(); |
| 211 | 211 |
| 212 return toRenderSVGRoot(start)->isLayoutSizeChanged(); | 212 return toRenderSVGRoot(start)->isLayoutSizeChanged(); |
| 213 } | 213 } |
| 214 | 214 |
| 215 bool SVGLayoutSupport::transformToRootChanged(LayoutObject* ancestor) | 215 bool SVGLayoutSupport::transformToRootChanged(LayoutObject* ancestor) |
| 216 { | 216 { |
| 217 while (ancestor && !ancestor->isSVGRoot()) { | 217 while (ancestor && !ancestor->isSVGRoot()) { |
| 218 if (ancestor->isSVGTransformableContainer()) | 218 if (ancestor->isSVGTransformableContainer()) |
| 219 return toLayoutSVGContainer(ancestor)->didTransformToRootUpdate(); | 219 return toLayoutSVGContainer(ancestor)->didTransformToRootUpdate(); |
| 220 if (ancestor->isSVGViewportContainer()) | 220 if (ancestor->isSVGViewportContainer()) |
| 221 return toRenderSVGViewportContainer(ancestor)->didTransformToRootUpd
ate(); | 221 return toLayoutSVGViewportContainer(ancestor)->didTransformToRootUpd
ate(); |
| 222 ancestor = ancestor->parent(); | 222 ancestor = ancestor->parent(); |
| 223 } | 223 } |
| 224 | 224 |
| 225 return false; | 225 return false; |
| 226 } | 226 } |
| 227 | 227 |
| 228 void SVGLayoutSupport::layoutChildren(LayoutObject* start, bool selfNeedsLayout) | 228 void SVGLayoutSupport::layoutChildren(LayoutObject* start, bool selfNeedsLayout) |
| 229 { | 229 { |
| 230 // When hasRelativeLengths() is false, no descendants have relative lengths | 230 // When hasRelativeLengths() is false, no descendants have relative lengths |
| 231 // (hence no one is interested in viewport size changes). | 231 // (hence no one is interested in viewport size changes). |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 510 | 510 |
| 511 layer = layer->parent(); | 511 layer = layer->parent(); |
| 512 } | 512 } |
| 513 | 513 |
| 514 ctm.scale(deviceScaleFactor); | 514 ctm.scale(deviceScaleFactor); |
| 515 | 515 |
| 516 return narrowPrecisionToFloat(sqrt((pow(ctm.xScale(), 2) + pow(ctm.yScale(),
2)) / 2)); | 516 return narrowPrecisionToFloat(sqrt((pow(ctm.xScale(), 2) + pow(ctm.yScale(),
2)) / 2)); |
| 517 } | 517 } |
| 518 | 518 |
| 519 } | 519 } |
| OLD | NEW |