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

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: Update expectations 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 416 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 // This will become an issue when SVGImage will be able to load other 427 // This will become an issue when SVGImage will be able to load other
428 // SVGImage objects, but we're safe now, because SVGImage can only be 428 // SVGImage objects, but we're safe now, because SVGImage can only be
429 // loaded by a top-level document. 429 // loaded by a top-level document.
430 OwnPtrWillBeRawPtr<Page> page; 430 OwnPtrWillBeRawPtr<Page> page;
431 { 431 {
432 TRACE_EVENT0("blink", "SVGImage::dataChanged::createPage"); 432 TRACE_EVENT0("blink", "SVGImage::dataChanged::createPage");
433 page = adoptPtrWillBeNoop(new Page(pageClients)); 433 page = adoptPtrWillBeNoop(new Page(pageClients));
434 page->settings().setScriptEnabled(false); 434 page->settings().setScriptEnabled(false);
435 page->settings().setPluginsEnabled(false); 435 page->settings().setPluginsEnabled(false);
436 page->settings().setAcceleratedCompositingEnabled(false); 436 page->settings().setAcceleratedCompositingEnabled(false);
437
438 // Because this page is detached, it can't get default font settings
439 // from the embedder. Copy over font settings so we have sensible
440 // defaults. These settings are fixed and will not update if changed .
441 if (!Page::ordinaryPages().isEmpty()) {
Erik Dahlström 2015/05/17 20:20:15 Under what circumstances can ordinaryPages be empt
pdr. 2015/05/19 02:02:29 I don't think it is possible to have ordinaryPages
442 Settings& defaultSettings = (*Page::ordinaryPages().begin())->se ttings();
Erik Dahlström 2015/05/17 20:20:15 This means svg images can get a different set of d
pdr. 2015/05/19 02:02:29 The defaults for these specific settings shouldn't
443 page->settings().genericFontFamilySettings() = defaultSettings.g enericFontFamilySettings();
444 page->settings().setMinimumFontSize(defaultSettings.minimumFontS ize());
445 page->settings().setMinimumLogicalFontSize(defaultSettings.minim umLogicalFontSize());
446 page->settings().setDefaultFontSize(defaultSettings.defaultFontS ize());
447 page->settings().setDefaultFixedFontSize(defaultSettings.default FixedFontSize());
448 }
437 } 449 }
438 450
439 RefPtrWillBeRawPtr<LocalFrame> frame = nullptr; 451 RefPtrWillBeRawPtr<LocalFrame> frame = nullptr;
440 { 452 {
441 TRACE_EVENT0("blink", "SVGImage::dataChanged::createFrame"); 453 TRACE_EVENT0("blink", "SVGImage::dataChanged::createFrame");
442 frame = LocalFrame::create(dummyFrameLoaderClient, &page->frameHost( ), 0); 454 frame = LocalFrame::create(dummyFrameLoaderClient, &page->frameHost( ), 0);
443 frame->setView(FrameView::create(frame.get())); 455 frame->setView(FrameView::create(frame.get()));
444 frame->init(); 456 frame->init();
445 } 457 }
446 458
(...skipping 16 matching lines...) Expand all
463 475
464 return m_page; 476 return m_page;
465 } 477 }
466 478
467 String SVGImage::filenameExtension() const 479 String SVGImage::filenameExtension() const
468 { 480 {
469 return "svg"; 481 return "svg";
470 } 482 }
471 483
472 } 484 }
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