Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(149)

Side by Side Diff: third_party/WebKit/Source/core/layout/TextAutosizer.cpp

Issue 1374783005: TextAutosizer should handle frames without a FrameView. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698