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

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

Issue 82583005: Use removeFontFace to avoid resetting fontSelector. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Patch for landing Created 6 years, 10 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 | « Source/core/page/Page.h ('k') | Source/core/testing/InternalSettings.cpp » ('j') | 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, 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 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 for (Frame* frame = (*it)->mainFrame(); frame; frame = frame->tree().tra verseNext()) 255 for (Frame* frame = (*it)->mainFrame(); frame; frame = frame->tree().tra verseNext())
256 frame->document()->setNeedsStyleRecalc(SubtreeStyleChange); 256 frame->document()->setNeedsStyleRecalc(SubtreeStyleChange);
257 } 257 }
258 258
259 void Page::setNeedsRecalcStyleInAllFrames() 259 void Page::setNeedsRecalcStyleInAllFrames()
260 { 260 {
261 for (Frame* frame = mainFrame(); frame; frame = frame->tree().traverseNext() ) 261 for (Frame* frame = mainFrame(); frame; frame = frame->tree().traverseNext() )
262 frame->document()->styleResolverChanged(RecalcStyleDeferred); 262 frame->document()->styleResolverChanged(RecalcStyleDeferred);
263 } 263 }
264 264
265 void Page::setNeedsLayoutInAllFrames()
266 {
267 for (Frame* frame = mainFrame(); frame; frame = frame->tree().traverseNext() ) {
268 if (FrameView* view = frame->view()) {
269 view->setNeedsLayout();
270 view->scheduleRelayout();
271 }
272 }
273 }
274
265 void Page::refreshPlugins(bool reload) 275 void Page::refreshPlugins(bool reload)
266 { 276 {
267 if (allPages().isEmpty()) 277 if (allPages().isEmpty())
268 return; 278 return;
269 279
270 PluginData::refresh(); 280 PluginData::refresh();
271 281
272 Vector<RefPtr<Frame> > framesNeedingReload; 282 Vector<RefPtr<Frame> > framesNeedingReload;
273 283
274 HashSet<Page*>::iterator end = allPages().end(); 284 HashSet<Page*>::iterator end = allPages().end();
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
484 (*it)->multisamplingChanged(m_settings->openGLMultisamplingEnabled() ); 494 (*it)->multisamplingChanged(m_settings->openGLMultisamplingEnabled() );
485 break; 495 break;
486 } 496 }
487 case SettingsDelegate::ImageLoadingChange: 497 case SettingsDelegate::ImageLoadingChange:
488 for (Frame* frame = mainFrame(); frame; frame = frame->tree().traverseNe xt()) { 498 for (Frame* frame = mainFrame(); frame; frame = frame->tree().traverseNe xt()) {
489 frame->document()->fetcher()->setImagesEnabled(settings().imagesEnab led()); 499 frame->document()->fetcher()->setImagesEnabled(settings().imagesEnab led());
490 frame->document()->fetcher()->setAutoLoadImages(settings().loadsImag esAutomatically()); 500 frame->document()->fetcher()->setAutoLoadImages(settings().loadsImag esAutomatically());
491 } 501 }
492 break; 502 break;
493 case SettingsDelegate::TextAutosizingChange: 503 case SettingsDelegate::TextAutosizingChange:
504 // FastTextAutosizer works with RenderBlock::styleWillChange.
skobes 2014/02/14 18:11:04 This comment is misleading. FTA gathers some info
tasak 2014/02/17 02:39:25 I modified to use setNeedsRecalc and setNeedsLayou
505 // TextAutosizer depends on FrameView::layout.
506 // If fastTextAutosizing is enabled, we should use setNeedsRecalcStyleIn AllFrames.
507 if (RuntimeEnabledFeatures::fastTextAutosizingEnabled()) {
508 setNeedsRecalcStyleInAllFrames();
509 break;
510 }
511
494 // FIXME: I wonder if this needs to traverse frames like in WebViewImpl: :resize, or whether there is only one document per Settings instance? 512 // FIXME: I wonder if this needs to traverse frames like in WebViewImpl: :resize, or whether there is only one document per Settings instance?
495 for (Frame* frame = mainFrame(); frame; frame = frame->tree().traverseNe xt()) { 513 for (Frame* frame = mainFrame(); frame; frame = frame->tree().traverseNe xt()) {
496 TextAutosizer* textAutosizer = frame->document()->textAutosizer(); 514 TextAutosizer* textAutosizer = frame->document()->textAutosizer();
497 if (textAutosizer) 515 if (textAutosizer)
498 textAutosizer->recalculateMultipliers(); 516 textAutosizer->recalculateMultipliers();
499 } 517 }
500 setNeedsRecalcStyleInAllFrames(); 518 // TextAutosizing updates RenderStyle during layout phase (via TextAutos izer::processSubtree).
519 // We should invoke setNeedsLayout here.
520 setNeedsLayoutInAllFrames();
501 break; 521 break;
502 case SettingsDelegate::ScriptEnableChange: 522 case SettingsDelegate::ScriptEnableChange:
503 m_inspectorController->scriptsEnabled(settings().scriptEnabled()); 523 m_inspectorController->scriptsEnabled(settings().scriptEnabled());
504 break; 524 break;
525 case SettingsDelegate::FontFamilyChange:
526 for (Frame* frame = mainFrame(); frame; frame = frame->tree().traverseNe xt())
527 frame->document()->styleEngine()->updateGenericFontFamilySettings();
528 setNeedsRecalcStyleInAllFrames();
529 break;
505 } 530 }
506 } 531 }
507 532
508 void Page::didCommitLoad(Frame* frame) 533 void Page::didCommitLoad(Frame* frame)
509 { 534 {
510 lifecycleNotifier().notifyDidCommitLoad(frame); 535 lifecycleNotifier().notifyDidCommitLoad(frame);
511 if (m_mainFrame == frame) { 536 if (m_mainFrame == frame) {
512 useCounter().didCommitLoad(); 537 useCounter().didCommitLoad();
513 m_inspectorController->didCommitLoadForMainFrame(); 538 m_inspectorController->didCommitLoadForMainFrame();
514 } 539 }
(...skipping 19 matching lines...) Expand all
534 , spellCheckerClient(0) 559 , spellCheckerClient(0)
535 , storageClient(0) 560 , storageClient(0)
536 { 561 {
537 } 562 }
538 563
539 Page::PageClients::~PageClients() 564 Page::PageClients::~PageClients()
540 { 565 {
541 } 566 }
542 567
543 } // namespace WebCore 568 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/page/Page.h ('k') | Source/core/testing/InternalSettings.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698