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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 } | 121 } |
122 | 122 |
123 // Because SVG image rendering disallows external resources and links, these | 123 // Because SVG image rendering disallows external resources and links, these |
124 // images effectively are restricted to a single security origin. | 124 // images effectively are restricted to a single security origin. |
125 return true; | 125 return true; |
126 } | 126 } |
127 | 127 |
128 static SVGSVGElement* svgRootElement(Page* page) | 128 static SVGSVGElement* svgRootElement(Page* page) |
129 { | 129 { |
130 if (!page) | 130 if (!page) |
131 return 0; | 131 return nullptr; |
132 LocalFrame* frame = toLocalFrame(page->mainFrame()); | 132 LocalFrame* frame = toLocalFrame(page->mainFrame()); |
133 return frame->document()->accessSVGExtensions().rootElement(); | 133 return frame->document()->accessSVGExtensions().rootElement(); |
134 } | 134 } |
135 | 135 |
136 void SVGImage::setContainerSize(const IntSize& size) | 136 void SVGImage::setContainerSize(const IntSize& size) |
137 { | 137 { |
138 if (!usesContainerSize()) | 138 if (!usesContainerSize()) |
139 return; | 139 return; |
140 | 140 |
141 SVGSVGElement* rootElement = svgRootElement(m_page.get()); | 141 SVGSVGElement* rootElement = svgRootElement(m_page.get()); |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 // Start any (SMIL) animations if needed. This will restart or continue | 322 // Start any (SMIL) animations if needed. This will restart or continue |
323 // animations if preceded by calls to resetAnimation or stopAnimation | 323 // animations if preceded by calls to resetAnimation or stopAnimation |
324 // respectively. | 324 // respectively. |
325 startAnimation(); | 325 startAnimation(); |
326 } | 326 } |
327 | 327 |
328 LayoutBox* SVGImage::embeddedContentBox() const | 328 LayoutBox* SVGImage::embeddedContentBox() const |
329 { | 329 { |
330 SVGSVGElement* rootElement = svgRootElement(m_page.get()); | 330 SVGSVGElement* rootElement = svgRootElement(m_page.get()); |
331 if (!rootElement) | 331 if (!rootElement) |
332 return 0; | 332 return nullptr; |
333 return toLayoutBox(rootElement->layoutObject()); | 333 return toLayoutBox(rootElement->layoutObject()); |
334 } | 334 } |
335 | 335 |
336 FrameView* SVGImage::frameView() const | 336 FrameView* SVGImage::frameView() const |
337 { | 337 { |
338 if (!m_page) | 338 if (!m_page) |
339 return 0; | 339 return nullptr; |
340 | 340 |
341 return toLocalFrame(m_page->mainFrame())->view(); | 341 return toLocalFrame(m_page->mainFrame())->view(); |
342 } | 342 } |
343 | 343 |
344 void SVGImage::computeIntrinsicDimensions(Length& intrinsicWidth, Length& intrin
sicHeight, FloatSize& intrinsicRatio) | 344 void SVGImage::computeIntrinsicDimensions(Length& intrinsicWidth, Length& intrin
sicHeight, FloatSize& intrinsicRatio) |
345 { | 345 { |
346 SVGSVGElement* rootElement = svgRootElement(m_page.get()); | 346 SVGSVGElement* rootElement = svgRootElement(m_page.get()); |
347 if (!rootElement) | 347 if (!rootElement) |
348 return; | 348 return; |
349 | 349 |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
459 | 459 |
460 return m_page; | 460 return m_page; |
461 } | 461 } |
462 | 462 |
463 String SVGImage::filenameExtension() const | 463 String SVGImage::filenameExtension() const |
464 { | 464 { |
465 return "svg"; | 465 return "svg"; |
466 } | 466 } |
467 | 467 |
468 } | 468 } |
OLD | NEW |