Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(179)

Side by Side Diff: third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp

Issue 2715243004: [blink] Support (semi-)transparent background colors in WebView/Frame. (Closed)
Patch Set: address comments Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 617 matching lines...) Expand 10 before | Expand all | Expand 10 after
681 } 682 }
682 683
683 FrameLoader& loader = frame->loader(); 684 FrameLoader& loader = frame->loader();
684 loader.forceSandboxFlags(SandboxAll); 685 loader.forceSandboxFlags(SandboxAll);
685 686
686 frame->view()->setScrollbarsSuppressed(true); 687 frame->view()->setScrollbarsSuppressed(true);
687 // SVG Images will always synthesize a viewBox, if it's not available, and 688 // SVG Images will always synthesize a viewBox, if it's not available, and
688 // thus never see scrollbars. 689 // thus never see scrollbars.
689 frame->view()->setCanHaveScrollbars(false); 690 frame->view()->setCanHaveScrollbars(false);
690 // SVG Images are transparent. 691 // SVG Images are transparent.
691 frame->view()->setTransparent(true); 692 frame->view()->setBaseBackgroundColor(Color::transparent);
692 693
693 m_page = page; 694 m_page = page;
694 695
695 TRACE_EVENT0("blink", "SVGImage::dataChanged::load"); 696 TRACE_EVENT0("blink", "SVGImage::dataChanged::load");
696 loader.load(FrameLoadRequest( 697 loader.load(FrameLoadRequest(
697 0, blankURL(), 698 0, blankURL(),
698 SubstituteData(data(), AtomicString("image/svg+xml"), 699 SubstituteData(data(), AtomicString("image/svg+xml"),
699 AtomicString("UTF-8"), KURL(), ForceSynchronousLoad))); 700 AtomicString("UTF-8"), KURL(), ForceSynchronousLoad)));
700 701
701 // Set the concrete object size before a container size is available. 702 // Set the concrete object size before a container size is available.
702 m_intrinsicSize = roundedIntSize(concreteObjectSize(FloatSize( 703 m_intrinsicSize = roundedIntSize(concreteObjectSize(FloatSize(
703 LayoutReplaced::defaultWidth, LayoutReplaced::defaultHeight))); 704 LayoutReplaced::defaultWidth, LayoutReplaced::defaultHeight)));
704 } 705 }
705 706
706 return m_page ? SizeAvailable : SizeUnavailable; 707 return m_page ? SizeAvailable : SizeUnavailable;
707 } 708 }
708 709
709 String SVGImage::filenameExtension() const { 710 String SVGImage::filenameExtension() const {
710 return "svg"; 711 return "svg";
711 } 712 }
712 713
713 } // namespace blink 714 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698