| 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 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 384 m_chromeClient = adoptPtr(new SVGImageChromeClient(this)); | 384 m_chromeClient = adoptPtr(new SVGImageChromeClient(this)); |
| 385 pageClients.chromeClient = m_chromeClient.get(); | 385 pageClients.chromeClient = m_chromeClient.get(); |
| 386 | 386 |
| 387 // FIXME: If this SVG ends up loading itself, we might leak the world. | 387 // FIXME: If this SVG ends up loading itself, we might leak the world. |
| 388 // The Cache code does not know about ImageResources holding Frames and | 388 // The Cache code does not know about ImageResources holding Frames and |
| 389 // won't know to break the cycle. | 389 // won't know to break the cycle. |
| 390 // This will become an issue when SVGImage will be able to load other | 390 // This will become an issue when SVGImage will be able to load other |
| 391 // SVGImage objects, but we're safe now, because SVGImage can only be | 391 // SVGImage objects, but we're safe now, because SVGImage can only be |
| 392 // loaded by a top-level document. | 392 // loaded by a top-level document. |
| 393 m_page = adoptPtr(new Page(pageClients)); | 393 m_page = adoptPtr(new Page(pageClients)); |
| 394 m_page->settings().setMediaEnabled(false); | |
| 395 m_page->settings().setScriptEnabled(false); | 394 m_page->settings().setScriptEnabled(false); |
| 396 m_page->settings().setPluginsEnabled(false); | 395 m_page->settings().setPluginsEnabled(false); |
| 397 m_page->settings().setAcceleratedCompositingEnabled(false); | 396 m_page->settings().setAcceleratedCompositingEnabled(false); |
| 398 | 397 |
| 399 RefPtr<Frame> frame = Frame::create(FrameInit::create(0, &m_page->frameH
ost(), dummyFrameLoaderClient)); | 398 RefPtr<Frame> frame = Frame::create(FrameInit::create(0, &m_page->frameH
ost(), dummyFrameLoaderClient)); |
| 400 frame->setView(FrameView::create(frame.get())); | 399 frame->setView(FrameView::create(frame.get())); |
| 401 frame->init(); | 400 frame->init(); |
| 402 FrameLoader& loader = frame->loader(); | 401 FrameLoader& loader = frame->loader(); |
| 403 loader.forceSandboxFlags(SandboxAll); | 402 loader.forceSandboxFlags(SandboxAll); |
| 404 | 403 |
| 405 frame->view()->setScrollbarsSuppressed(true); | 404 frame->view()->setScrollbarsSuppressed(true); |
| 406 frame->view()->setCanHaveScrollbars(false); // SVG Images will always sy
nthesize a viewBox, if it's not available, and thus never see scrollbars. | 405 frame->view()->setCanHaveScrollbars(false); // SVG Images will always sy
nthesize a viewBox, if it's not available, and thus never see scrollbars. |
| 407 frame->view()->setTransparent(true); // SVG Images are transparent. | 406 frame->view()->setTransparent(true); // SVG Images are transparent. |
| 408 | 407 |
| 409 loader.load(FrameLoadRequest(0, blankURL(), SubstituteData(data(), "imag
e/svg+xml", "UTF-8", KURL(), ForceSynchronousLoad))); | 408 loader.load(FrameLoadRequest(0, blankURL(), SubstituteData(data(), "imag
e/svg+xml", "UTF-8", KURL(), ForceSynchronousLoad))); |
| 410 // Set the intrinsic size before a container size is available. | 409 // Set the intrinsic size before a container size is available. |
| 411 m_intrinsicSize = containerSize(); | 410 m_intrinsicSize = containerSize(); |
| 412 } | 411 } |
| 413 | 412 |
| 414 return m_page; | 413 return m_page; |
| 415 } | 414 } |
| 416 | 415 |
| 417 String SVGImage::filenameExtension() const | 416 String SVGImage::filenameExtension() const |
| 418 { | 417 { |
| 419 return "svg"; | 418 return "svg"; |
| 420 } | 419 } |
| 421 | 420 |
| 422 } | 421 } |
| OLD | NEW |