| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006 Eric Seidel <eric@webkit.org> | 2 * Copyright (C) 2006 Eric Seidel <eric@webkit.org> |
| 3 * Copyright (C) 2008, 2009 Apple Inc. All rights reserved. | 3 * Copyright (C) 2008, 2009 Apple Inc. All rights reserved. |
| 4 * Copyright (C) Research In Motion Limited 2011. All rights reserved. | 4 * Copyright (C) Research In Motion Limited 2011. All rights reserved. |
| 5 * | 5 * |
| 6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
| 7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
| 8 * are met: | 8 * are met: |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 static float resolveWidthForRatio(float height, const FloatSize& intrinsicRatio) | 161 static float resolveWidthForRatio(float height, const FloatSize& intrinsicRatio) |
| 162 { | 162 { |
| 163 return height * intrinsicRatio.width() / intrinsicRatio.height(); | 163 return height * intrinsicRatio.width() / intrinsicRatio.height(); |
| 164 } | 164 } |
| 165 | 165 |
| 166 static float resolveHeightForRatio(float width, const FloatSize& intrinsicRatio) | 166 static float resolveHeightForRatio(float width, const FloatSize& intrinsicRatio) |
| 167 { | 167 { |
| 168 return width * intrinsicRatio.height() / intrinsicRatio.width(); | 168 return width * intrinsicRatio.height() / intrinsicRatio.width(); |
| 169 } | 169 } |
| 170 | 170 |
| 171 bool SVGImage::hasIntrinsicDimensions() const |
| 172 { |
| 173 return !concreteObjectSize(FloatSize()).isEmpty(); |
| 174 } |
| 175 |
| 171 FloatSize SVGImage::concreteObjectSize(const FloatSize& defaultObjectSize) const | 176 FloatSize SVGImage::concreteObjectSize(const FloatSize& defaultObjectSize) const |
| 172 { | 177 { |
| 173 SVGSVGElement* svg = svgRootElement(m_page.get()); | 178 SVGSVGElement* svg = svgRootElement(m_page.get()); |
| 174 if (!svg) | 179 if (!svg) |
| 175 return FloatSize(); | 180 return FloatSize(); |
| 176 | 181 |
| 177 LayoutSVGRoot* layoutObject = toLayoutSVGRoot(svg->layoutObject()); | 182 LayoutSVGRoot* layoutObject = toLayoutSVGRoot(svg->layoutObject()); |
| 178 if (!layoutObject) | 183 if (!layoutObject) |
| 179 return FloatSize(); | 184 return FloatSize(); |
| 180 | 185 |
| (...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 537 | 542 |
| 538 return m_page; | 543 return m_page; |
| 539 } | 544 } |
| 540 | 545 |
| 541 String SVGImage::filenameExtension() const | 546 String SVGImage::filenameExtension() const |
| 542 { | 547 { |
| 543 return "svg"; | 548 return "svg"; |
| 544 } | 549 } |
| 545 | 550 |
| 546 } // namespace blink | 551 } // namespace blink |
| OLD | NEW |