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 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
525 LayoutView* layoutView = m_document->layoutView(); | 525 LayoutView* layoutView = m_document->layoutView(); |
526 bool horizontalWritingMode = isHorizontalWritingMode(layoutView->style()
->writingMode()); | 526 bool horizontalWritingMode = isHorizontalWritingMode(layoutView->style()
->writingMode()); |
527 | 527 |
528 // FIXME: With out-of-process iframes, the top frame can be remote and | 528 // FIXME: With out-of-process iframes, the top frame can be remote and |
529 // doesn't have sizing information. Just return if this is the case. | 529 // doesn't have sizing information. Just return if this is the case. |
530 Frame* frame = m_document->frame()->tree().top(); | 530 Frame* frame = m_document->frame()->tree().top(); |
531 if (frame->isRemoteFrame()) | 531 if (frame->isRemoteFrame()) |
532 return; | 532 return; |
533 | 533 |
534 LocalFrame* mainFrame = m_document->page()->deprecatedLocalMainFrame(); | 534 LocalFrame* mainFrame = m_document->page()->deprecatedLocalMainFrame(); |
| 535 if (!mainFrame->view()) |
| 536 return; |
| 537 |
535 IntSize frameSize = m_document->settings()->textAutosizingWindowSizeOver
ride(); | 538 IntSize frameSize = m_document->settings()->textAutosizingWindowSizeOver
ride(); |
536 if (frameSize.isEmpty()) | 539 if (frameSize.isEmpty()) |
537 frameSize = windowSize(); | 540 frameSize = windowSize(); |
538 | 541 |
539 m_pageInfo.m_frameWidth = horizontalWritingMode ? frameSize.width() : fr
ameSize.height(); | 542 m_pageInfo.m_frameWidth = horizontalWritingMode ? frameSize.width() : fr
ameSize.height(); |
540 | 543 |
541 IntSize layoutSize = mainFrame->view()->layoutSize(); | 544 IntSize layoutSize = mainFrame->view()->layoutSize(); |
542 m_pageInfo.m_layoutWidth = horizontalWritingMode ? layoutSize.width() :
layoutSize.height(); | 545 m_pageInfo.m_layoutWidth = horizontalWritingMode ? layoutSize.width() :
layoutSize.height(); |
543 | 546 |
544 // Compute the base font scale multiplier based on device and accessibil
ity settings. | 547 // Compute the base font scale multiplier based on device and accessibil
ity settings. |
(...skipping 636 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1181 } | 1184 } |
1182 return computedSize; | 1185 return computedSize; |
1183 } | 1186 } |
1184 | 1187 |
1185 DEFINE_TRACE(TextAutosizer) | 1188 DEFINE_TRACE(TextAutosizer) |
1186 { | 1189 { |
1187 visitor->trace(m_document); | 1190 visitor->trace(m_document); |
1188 } | 1191 } |
1189 | 1192 |
1190 } // namespace blink | 1193 } // namespace blink |
OLD | NEW |