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 | |
433 static FrameLoaderClient* dummyFrameLoaderClient = new EmptyFrameLoaderC
lient; | 427 static FrameLoaderClient* dummyFrameLoaderClient = new EmptyFrameLoaderC
lient; |
434 | 428 |
435 Page::PageClients pageClients; | 429 Page::PageClients pageClients; |
436 fillWithEmptyClients(pageClients); | 430 fillWithEmptyClients(pageClients); |
437 m_chromeClient = adoptPtr(new SVGImageChromeClient(this)); | 431 m_chromeClient = adoptPtr(new SVGImageChromeClient(this)); |
438 pageClients.chromeClient = m_chromeClient.get(); | 432 pageClients.chromeClient = m_chromeClient.get(); |
439 | 433 |
440 // FIXME: If this SVG ends up loading itself, we might leak the world. | 434 // FIXME: If this SVG ends up loading itself, we might leak the world. |
441 // The Cache code does not know about ImageResources holding Frames and | 435 // The Cache code does not know about ImageResources holding Frames and |
442 // won't know to break the cycle. | 436 // won't know to break the cycle. |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
491 | 485 |
492 return m_page; | 486 return m_page; |
493 } | 487 } |
494 | 488 |
495 String SVGImage::filenameExtension() const | 489 String SVGImage::filenameExtension() const |
496 { | 490 { |
497 return "svg"; | 491 return "svg"; |
498 } | 492 } |
499 | 493 |
500 } | 494 } |
OLD | NEW |