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