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

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: Fixed TextAutosizing 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
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 }
271 }
272
265 void Page::refreshPlugins(bool reload) 273 void Page::refreshPlugins(bool reload)
266 { 274 {
267 if (allPages().isEmpty()) 275 if (allPages().isEmpty())
268 return; 276 return;
269 277
270 PluginData::refresh(); 278 PluginData::refresh();
271 279
272 Vector<RefPtr<Frame> > framesNeedingReload; 280 Vector<RefPtr<Frame> > framesNeedingReload;
273 281
274 HashSet<Page*>::iterator end = allPages().end(); 282 HashSet<Page*>::iterator end = allPages().end();
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
490 frame->document()->fetcher()->setAutoLoadImages(settings().loadsImag esAutomatically()); 498 frame->document()->fetcher()->setAutoLoadImages(settings().loadsImag esAutomatically());
491 } 499 }
492 break; 500 break;
493 case SettingsDelegate::TextAutosizingChange: 501 case SettingsDelegate::TextAutosizingChange:
494 // FIXME: I wonder if this needs to traverse frames like in WebViewImpl: :resize, or whether there is only one document per Settings instance? 502 // 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()) { 503 for (Frame* frame = mainFrame(); frame; frame = frame->tree().traverseNe xt()) {
496 TextAutosizer* textAutosizer = frame->document()->textAutosizer(); 504 TextAutosizer* textAutosizer = frame->document()->textAutosizer();
497 if (textAutosizer) 505 if (textAutosizer)
498 textAutosizer->recalculateMultipliers(); 506 textAutosizer->recalculateMultipliers();
499 } 507 }
500 setNeedsRecalcStyleInAllFrames(); 508 // TextAutosizing updates RenderStyle during layout phase (via TextAutos izer::processSubtree).
509 // We should invoke setNeedsLayout here.
510 setNeedsLayoutInAllFrames();
501 break; 511 break;
502 case SettingsDelegate::ScriptEnableChange: 512 case SettingsDelegate::ScriptEnableChange:
503 m_inspectorController->scriptsEnabled(settings().scriptEnabled()); 513 m_inspectorController->scriptsEnabled(settings().scriptEnabled());
504 break; 514 break;
515 case SettingsDelegate::FontFamilyChange:
516 for (Frame* frame = mainFrame(); frame; frame = frame->tree().traverseNe xt())
517 frame->document()->styleEngine()->updateGenericFontFamilySettings();
518 setNeedsRecalcStyleInAllFrames();
519 break;
505 } 520 }
506 } 521 }
507 522
508 void Page::didCommitLoad(Frame* frame) 523 void Page::didCommitLoad(Frame* frame)
509 { 524 {
510 lifecycleNotifier().notifyDidCommitLoad(frame); 525 lifecycleNotifier().notifyDidCommitLoad(frame);
511 if (m_mainFrame == frame) { 526 if (m_mainFrame == frame) {
512 useCounter().didCommitLoad(); 527 useCounter().didCommitLoad();
513 m_inspectorController->didCommitLoadForMainFrame(); 528 m_inspectorController->didCommitLoadForMainFrame();
514 } 529 }
(...skipping 19 matching lines...) Expand all
534 , spellCheckerClient(0) 549 , spellCheckerClient(0)
535 , storageClient(0) 550 , storageClient(0)
536 { 551 {
537 } 552 }
538 553
539 Page::PageClients::~PageClients() 554 Page::PageClients::~PageClients()
540 { 555 {
541 } 556 }
542 557
543 } // namespace WebCore 558 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698