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

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

Issue 1832333003: (1) Finish font subresource loading of SVG synchronously in SVGImage::dataChanged() Base URL: https://chromium.googlesource.com/chromium/src.git@SVG_new2_0
Patch Set: Rebase. Created 4 years, 8 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
« no previous file with comments | « third_party/WebKit/LayoutTests/svg/as-image/resources/data-font-in-css-invalid-font.svg ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 10 matching lines...) Expand all
21 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 21 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
22 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 22 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
23 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */ 26 */
27 27
28 #include "core/svg/graphics/SVGImage.h" 28 #include "core/svg/graphics/SVGImage.h"
29 29
30 #include "core/animation/AnimationTimeline.h" 30 #include "core/animation/AnimationTimeline.h"
31 #include "core/css/CSSFontSelector.h"
31 #include "core/dom/NodeTraversal.h" 32 #include "core/dom/NodeTraversal.h"
33 #include "core/dom/StyleEngine.h"
32 #include "core/dom/shadow/FlatTreeTraversal.h" 34 #include "core/dom/shadow/FlatTreeTraversal.h"
35 #include "core/fetch/ResourceFetcher.h"
33 #include "core/frame/Deprecation.h" 36 #include "core/frame/Deprecation.h"
34 #include "core/frame/FrameView.h" 37 #include "core/frame/FrameView.h"
35 #include "core/frame/LocalFrame.h" 38 #include "core/frame/LocalFrame.h"
36 #include "core/frame/Settings.h" 39 #include "core/frame/Settings.h"
37 #include "core/style/ComputedStyle.h" 40 #include "core/style/ComputedStyle.h"
38 #include "core/layout/svg/LayoutSVGRoot.h" 41 #include "core/layout/svg/LayoutSVGRoot.h"
39 #include "core/loader/FrameLoadRequest.h" 42 #include "core/loader/FrameLoadRequest.h"
40 #include "core/paint/FloatClipRecorder.h" 43 #include "core/paint/FloatClipRecorder.h"
41 #include "core/paint/TransformRecorder.h" 44 #include "core/paint/TransformRecorder.h"
42 #include "core/svg/SVGDocumentExtensions.h" 45 #include "core/svg/SVGDocumentExtensions.h"
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after
525 frame->view()->setTransparent(true); // SVG Images are transparent. 528 frame->view()->setTransparent(true); // SVG Images are transparent.
526 529
527 m_page = page.release(); 530 m_page = page.release();
528 531
529 TRACE_EVENT0("blink", "SVGImage::dataChanged::load"); 532 TRACE_EVENT0("blink", "SVGImage::dataChanged::load");
530 loader.load(FrameLoadRequest(0, blankURL(), SubstituteData(data(), Atomi cString("image/svg+xml"), 533 loader.load(FrameLoadRequest(0, blankURL(), SubstituteData(data(), Atomi cString("image/svg+xml"),
531 AtomicString("UTF-8"), KURL(), ForceSynchronousLoad))); 534 AtomicString("UTF-8"), KURL(), ForceSynchronousLoad)));
532 535
533 // Set the concrete object size before a container size is available. 536 // Set the concrete object size before a container size is available.
534 m_intrinsicSize = roundedIntSize(concreteObjectSize(FloatSize(300, 150)) ); 537 m_intrinsicSize = roundedIntSize(concreteObjectSize(FloatSize(300, 150)) );
538
539 // Forces pending font loading to start (and we assume loading completes sychronously here).
540 toLocalFrame(m_page->mainFrame())->document()->styleEngine().fontSelecto r()->fontLoader()->loadPendingFonts();
535 } 541 }
536 542
537 return m_page; 543 return m_page;
538 } 544 }
539 545
540 String SVGImage::filenameExtension() const 546 String SVGImage::filenameExtension() const
541 { 547 {
542 return "svg"; 548 return "svg";
543 } 549 }
544 550
545 } // namespace blink 551 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/svg/as-image/resources/data-font-in-css-invalid-font.svg ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698