| 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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 | 116 |
| 117 void SVGImage::setContainerSize(const IntSize& size) | 117 void SVGImage::setContainerSize(const IntSize& size) |
| 118 { | 118 { |
| 119 if (!m_page || !usesContainerSize()) | 119 if (!m_page || !usesContainerSize()) |
| 120 return; | 120 return; |
| 121 | 121 |
| 122 LocalFrame* frame = m_page->mainFrame(); | 122 LocalFrame* frame = m_page->mainFrame(); |
| 123 SVGSVGElement* rootElement = toSVGDocument(frame->document())->rootElement()
; | 123 SVGSVGElement* rootElement = toSVGDocument(frame->document())->rootElement()
; |
| 124 if (!rootElement) | 124 if (!rootElement) |
| 125 return; | 125 return; |
| 126 RenderSVGRoot* renderer = toRenderSVGRoot(rootElement->renderer()); | |
| 127 if (!renderer) | |
| 128 return; | |
| 129 | 126 |
| 130 FrameView* view = frameView(); | 127 FrameView* view = frameView(); |
| 131 view->resize(this->containerSize()); | 128 view->resize(this->containerSize()); |
| 132 | 129 |
| 130 RenderSVGRoot* renderer = toRenderSVGRoot(rootElement->renderer()); |
| 131 if (!renderer) |
| 132 return; |
| 133 renderer->setContainerSize(size); | 133 renderer->setContainerSize(size); |
| 134 } | 134 } |
| 135 | 135 |
| 136 IntSize SVGImage::containerSize() const | 136 IntSize SVGImage::containerSize() const |
| 137 { | 137 { |
| 138 if (!m_page) | 138 if (!m_page) |
| 139 return IntSize(); | 139 return IntSize(); |
| 140 LocalFrame* frame = m_page->mainFrame(); | 140 LocalFrame* frame = m_page->mainFrame(); |
| 141 SVGSVGElement* rootElement = toSVGDocument(frame->document())->rootElement()
; | 141 SVGSVGElement* rootElement = toSVGDocument(frame->document())->rootElement()
; |
| 142 if (!rootElement) | 142 if (!rootElement) |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 414 | 414 |
| 415 return m_page; | 415 return m_page; |
| 416 } | 416 } |
| 417 | 417 |
| 418 String SVGImage::filenameExtension() const | 418 String SVGImage::filenameExtension() const |
| 419 { | 419 { |
| 420 return "svg"; | 420 return "svg"; |
| 421 } | 421 } |
| 422 | 422 |
| 423 } | 423 } |
| OLD | NEW |