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