| 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 #include "core/svg/SVGDocumentExtensions.h" | 44 #include "core/svg/SVGDocumentExtensions.h" |
| 45 #include "core/svg/SVGFEImageElement.h" | 45 #include "core/svg/SVGFEImageElement.h" |
| 46 #include "core/svg/SVGImageElement.h" | 46 #include "core/svg/SVGImageElement.h" |
| 47 #include "core/svg/SVGSVGElement.h" | 47 #include "core/svg/SVGSVGElement.h" |
| 48 #include "core/svg/animation/SMILTimeContainer.h" | 48 #include "core/svg/animation/SMILTimeContainer.h" |
| 49 #include "core/svg/graphics/SVGImageChromeClient.h" | 49 #include "core/svg/graphics/SVGImageChromeClient.h" |
| 50 #include "platform/EventDispatchForbiddenScope.h" | 50 #include "platform/EventDispatchForbiddenScope.h" |
| 51 #include "platform/LengthFunctions.h" | 51 #include "platform/LengthFunctions.h" |
| 52 #include "platform/ScriptForbiddenScope.h" | 52 #include "platform/ScriptForbiddenScope.h" |
| 53 #include "platform/geometry/IntRect.h" | 53 #include "platform/geometry/IntRect.h" |
| 54 #include "platform/graphics/Color.h" |
| 54 #include "platform/graphics/GraphicsContext.h" | 55 #include "platform/graphics/GraphicsContext.h" |
| 55 #include "platform/graphics/ImageBuffer.h" | 56 #include "platform/graphics/ImageBuffer.h" |
| 56 #include "platform/graphics/ImageObserver.h" | 57 #include "platform/graphics/ImageObserver.h" |
| 57 #include "platform/graphics/paint/ClipRecorder.h" | 58 #include "platform/graphics/paint/ClipRecorder.h" |
| 58 #include "platform/graphics/paint/CullRect.h" | 59 #include "platform/graphics/paint/CullRect.h" |
| 59 #include "platform/graphics/paint/DrawingRecorder.h" | 60 #include "platform/graphics/paint/DrawingRecorder.h" |
| 60 #include "platform/graphics/paint/PaintRecord.h" | 61 #include "platform/graphics/paint/PaintRecord.h" |
| 61 #include "platform/graphics/paint/PaintRecordBuilder.h" | 62 #include "platform/graphics/paint/PaintRecordBuilder.h" |
| 62 #include "platform/instrumentation/tracing/TraceEvent.h" | 63 #include "platform/instrumentation/tracing/TraceEvent.h" |
| 63 #include "wtf/PassRefPtr.h" | 64 #include "wtf/PassRefPtr.h" |
| (...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 661 } | 662 } |
| 662 | 663 |
| 663 FrameLoader& loader = frame->loader(); | 664 FrameLoader& loader = frame->loader(); |
| 664 loader.forceSandboxFlags(SandboxAll); | 665 loader.forceSandboxFlags(SandboxAll); |
| 665 | 666 |
| 666 frame->view()->setScrollbarsSuppressed(true); | 667 frame->view()->setScrollbarsSuppressed(true); |
| 667 // SVG Images will always synthesize a viewBox, if it's not available, and | 668 // SVG Images will always synthesize a viewBox, if it's not available, and |
| 668 // thus never see scrollbars. | 669 // thus never see scrollbars. |
| 669 frame->view()->setCanHaveScrollbars(false); | 670 frame->view()->setCanHaveScrollbars(false); |
| 670 // SVG Images are transparent. | 671 // SVG Images are transparent. |
| 671 frame->view()->setTransparent(true); | 672 frame->view()->setBaseBackgroundColor(Color::transparent); |
| 672 | 673 |
| 673 m_page = page; | 674 m_page = page; |
| 674 | 675 |
| 675 TRACE_EVENT0("blink", "SVGImage::dataChanged::load"); | 676 TRACE_EVENT0("blink", "SVGImage::dataChanged::load"); |
| 676 loader.load(FrameLoadRequest( | 677 loader.load(FrameLoadRequest( |
| 677 0, blankURL(), | 678 0, blankURL(), |
| 678 SubstituteData(data(), AtomicString("image/svg+xml"), | 679 SubstituteData(data(), AtomicString("image/svg+xml"), |
| 679 AtomicString("UTF-8"), KURL(), ForceSynchronousLoad))); | 680 AtomicString("UTF-8"), KURL(), ForceSynchronousLoad))); |
| 680 | 681 |
| 681 // Set the concrete object size before a container size is available. | 682 // Set the concrete object size before a container size is available. |
| 682 m_intrinsicSize = roundedIntSize(concreteObjectSize(FloatSize( | 683 m_intrinsicSize = roundedIntSize(concreteObjectSize(FloatSize( |
| 683 LayoutReplaced::defaultWidth, LayoutReplaced::defaultHeight))); | 684 LayoutReplaced::defaultWidth, LayoutReplaced::defaultHeight))); |
| 684 } | 685 } |
| 685 | 686 |
| 686 return m_page ? SizeAvailable : SizeUnavailable; | 687 return m_page ? SizeAvailable : SizeUnavailable; |
| 687 } | 688 } |
| 688 | 689 |
| 689 String SVGImage::filenameExtension() const { | 690 String SVGImage::filenameExtension() const { |
| 690 return "svg"; | 691 return "svg"; |
| 691 } | 692 } |
| 692 | 693 |
| 693 } // namespace blink | 694 } // namespace blink |
| OLD | NEW |