Chromium Code Reviews| 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 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 502 | 502 | 
| 503 PageInfo previousPageInfo(m_pageInfo); | 503 PageInfo previousPageInfo(m_pageInfo); | 
| 504 m_pageInfo.m_settingEnabled = m_document->settings()->textAutosizingEnabled( ); | 504 m_pageInfo.m_settingEnabled = m_document->settings()->textAutosizingEnabled( ); | 
| 505 | 505 | 
| 506 if (!m_pageInfo.m_settingEnabled || m_document->printing()) { | 506 if (!m_pageInfo.m_settingEnabled || m_document->printing()) { | 
| 507 m_pageInfo.m_pageNeedsAutosizing = false; | 507 m_pageInfo.m_pageNeedsAutosizing = false; | 
| 508 } else { | 508 } else { | 
| 509 RenderView* renderView = m_document->renderView(); | 509 RenderView* renderView = m_document->renderView(); | 
| 510 bool horizontalWritingMode = isHorizontalWritingMode(renderView->style() ->writingMode()); | 510 bool horizontalWritingMode = isHorizontalWritingMode(renderView->style() ->writingMode()); | 
| 511 | 511 | 
| 512 LocalFrame* mainFrame = m_document->page()->deprecatedLocalMainFrame(); | 512 // FIXME: With out-of-process iframes, the top frame can be remote and | 
| 513 // doesn't have sizing information. Just return if this is the case. | |
| 514 Frame* frame = m_document->frame()->tree().top(); | |
| 515 if (frame->isRemoteFrame()) | |
| 516 return; | |
| 517 | |
| 518 LocalFrame* mainFrame = toLocalFrame(frame); | |
| 
 
dcheng
2014/10/23 21:48:17
I would probably still use dprecatedLocalMainFrame
 
nasko
2014/10/23 21:50:44
Done.
 
 | |
| 513 IntSize frameSize = m_document->settings()->textAutosizingWindowSizeOver ride(); | 519 IntSize frameSize = m_document->settings()->textAutosizingWindowSizeOver ride(); | 
| 514 if (frameSize.isEmpty()) | 520 if (frameSize.isEmpty()) | 
| 515 frameSize = windowSize(); | 521 frameSize = windowSize(); | 
| 516 | 522 | 
| 517 m_pageInfo.m_frameWidth = horizontalWritingMode ? frameSize.width() : fr ameSize.height(); | 523 m_pageInfo.m_frameWidth = horizontalWritingMode ? frameSize.width() : fr ameSize.height(); | 
| 518 | 524 | 
| 519 IntSize layoutSize = mainFrame->view()->layoutSize(); | 525 IntSize layoutSize = mainFrame->view()->layoutSize(); | 
| 520 m_pageInfo.m_layoutWidth = horizontalWritingMode ? layoutSize.width() : layoutSize.height(); | 526 m_pageInfo.m_layoutWidth = horizontalWritingMode ? layoutSize.width() : layoutSize.height(); | 
| 521 | 527 | 
| 522 // Compute the base font scale multiplier based on device and accessibil ity settings. | 528 // Compute the base font scale multiplier based on device and accessibil ity settings. | 
| (...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1163 } | 1169 } | 
| 1164 return computedSize; | 1170 return computedSize; | 
| 1165 } | 1171 } | 
| 1166 | 1172 | 
| 1167 void TextAutosizer::trace(Visitor* visitor) | 1173 void TextAutosizer::trace(Visitor* visitor) | 
| 1168 { | 1174 { | 
| 1169 visitor->trace(m_document); | 1175 visitor->trace(m_document); | 
| 1170 } | 1176 } | 
| 1171 | 1177 | 
| 1172 } // namespace blink | 1178 } // namespace blink | 
| OLD | NEW |