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 513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
524 } else { | 524 } else { |
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 = toLocalFrame(frame); |
535 if (!mainFrame->view()) | |
536 return; | |
537 | |
538 IntSize frameSize = m_document->settings()->textAutosizingWindowSizeOver
ride(); | 535 IntSize frameSize = m_document->settings()->textAutosizingWindowSizeOver
ride(); |
539 if (frameSize.isEmpty()) | 536 if (frameSize.isEmpty()) |
540 frameSize = windowSize(); | 537 frameSize = windowSize(); |
541 | 538 |
542 m_pageInfo.m_frameWidth = horizontalWritingMode ? frameSize.width() : fr
ameSize.height(); | 539 m_pageInfo.m_frameWidth = horizontalWritingMode ? frameSize.width() : fr
ameSize.height(); |
543 | 540 |
544 IntSize layoutSize = mainFrame->view()->layoutSize(); | 541 IntSize layoutSize = mainFrame->view()->layoutSize(); |
545 m_pageInfo.m_layoutWidth = horizontalWritingMode ? layoutSize.width() :
layoutSize.height(); | 542 m_pageInfo.m_layoutWidth = horizontalWritingMode ? layoutSize.width() :
layoutSize.height(); |
546 | 543 |
547 // Compute the base font scale multiplier based on device and accessibil
ity settings. | 544 // 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... |
1184 } | 1181 } |
1185 return computedSize; | 1182 return computedSize; |
1186 } | 1183 } |
1187 | 1184 |
1188 DEFINE_TRACE(TextAutosizer) | 1185 DEFINE_TRACE(TextAutosizer) |
1189 { | 1186 { |
1190 visitor->trace(m_document); | 1187 visitor->trace(m_document); |
1191 } | 1188 } |
1192 | 1189 |
1193 } // namespace blink | 1190 } // namespace blink |
OLD | NEW |