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

Side by Side Diff: Source/core/page/Page.cpp

Issue 215503003: Reland text autosizing changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 9 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All R ights Reserved. 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All R ights Reserved.
3 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 3 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 #include "core/page/ChromeClient.h" 44 #include "core/page/ChromeClient.h"
45 #include "core/page/ContextMenuController.h" 45 #include "core/page/ContextMenuController.h"
46 #include "core/page/DragController.h" 46 #include "core/page/DragController.h"
47 #include "core/page/FocusController.h" 47 #include "core/page/FocusController.h"
48 #include "core/page/FrameTree.h" 48 #include "core/page/FrameTree.h"
49 #include "core/page/PageLifecycleNotifier.h" 49 #include "core/page/PageLifecycleNotifier.h"
50 #include "core/page/PointerLockController.h" 50 #include "core/page/PointerLockController.h"
51 #include "core/page/StorageClient.h" 51 #include "core/page/StorageClient.h"
52 #include "core/page/ValidationMessageClient.h" 52 #include "core/page/ValidationMessageClient.h"
53 #include "core/page/scrolling/ScrollingCoordinator.h" 53 #include "core/page/scrolling/ScrollingCoordinator.h"
54 #include "core/rendering/FastTextAutosizer.h"
54 #include "core/rendering/RenderView.h" 55 #include "core/rendering/RenderView.h"
55 #include "core/rendering/TextAutosizer.h" 56 #include "core/rendering/TextAutosizer.h"
56 #include "core/storage/StorageNamespace.h" 57 #include "core/storage/StorageNamespace.h"
57 #include "platform/plugins/PluginData.h" 58 #include "platform/plugins/PluginData.h"
58 #include "wtf/HashMap.h" 59 #include "wtf/HashMap.h"
59 #include "wtf/RefCountedLeakCounter.h" 60 #include "wtf/RefCountedLeakCounter.h"
60 #include "wtf/StdLibExtras.h" 61 #include "wtf/StdLibExtras.h"
61 #include "wtf/text/Base64.h" 62 #include "wtf/text/Base64.h"
62 63
63 namespace WebCore { 64 namespace WebCore {
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after
481 (*it)->multisamplingChanged(m_settings->openGLMultisamplingEnabled() ); 482 (*it)->multisamplingChanged(m_settings->openGLMultisamplingEnabled() );
482 break; 483 break;
483 } 484 }
484 case SettingsDelegate::ImageLoadingChange: 485 case SettingsDelegate::ImageLoadingChange:
485 for (LocalFrame* frame = mainFrame(); frame; frame = frame->tree().trave rseNext()) { 486 for (LocalFrame* frame = mainFrame(); frame; frame = frame->tree().trave rseNext()) {
486 frame->document()->fetcher()->setImagesEnabled(settings().imagesEnab led()); 487 frame->document()->fetcher()->setImagesEnabled(settings().imagesEnab led());
487 frame->document()->fetcher()->setAutoLoadImages(settings().loadsImag esAutomatically()); 488 frame->document()->fetcher()->setAutoLoadImages(settings().loadsImag esAutomatically());
488 } 489 }
489 break; 490 break;
490 case SettingsDelegate::TextAutosizingChange: 491 case SettingsDelegate::TextAutosizingChange:
491 // FTA needs both setNeedsRecalcStyle and setNeedsLayout after a setting change. 492 if (!mainFrame())
492 if (RuntimeEnabledFeatures::fastTextAutosizingEnabled()) { 493 break;
493 setNeedsRecalcStyleInAllFrames(); 494 if (FastTextAutosizer* textAutosizer = mainFrame()->document()->fastText Autosizer()) {
495 textAutosizer->updatePageInfoInAllFrames();
494 } else { 496 } else {
495 // FIXME: I wonder if this needs to traverse frames like in WebViewI mpl::resize, or whether there is only one document per Settings instance?
496 for (LocalFrame* frame = mainFrame(); frame; frame = frame->tree().t raverseNext()) { 497 for (LocalFrame* frame = mainFrame(); frame; frame = frame->tree().t raverseNext()) {
497 TextAutosizer* textAutosizer = frame->document()->textAutosizer( ); 498 if (TextAutosizer* textAutosizer = frame->document()->textAutosi zer())
498 if (textAutosizer)
499 textAutosizer->recalculateMultipliers(); 499 textAutosizer->recalculateMultipliers();
500 } 500 }
501 // TextAutosizing updates RenderStyle during layout phase (via TextA utosizer::processSubtree).
502 // We should invoke setNeedsLayout here.
503 setNeedsLayoutInAllFrames();
501 } 504 }
502 // TextAutosizing updates RenderStyle during layout phase (via TextAutos izer::processSubtree).
503 // We should invoke setNeedsLayout here.
504 setNeedsLayoutInAllFrames();
505 break; 505 break;
506 case SettingsDelegate::ScriptEnableChange: 506 case SettingsDelegate::ScriptEnableChange:
507 m_inspectorController->scriptsEnabled(settings().scriptEnabled()); 507 m_inspectorController->scriptsEnabled(settings().scriptEnabled());
508 break; 508 break;
509 case SettingsDelegate::FontFamilyChange: 509 case SettingsDelegate::FontFamilyChange:
510 for (LocalFrame* frame = mainFrame(); frame; frame = frame->tree().trave rseNext()) 510 for (LocalFrame* frame = mainFrame(); frame; frame = frame->tree().trave rseNext())
511 frame->document()->styleEngine()->updateGenericFontFamilySettings(); 511 frame->document()->styleEngine()->updateGenericFontFamilySettings();
512 setNeedsRecalcStyleInAllFrames(); 512 setNeedsRecalcStyleInAllFrames();
513 break; 513 break;
514 } 514 }
(...skipping 28 matching lines...) Expand all
543 , spellCheckerClient(0) 543 , spellCheckerClient(0)
544 , storageClient(0) 544 , storageClient(0)
545 { 545 {
546 } 546 }
547 547
548 Page::PageClients::~PageClients() 548 Page::PageClients::~PageClients()
549 { 549 {
550 } 550 }
551 551
552 } // namespace WebCore 552 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698