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 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
506 | 506 |
507 PageInfo previousPageInfo(m_pageInfo); | 507 PageInfo previousPageInfo(m_pageInfo); |
508 m_pageInfo.m_settingEnabled = m_document->settings()->textAutosizingEnabled(
); | 508 m_pageInfo.m_settingEnabled = m_document->settings()->textAutosizingEnabled(
); |
509 | 509 |
510 if (!m_pageInfo.m_settingEnabled || m_document->printing()) { | 510 if (!m_pageInfo.m_settingEnabled || m_document->printing()) { |
511 m_pageInfo.m_pageNeedsAutosizing = false; | 511 m_pageInfo.m_pageNeedsAutosizing = false; |
512 } else { | 512 } else { |
513 RenderView* renderView = m_document->renderView(); | 513 RenderView* renderView = m_document->renderView(); |
514 bool horizontalWritingMode = isHorizontalWritingMode(renderView->style()
->writingMode()); | 514 bool horizontalWritingMode = isHorizontalWritingMode(renderView->style()
->writingMode()); |
515 | 515 |
516 LocalFrame* mainFrame = m_document->page()->mainFrame(); | 516 LocalFrame* mainFrame = m_document->page()->deprecatedLocalMainFrame(); |
517 IntSize frameSize = m_document->settings()->textAutosizingWindowSizeOver
ride(); | 517 IntSize frameSize = m_document->settings()->textAutosizingWindowSizeOver
ride(); |
518 if (frameSize.isEmpty()) | 518 if (frameSize.isEmpty()) |
519 frameSize = mainFrame->view()->unscaledVisibleContentSize(IncludeScr
ollbars); | 519 frameSize = mainFrame->view()->unscaledVisibleContentSize(IncludeScr
ollbars); |
520 m_pageInfo.m_frameWidth = horizontalWritingMode ? frameSize.width() : fr
ameSize.height(); | 520 m_pageInfo.m_frameWidth = horizontalWritingMode ? frameSize.width() : fr
ameSize.height(); |
521 | 521 |
522 IntSize layoutSize = mainFrame->view()->layoutSize(); | 522 IntSize layoutSize = mainFrame->view()->layoutSize(); |
523 m_pageInfo.m_layoutWidth = horizontalWritingMode ? layoutSize.width() :
layoutSize.height(); | 523 m_pageInfo.m_layoutWidth = horizontalWritingMode ? layoutSize.width() :
layoutSize.height(); |
524 | 524 |
525 // Compute the base font scale multiplier based on device and accessibil
ity settings. | 525 // Compute the base font scale multiplier based on device and accessibil
ity settings. |
526 m_pageInfo.m_baseMultiplier = m_document->settings()->accessibilityFontS
caleFactor(); | 526 m_pageInfo.m_baseMultiplier = m_document->settings()->accessibilityFontS
caleFactor(); |
(...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1109 FastTextAutosizer::TableLayoutScope::TableLayoutScope(RenderTable* table) | 1109 FastTextAutosizer::TableLayoutScope::TableLayoutScope(RenderTable* table) |
1110 : LayoutScope(table) | 1110 : LayoutScope(table) |
1111 { | 1111 { |
1112 if (m_textAutosizer) { | 1112 if (m_textAutosizer) { |
1113 ASSERT(m_textAutosizer->shouldHandleLayout()); | 1113 ASSERT(m_textAutosizer->shouldHandleLayout()); |
1114 m_textAutosizer->inflateAutoTable(table); | 1114 m_textAutosizer->inflateAutoTable(table); |
1115 } | 1115 } |
1116 } | 1116 } |
1117 | 1117 |
1118 FastTextAutosizer::DeferUpdatePageInfo::DeferUpdatePageInfo(Page* page) | 1118 FastTextAutosizer::DeferUpdatePageInfo::DeferUpdatePageInfo(Page* page) |
1119 : m_mainFrame(page->mainFrame()) | 1119 : m_mainFrame(page->deprecatedLocalMainFrame()) |
1120 { | 1120 { |
1121 if (FastTextAutosizer* textAutosizer = m_mainFrame->document()->fastTextAuto
sizer()) { | 1121 if (FastTextAutosizer* textAutosizer = m_mainFrame->document()->fastTextAuto
sizer()) { |
1122 ASSERT(!textAutosizer->m_updatePageInfoDeferred); | 1122 ASSERT(!textAutosizer->m_updatePageInfoDeferred); |
1123 textAutosizer->m_updatePageInfoDeferred = true; | 1123 textAutosizer->m_updatePageInfoDeferred = true; |
1124 } | 1124 } |
1125 } | 1125 } |
1126 | 1126 |
1127 FastTextAutosizer::DeferUpdatePageInfo::~DeferUpdatePageInfo() | 1127 FastTextAutosizer::DeferUpdatePageInfo::~DeferUpdatePageInfo() |
1128 { | 1128 { |
1129 if (FastTextAutosizer* textAutosizer = m_mainFrame->document()->fastTextAuto
sizer()) { | 1129 if (FastTextAutosizer* textAutosizer = m_mainFrame->document()->fastTextAuto
sizer()) { |
1130 ASSERT(textAutosizer->m_updatePageInfoDeferred); | 1130 ASSERT(textAutosizer->m_updatePageInfoDeferred); |
1131 textAutosizer->m_updatePageInfoDeferred = false; | 1131 textAutosizer->m_updatePageInfoDeferred = false; |
1132 textAutosizer->updatePageInfoInAllFrames(); | 1132 textAutosizer->updatePageInfoInAllFrames(); |
1133 } | 1133 } |
1134 } | 1134 } |
1135 | 1135 |
1136 } // namespace WebCore | 1136 } // namespace WebCore |
OLD | NEW |