| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |