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

Side by Side Diff: Source/core/rendering/FastTextAutosizer.cpp

Issue 317493002: Change FrameTree to return Frames instead of LocalFrames. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: dcheng's comment addressed Created 6 years, 6 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
« no previous file with comments | « Source/core/page/Page.cpp ('k') | Source/core/rendering/TextAutosizer.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) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after
481 481
482 bool FastTextAutosizer::shouldHandleLayout() const 482 bool FastTextAutosizer::shouldHandleLayout() const
483 { 483 {
484 return m_pageInfo.m_settingEnabled && m_pageInfo.m_pageNeedsAutosizing && !m _updatePageInfoDeferred; 484 return m_pageInfo.m_settingEnabled && m_pageInfo.m_pageNeedsAutosizing && !m _updatePageInfoDeferred;
485 } 485 }
486 486
487 void FastTextAutosizer::updatePageInfoInAllFrames() 487 void FastTextAutosizer::updatePageInfoInAllFrames()
488 { 488 {
489 ASSERT(!m_document->frame() || m_document->frame()->isMainFrame()); 489 ASSERT(!m_document->frame() || m_document->frame()->isMainFrame());
490 490
491 for (LocalFrame* frame = m_document->frame(); frame; frame = frame->tree().t raverseNext()) { 491 for (Frame* frame = m_document->frame(); frame; frame = frame->tree().traver seNext()) {
492 if (FastTextAutosizer* textAutosizer = frame->document()->fastTextAutosi zer()) 492 if (!frame->isLocalFrame())
493 continue;
494 if (FastTextAutosizer* textAutosizer = toLocalFrame(frame)->document()-> fastTextAutosizer())
493 textAutosizer->updatePageInfo(); 495 textAutosizer->updatePageInfo();
494 } 496 }
495 } 497 }
496 498
497 void FastTextAutosizer::updatePageInfo() 499 void FastTextAutosizer::updatePageInfo()
498 { 500 {
499 if (m_updatePageInfoDeferred || !m_document->page() || !m_document->settings ()) 501 if (m_updatePageInfoDeferred || !m_document->page() || !m_document->settings ())
500 return; 502 return;
501 503
502 PageInfo previousPageInfo(m_pageInfo); 504 PageInfo previousPageInfo(m_pageInfo);
(...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after
1122 FastTextAutosizer::DeferUpdatePageInfo::~DeferUpdatePageInfo() 1124 FastTextAutosizer::DeferUpdatePageInfo::~DeferUpdatePageInfo()
1123 { 1125 {
1124 if (FastTextAutosizer* textAutosizer = m_mainFrame->document()->fastTextAuto sizer()) { 1126 if (FastTextAutosizer* textAutosizer = m_mainFrame->document()->fastTextAuto sizer()) {
1125 ASSERT(textAutosizer->m_updatePageInfoDeferred); 1127 ASSERT(textAutosizer->m_updatePageInfoDeferred);
1126 textAutosizer->m_updatePageInfoDeferred = false; 1128 textAutosizer->m_updatePageInfoDeferred = false;
1127 textAutosizer->updatePageInfoInAllFrames(); 1129 textAutosizer->updatePageInfoInAllFrames();
1128 } 1130 }
1129 } 1131 }
1130 1132
1131 } // namespace WebCore 1133 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/page/Page.cpp ('k') | Source/core/rendering/TextAutosizer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698