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 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
417 if (!data()->size()) | 417 if (!data()->size()) |
418 return true; | 418 return true; |
419 | 419 |
420 if (allDataReceived) { | 420 if (allDataReceived) { |
421 // SVGImage will fire events (and the default C++ handlers run) but does
n't | 421 // SVGImage will fire events (and the default C++ handlers run) but does
n't |
422 // actually allow script to run so it's fine to call into it. We allow t
his | 422 // actually allow script to run so it's fine to call into it. We allow t
his |
423 // since it means an SVG data url can synchronously load like other imag
e | 423 // since it means an SVG data url can synchronously load like other imag
e |
424 // types. | 424 // types. |
425 EventDispatchForbiddenScope::AllowUserAgentEvents allowUserAgentEvents; | 425 EventDispatchForbiddenScope::AllowUserAgentEvents allowUserAgentEvents; |
426 | 426 |
| 427 if (m_page) { |
| 428 toLocalFrame(m_page->mainFrame())->loader().load(FrameLoadRequest(0,
blankURL(), SubstituteData(data(), AtomicString("image/svg+xml", AtomicString::
ConstructFromLiteral), |
| 429 AtomicString("UTF-8", AtomicString::ConstructFromLiteral), KURL(
), ForceSynchronousLoad))); |
| 430 return true; |
| 431 } |
| 432 |
427 static FrameLoaderClient* dummyFrameLoaderClient = new EmptyFrameLoaderC
lient; | 433 static FrameLoaderClient* dummyFrameLoaderClient = new EmptyFrameLoaderC
lient; |
428 | 434 |
429 Page::PageClients pageClients; | 435 Page::PageClients pageClients; |
430 fillWithEmptyClients(pageClients); | 436 fillWithEmptyClients(pageClients); |
431 m_chromeClient = adoptPtr(new SVGImageChromeClient(this)); | 437 m_chromeClient = adoptPtr(new SVGImageChromeClient(this)); |
432 pageClients.chromeClient = m_chromeClient.get(); | 438 pageClients.chromeClient = m_chromeClient.get(); |
433 | 439 |
434 // FIXME: If this SVG ends up loading itself, we might leak the world. | 440 // FIXME: If this SVG ends up loading itself, we might leak the world. |
435 // The Cache code does not know about ImageResources holding Frames and | 441 // The Cache code does not know about ImageResources holding Frames and |
436 // won't know to break the cycle. | 442 // won't know to break the cycle. |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
485 | 491 |
486 return m_page; | 492 return m_page; |
487 } | 493 } |
488 | 494 |
489 String SVGImage::filenameExtension() const | 495 String SVGImage::filenameExtension() const |
490 { | 496 { |
491 return "svg"; | 497 return "svg"; |
492 } | 498 } |
493 | 499 |
494 } | 500 } |
OLD | NEW |