Chromium Code Reviews| Index: Source/core/frame/FrameView.cpp |
| diff --git a/Source/core/frame/FrameView.cpp b/Source/core/frame/FrameView.cpp |
| index 95f79cbc724c033eeb430f97c5e0db39788b65c4..cc444132e72abd9d060069483dbe665ae2d0b4a1 100644 |
| --- a/Source/core/frame/FrameView.cpp |
| +++ b/Source/core/frame/FrameView.cpp |
| @@ -370,11 +370,15 @@ void FrameView::setFrameRect(const IntRect& newRect) |
| return; |
| // Autosized font sizes depend on the width of the viewing area. |
| + bool mainFrameWidthChanged = false; |
| if (newRect.width() != oldRect.width()) { |
| - if (isMainFrame() && m_frame->settings()->textAutosizingEnabled()) { |
| - for (LocalFrame* frame = m_frame.get(); frame; frame = frame->tree().traverseNext()) { |
| - if (TextAutosizer* textAutosizer = frame->document()->textAutosizer()) |
| - textAutosizer->recalculateMultipliers(); |
| + if (isMainFrame()) { |
| + mainFrameWidthChanged = true; |
| + if (m_frame->settings()->textAutosizingEnabled()) { |
|
timvolodine
2014/03/25 13:08:14
should this be higher up, i.e. if (isMainFrame() &
skobes
2014/03/25 18:25:26
Done.
It doesn't really matter since FTA does not
|
| + for (LocalFrame* frame = m_frame.get(); frame; frame = frame->tree().traverseNext()) { |
| + if (TextAutosizer* textAutosizer = frame->document()->textAutosizer()) |
| + textAutosizer->recalculateMultipliers(); |
| + } |
| } |
| } |
| } |
| @@ -383,6 +387,12 @@ void FrameView::setFrameRect(const IntRect& newRect) |
| updateScrollableAreaSet(); |
| + if (mainFrameWidthChanged) { |
| + // This needs to be after the call to ScrollView::setFrameRect, because it reads the new width. |
| + if (FastTextAutosizer* textAutosizer = m_frame->document()->fastTextAutosizer()) |
| + textAutosizer->updatePageInfoInAllFrames(); |
| + } |
| + |
| if (RenderView* renderView = this->renderView()) { |
| if (renderView->usesCompositing()) |
| renderView->compositor()->frameViewDidChangeSize(); |
| @@ -1745,6 +1755,11 @@ void FrameView::repaintContentRectangle(const IntRect& r) |
| void FrameView::contentsResized() |
| { |
| + if (isMainFrame()) { |
| + if (FastTextAutosizer* textAutosizer = m_frame->document()->fastTextAutosizer()) |
| + textAutosizer->updatePageInfoInAllFrames(); |
| + } |
| + |
| ScrollView::contentsResized(); |
| setNeedsLayout(); |
| } |