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 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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 Loading... | |
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 } |
OLD | NEW |