| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org> |
| 3 * Copyright (C) 2004, 2005, 2007, 2008, 2009 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2007, 2008, 2009 Rob Buis <buis@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. | 5 * Copyright (C) 2009 Google, Inc. |
| 6 * Copyright (C) Research In Motion Limited 2011. All rights reserved. | 6 * Copyright (C) Research In Motion Limited 2011. All rights reserved. |
| 7 * | 7 * |
| 8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
| 9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
| 10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 intrinsicSize.setHeight(floatValueForLength(intrinsicHeightAttribute
, 0)); | 85 intrinsicSize.setHeight(floatValueForLength(intrinsicHeightAttribute
, 0)); |
| 86 if (!intrinsicSize.isEmpty()) | 86 if (!intrinsicSize.isEmpty()) |
| 87 intrinsicRatio = intrinsicSize.width() / static_cast<double>(intrins
icSize.height()); | 87 intrinsicRatio = intrinsicSize.width() / static_cast<double>(intrins
icSize.height()); |
| 88 return; | 88 return; |
| 89 } | 89 } |
| 90 | 90 |
| 91 // - If either/both of the ‘width’ and ‘height’ of the rootmost ‘svg’ elemen
t are in percentage units (or omitted), the | 91 // - If either/both of the ‘width’ and ‘height’ of the rootmost ‘svg’ elemen
t are in percentage units (or omitted), the |
| 92 // aspect ratio is calculated from the width and height values of the ‘vie
wBox’ specified for the current SVG document | 92 // aspect ratio is calculated from the width and height values of the ‘vie
wBox’ specified for the current SVG document |
| 93 // fragment. If the ‘viewBox’ is not correctly specified, or set to 'none'
, the intrinsic aspect ratio cannot be | 93 // fragment. If the ‘viewBox’ is not correctly specified, or set to 'none'
, the intrinsic aspect ratio cannot be |
| 94 // calculated and is considered unspecified. | 94 // calculated and is considered unspecified. |
| 95 intrinsicSize = svg->viewBoxCurrentValue().size(); | 95 intrinsicSize = svg->viewBox()->currentValue()->value().size(); |
| 96 if (!intrinsicSize.isEmpty()) { | 96 if (!intrinsicSize.isEmpty()) { |
| 97 // The viewBox can only yield an intrinsic ratio, not an intrinsic size. | 97 // The viewBox can only yield an intrinsic ratio, not an intrinsic size. |
| 98 intrinsicRatio = intrinsicSize.width() / static_cast<double>(intrinsicSi
ze.height()); | 98 intrinsicRatio = intrinsicSize.width() / static_cast<double>(intrinsicSi
ze.height()); |
| 99 intrinsicSize = FloatSize(); | 99 intrinsicSize = FloatSize(); |
| 100 return; | 100 return; |
| 101 } | 101 } |
| 102 | 102 |
| 103 // If our intrinsic size is in percentage units, return those to the caller
through the intrinsicSize. Notify the caller | 103 // If our intrinsic size is in percentage units, return those to the caller
through the intrinsicSize. Notify the caller |
| 104 // about the special situation, by setting isPercentageIntrinsicSize=true, s
o it knows how to interpret the return values. | 104 // about the special situation, by setting isPercentageIntrinsicSize=true, s
o it knows how to interpret the return values. |
| 105 if (intrinsicWidthAttribute.isPercent() && intrinsicHeightAttribute.isPercen
t()) { | 105 if (intrinsicWidthAttribute.isPercent() && intrinsicHeightAttribute.isPercen
t()) { |
| (...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 438 | 438 |
| 439 bool RenderSVGRoot::hasRelativeLogicalHeight() const | 439 bool RenderSVGRoot::hasRelativeLogicalHeight() const |
| 440 { | 440 { |
| 441 SVGSVGElement* svg = toSVGSVGElement(node()); | 441 SVGSVGElement* svg = toSVGSVGElement(node()); |
| 442 ASSERT(svg); | 442 ASSERT(svg); |
| 443 | 443 |
| 444 return svg->intrinsicHeight(SVGSVGElement::IgnoreCSSProperties).isPercent(); | 444 return svg->intrinsicHeight(SVGSVGElement::IgnoreCSSProperties).isPercent(); |
| 445 } | 445 } |
| 446 | 446 |
| 447 } | 447 } |
| OLD | NEW |