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

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

Issue 1128143003: Set default SVG image font settings (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Page::ordinaryPages can be empty in tests (ImageResourceTest) Created 5 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « LayoutTests/svg/custom/default-font-settings-expected.html ('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 409 matching lines...) Expand 10 before | Expand all | Expand 10 after
420 // This will become an issue when SVGImage will be able to load other 420 // This will become an issue when SVGImage will be able to load other
421 // SVGImage objects, but we're safe now, because SVGImage can only be 421 // SVGImage objects, but we're safe now, because SVGImage can only be
422 // loaded by a top-level document. 422 // loaded by a top-level document.
423 OwnPtrWillBeRawPtr<Page> page; 423 OwnPtrWillBeRawPtr<Page> page;
424 { 424 {
425 TRACE_EVENT0("blink", "SVGImage::dataChanged::createPage"); 425 TRACE_EVENT0("blink", "SVGImage::dataChanged::createPage");
426 page = adoptPtrWillBeNoop(new Page(pageClients)); 426 page = adoptPtrWillBeNoop(new Page(pageClients));
427 page->settings().setScriptEnabled(false); 427 page->settings().setScriptEnabled(false);
428 page->settings().setPluginsEnabled(false); 428 page->settings().setPluginsEnabled(false);
429 page->settings().setAcceleratedCompositingEnabled(false); 429 page->settings().setAcceleratedCompositingEnabled(false);
430
431 // Because this page is detached, it can't get default font settings
432 // from the embedder. Copy over font settings so we have sensible
433 // defaults. These settings are fixed and will not update if changed .
434 if (!Page::ordinaryPages().isEmpty()) {
435 Settings& defaultSettings = (*Page::ordinaryPages().begin())->se ttings();
436 page->settings().genericFontFamilySettings() = defaultSettings.g enericFontFamilySettings();
437 page->settings().setMinimumFontSize(defaultSettings.minimumFontS ize());
438 page->settings().setMinimumLogicalFontSize(defaultSettings.minim umLogicalFontSize());
439 page->settings().setDefaultFontSize(defaultSettings.defaultFontS ize());
440 page->settings().setDefaultFixedFontSize(defaultSettings.default FixedFontSize());
441 }
430 } 442 }
431 443
432 RefPtrWillBeRawPtr<LocalFrame> frame = nullptr; 444 RefPtrWillBeRawPtr<LocalFrame> frame = nullptr;
433 { 445 {
434 TRACE_EVENT0("blink", "SVGImage::dataChanged::createFrame"); 446 TRACE_EVENT0("blink", "SVGImage::dataChanged::createFrame");
435 frame = LocalFrame::create(dummyFrameLoaderClient, &page->frameHost( ), 0); 447 frame = LocalFrame::create(dummyFrameLoaderClient, &page->frameHost( ), 0);
436 frame->setView(FrameView::create(frame.get())); 448 frame->setView(FrameView::create(frame.get()));
437 frame->init(); 449 frame->init();
438 } 450 }
439 451
(...skipping 16 matching lines...) Expand all
456 468
457 return m_page; 469 return m_page;
458 } 470 }
459 471
460 String SVGImage::filenameExtension() const 472 String SVGImage::filenameExtension() const
461 { 473 {
462 return "svg"; 474 return "svg";
463 } 475 }
464 476
465 } 477 }
OLDNEW
« no previous file with comments | « LayoutTests/svg/custom/default-font-settings-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698