Index: Source/core/frame/FrameView.cpp |
diff --git a/Source/core/frame/FrameView.cpp b/Source/core/frame/FrameView.cpp |
index 3a1ec6409f82112ae332983736e9b0e71a77c387..77191efe3b440c884c3bcf58ec96a167dc793595 100644 |
--- a/Source/core/frame/FrameView.cpp |
+++ b/Source/core/frame/FrameView.cpp |
@@ -370,8 +370,10 @@ void FrameView::setFrameRect(const IntRect& newRect) |
return; |
// Autosized font sizes depend on the width of the viewing area. |
+ bool autosizerNeedsUpdating = false; |
if (newRect.width() != oldRect.width()) { |
if (isMainFrame() && m_frame->settings()->textAutosizingEnabled()) { |
+ autosizerNeedsUpdating = true; |
for (LocalFrame* frame = m_frame.get(); frame; frame = frame->tree().traverseNext()) { |
if (TextAutosizer* textAutosizer = frame->document()->textAutosizer()) |
textAutosizer->recalculateMultipliers(); |
@@ -383,6 +385,12 @@ void FrameView::setFrameRect(const IntRect& newRect) |
updateScrollableAreaSet(); |
+ if (autosizerNeedsUpdating) { |
+ // 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(); |
@@ -1773,6 +1781,11 @@ void FrameView::repaintContentRectangle(const IntRect& r) |
void FrameView::contentsResized() |
{ |
+ if (isMainFrame() && m_frame->document()) { |
+ if (FastTextAutosizer* textAutosizer = m_frame->document()->fastTextAutosizer()) |
+ textAutosizer->updatePageInfoInAllFrames(); |
+ } |
+ |
ScrollView::contentsResized(); |
setNeedsLayout(); |
} |