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 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
427 | 427 |
428 if (allDataReceived) { | 428 if (allDataReceived) { |
429 // SVGImage will fire events (and the default C++ handlers run) but does
n't | 429 // SVGImage will fire events (and the default C++ handlers run) but does
n't |
430 // actually allow script to run so it's fine to call into it. We allow t
his | 430 // actually allow script to run so it's fine to call into it. We allow t
his |
431 // since it means an SVG data url can synchronously load like other imag
e | 431 // since it means an SVG data url can synchronously load like other imag
e |
432 // types. | 432 // types. |
433 EventDispatchForbiddenScope::AllowUserAgentEvents allowUserAgentEvents; | 433 EventDispatchForbiddenScope::AllowUserAgentEvents allowUserAgentEvents; |
434 | 434 |
435 DEFINE_STATIC_LOCAL(OwnPtrWillBePersistent<FrameLoaderClient>, dummyFram
eLoaderClient, (EmptyFrameLoaderClient::create())); | 435 DEFINE_STATIC_LOCAL(OwnPtrWillBePersistent<FrameLoaderClient>, dummyFram
eLoaderClient, (EmptyFrameLoaderClient::create())); |
436 | 436 |
| 437 if (m_page) { |
| 438 toLocalFrame(m_page->mainFrame())->loader().load(FrameLoadRequest(0,
blankURL(), SubstituteData(data(), AtomicString("image/svg+xml", AtomicString::
ConstructFromLiteral), |
| 439 AtomicString("UTF-8", AtomicString::ConstructFromLiteral), KURL(
), ForceSynchronousLoad))); |
| 440 return true; |
| 441 } |
| 442 |
437 Page::PageClients pageClients; | 443 Page::PageClients pageClients; |
438 fillWithEmptyClients(pageClients); | 444 fillWithEmptyClients(pageClients); |
439 m_chromeClient = SVGImageChromeClient::create(this); | 445 m_chromeClient = SVGImageChromeClient::create(this); |
440 pageClients.chromeClient = m_chromeClient.get(); | 446 pageClients.chromeClient = m_chromeClient.get(); |
441 | 447 |
442 // FIXME: If this SVG ends up loading itself, we might leak the world. | 448 // FIXME: If this SVG ends up loading itself, we might leak the world. |
443 // The Cache code does not know about ImageResources holding Frames and | 449 // The Cache code does not know about ImageResources holding Frames and |
444 // won't know to break the cycle. | 450 // won't know to break the cycle. |
445 // This will become an issue when SVGImage will be able to load other | 451 // This will become an issue when SVGImage will be able to load other |
446 // SVGImage objects, but we're safe now, because SVGImage can only be | 452 // SVGImage objects, but we're safe now, because SVGImage can only be |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
493 | 499 |
494 return m_page; | 500 return m_page; |
495 } | 501 } |
496 | 502 |
497 String SVGImage::filenameExtension() const | 503 String SVGImage::filenameExtension() const |
498 { | 504 { |
499 return "svg"; | 505 return "svg"; |
500 } | 506 } |
501 | 507 |
502 } | 508 } |
OLD | NEW |