Commit c85377aa authored by skobes@chromium.org's avatar skobes@chromium.org

Clean up handling of autosizing state changes.

All page-level state changes now go through updatePageInfo, which marks blocks
as needing layout if their multipliers might need updating.

This simplifies the flow and ensures the page updates correctly on orientation
changes and movements of the text scaling slider in accessibility settings.

BUG=353309,347384

Review URL: https://codereview.chromium.org/209353003

git-svn-id: svn://svn.chromium.org/blink/trunk@169997 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 2a0b90a9
...@@ -747,7 +747,6 @@ crbug.com/322782 virtual/fasttextautosizing/fast/text-autosizing/oscillation-jav ...@@ -747,7 +747,6 @@ crbug.com/322782 virtual/fasttextautosizing/fast/text-autosizing/oscillation-jav
crbug.com/322782 virtual/fasttextautosizing/fast/text-autosizing/narrow-iframe.html [ ImageOnlyFailure ] crbug.com/322782 virtual/fasttextautosizing/fast/text-autosizing/narrow-iframe.html [ ImageOnlyFailure ]
crbug.com/322782 virtual/fasttextautosizing/fast/text-autosizing/clusters-insufficient-text.html [ ImageOnlyFailure ] crbug.com/322782 virtual/fasttextautosizing/fast/text-autosizing/clusters-insufficient-text.html [ ImageOnlyFailure ]
crbug.com/343201 virtual/fasttextautosizing/fast/text-autosizing/hackernews-comments.html [ Pass Failure ] crbug.com/343201 virtual/fasttextautosizing/fast/text-autosizing/hackernews-comments.html [ Pass Failure ]
crbug.com/353309 virtual/fasttextautosizing/fast/text-autosizing/resize-window.html [ Failure ]
# FIXME(crbug.com/332944): Remove this when hash-based autosizer performs sufficiently well on hackernews. # FIXME(crbug.com/332944): Remove this when hash-based autosizer performs sufficiently well on hackernews.
crbug.com/332944 fast/text-autosizing/hackernews-comments.html [ Failure ] crbug.com/332944 fast/text-autosizing/hackernews-comments.html [ Failure ]
......
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=320">
<style>
html { font-size: 16px; }
body { width: 320px; margin: 0; overflow-y: hidden; }
</style>
</head>
<body>
<div style="font-size: 2rem">
This test verifies that the page updates correctly after a dynamic change to the font scale factor.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur sapien sapien, tempus id egestas a, consectetur et felis. Ut pharetra mi eget lectus laoreet rutrum. Mauris tellus odio, egestas vitae sodales in, vehicula eget ante. Pellentesque id egestas arcu. Quisque tellus quam, rhoncus ac elementum vel, volutpat vel felis. Aliquam ut leo dolor, eget egestas tellus. Nunc ut velit gravida nisl fringilla rutrum eget at arcu. Vivamus et pretium mauris.
</div>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=320">
<style>
html { font-size: 16px; }
body { width: 320px; margin: 0; overflow-y: hidden; }
</style>
<script src="resources/autosizingTest.js"></script>
</head>
<body>
<div>
This test verifies that the page updates correctly after a dynamic change to the font scale factor.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur sapien sapien, tempus id egestas a, consectetur et felis. Ut pharetra mi eget lectus laoreet rutrum. Mauris tellus odio, egestas vitae sodales in, vehicula eget ante. Pellentesque id egestas arcu. Quisque tellus quam, rhoncus ac elementum vel, volutpat vel felis. Aliquam ut leo dolor, eget egestas tellus. Nunc ut velit gravida nisl fringilla rutrum eget at arcu. Vivamus et pretium mauris.
</div>
<script>
if (window.testRunner)
testRunner.waitUntilDone();
setTimeout(function() {
setFontScaleFactor(2);
if (window.testRunner)
testRunner.notifyDone();
}, 0);
</script>
</body>
</html>
...@@ -2072,6 +2072,10 @@ void Document::attach(const AttachContext& context) ...@@ -2072,6 +2072,10 @@ void Document::attach(const AttachContext& context)
ContainerNode::attach(context); ContainerNode::attach(context);
// FTA can't update render view info while the Document is detached, so update now in case anything changed.
if (FastTextAutosizer* textAutosizer = fastTextAutosizer())
textAutosizer->updatePageInfo();
m_lifecycle.advanceTo(DocumentLifecycle::StyleClean); m_lifecycle.advanceTo(DocumentLifecycle::StyleClean);
} }
......
...@@ -370,8 +370,10 @@ void FrameView::setFrameRect(const IntRect& newRect) ...@@ -370,8 +370,10 @@ void FrameView::setFrameRect(const IntRect& newRect)
return; return;
// Autosized font sizes depend on the width of the viewing area. // Autosized font sizes depend on the width of the viewing area.
bool autosizerNeedsUpdating = false;
if (newRect.width() != oldRect.width()) { if (newRect.width() != oldRect.width()) {
if (isMainFrame() && m_frame->settings()->textAutosizingEnabled()) { if (isMainFrame() && m_frame->settings()->textAutosizingEnabled()) {
autosizerNeedsUpdating = true;
for (LocalFrame* frame = m_frame.get(); frame; frame = frame->tree().traverseNext()) { for (LocalFrame* frame = m_frame.get(); frame; frame = frame->tree().traverseNext()) {
if (TextAutosizer* textAutosizer = frame->document()->textAutosizer()) if (TextAutosizer* textAutosizer = frame->document()->textAutosizer())
textAutosizer->recalculateMultipliers(); textAutosizer->recalculateMultipliers();
...@@ -383,6 +385,12 @@ void FrameView::setFrameRect(const IntRect& newRect) ...@@ -383,6 +385,12 @@ void FrameView::setFrameRect(const IntRect& newRect)
updateScrollableAreaSet(); 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* renderView = this->renderView()) {
if (renderView->usesCompositing()) if (renderView->usesCompositing())
renderView->compositor()->frameViewDidChangeSize(); renderView->compositor()->frameViewDidChangeSize();
...@@ -1741,6 +1749,11 @@ void FrameView::repaintContentRectangle(const IntRect& r) ...@@ -1741,6 +1749,11 @@ void FrameView::repaintContentRectangle(const IntRect& r)
void FrameView::contentsResized() void FrameView::contentsResized()
{ {
if (isMainFrame() && m_frame->document()) {
if (FastTextAutosizer* textAutosizer = m_frame->document()->fastTextAutosizer())
textAutosizer->updatePageInfoInAllFrames();
}
ScrollView::contentsResized(); ScrollView::contentsResized();
setNeedsLayout(); setNeedsLayout();
} }
......
...@@ -51,6 +51,7 @@ ...@@ -51,6 +51,7 @@
#include "core/page/StorageClient.h" #include "core/page/StorageClient.h"
#include "core/page/ValidationMessageClient.h" #include "core/page/ValidationMessageClient.h"
#include "core/page/scrolling/ScrollingCoordinator.h" #include "core/page/scrolling/ScrollingCoordinator.h"
#include "core/rendering/FastTextAutosizer.h"
#include "core/rendering/RenderView.h" #include "core/rendering/RenderView.h"
#include "core/rendering/TextAutosizer.h" #include "core/rendering/TextAutosizer.h"
#include "core/storage/StorageNamespace.h" #include "core/storage/StorageNamespace.h"
...@@ -488,20 +489,19 @@ void Page::settingsChanged(SettingsDelegate::ChangeType changeType) ...@@ -488,20 +489,19 @@ void Page::settingsChanged(SettingsDelegate::ChangeType changeType)
} }
break; break;
case SettingsDelegate::TextAutosizingChange: case SettingsDelegate::TextAutosizingChange:
// FTA needs both setNeedsRecalcStyle and setNeedsLayout after a setting change. if (!mainFrame())
if (RuntimeEnabledFeatures::fastTextAutosizingEnabled()) { break;
setNeedsRecalcStyleInAllFrames(); if (FastTextAutosizer* textAutosizer = mainFrame()->document()->fastTextAutosizer()) {
textAutosizer->updatePageInfoInAllFrames();
} else { } else {
// FIXME: I wonder if this needs to traverse frames like in WebViewImpl::resize, or whether there is only one document per Settings instance?
for (LocalFrame* frame = mainFrame(); frame; frame = frame->tree().traverseNext()) { for (LocalFrame* frame = mainFrame(); frame; frame = frame->tree().traverseNext()) {
TextAutosizer* textAutosizer = frame->document()->textAutosizer(); if (TextAutosizer* textAutosizer = frame->document()->textAutosizer())
if (textAutosizer)
textAutosizer->recalculateMultipliers(); textAutosizer->recalculateMultipliers();
} }
// TextAutosizing updates RenderStyle during layout phase (via TextAutosizer::processSubtree).
// We should invoke setNeedsLayout here.
setNeedsLayoutInAllFrames();
} }
// TextAutosizing updates RenderStyle during layout phase (via TextAutosizer::processSubtree).
// We should invoke setNeedsLayout here.
setNeedsLayoutInAllFrames();
break; break;
case SettingsDelegate::ScriptEnableChange: case SettingsDelegate::ScriptEnableChange:
m_inspectorController->scriptsEnabled(settings().scriptEnabled()); m_inspectorController->scriptsEnabled(settings().scriptEnabled());
......
...@@ -234,10 +234,10 @@ FastTextAutosizer::FastTextAutosizer(const Document* document) ...@@ -234,10 +234,10 @@ FastTextAutosizer::FastTextAutosizer(const Document* document)
, m_frameWidth(0) , m_frameWidth(0)
, m_layoutWidth(0) , m_layoutWidth(0)
, m_baseMultiplier(0) , m_baseMultiplier(0)
, m_pageAutosizingStatus(PageAutosizingStatusUnknown) , m_pageNeedsAutosizing(false)
, m_previouslyAutosized(false)
, m_firstBlock(0) , m_firstBlock(0)
#ifndef NDEBUG #ifndef NDEBUG
, m_renderViewInfoPrepared(false)
, m_blocksThatHaveBegunLayout() , m_blocksThatHaveBegunLayout()
#endif #endif
, m_superclusters() , m_superclusters()
...@@ -290,7 +290,7 @@ void FastTextAutosizer::prepareClusterStack(const RenderObject* renderer) ...@@ -290,7 +290,7 @@ void FastTextAutosizer::prepareClusterStack(const RenderObject* renderer)
void FastTextAutosizer::beginLayout(RenderBlock* block) void FastTextAutosizer::beginLayout(RenderBlock* block)
{ {
ASSERT(enabled() && m_pageAutosizingStatus == PageNeedsAutosizing); ASSERT(enabled() && m_pageNeedsAutosizing);
#ifndef NDEBUG #ifndef NDEBUG
m_blocksThatHaveBegunLayout.add(block); m_blocksThatHaveBegunLayout.add(block);
#endif #endif
...@@ -316,7 +316,7 @@ void FastTextAutosizer::beginLayout(RenderBlock* block) ...@@ -316,7 +316,7 @@ void FastTextAutosizer::beginLayout(RenderBlock* block)
void FastTextAutosizer::inflateListItem(RenderListItem* listItem, RenderListMarker* listItemMarker) void FastTextAutosizer::inflateListItem(RenderListItem* listItem, RenderListMarker* listItemMarker)
{ {
if (!enabled() || m_pageAutosizingStatus != PageNeedsAutosizing) if (!enabled() || !m_pageNeedsAutosizing)
return; return;
ASSERT(listItem && listItemMarker); ASSERT(listItem && listItemMarker);
#ifndef NDEBUG #ifndef NDEBUG
...@@ -379,11 +379,10 @@ void FastTextAutosizer::inflateTable(RenderTable* table) ...@@ -379,11 +379,10 @@ void FastTextAutosizer::inflateTable(RenderTable* table)
void FastTextAutosizer::endLayout(RenderBlock* block) void FastTextAutosizer::endLayout(RenderBlock* block)
{ {
ASSERT(enabled() && m_pageAutosizingStatus == PageNeedsAutosizing); ASSERT(enabled() && m_pageNeedsAutosizing);
if (block == m_firstBlock) { if (block == m_firstBlock) {
m_firstBlock = 0; m_firstBlock = 0;
m_pageAutosizingStatus = PageAutosizingStatusUnknown;
m_clusterStack.clear(); m_clusterStack.clear();
m_superclusters.clear(); m_superclusters.clear();
#ifndef NDEBUG #ifndef NDEBUG
...@@ -425,8 +424,28 @@ bool FastTextAutosizer::enabled() ...@@ -425,8 +424,28 @@ bool FastTextAutosizer::enabled()
return m_document->settings()->textAutosizingEnabled(); return m_document->settings()->textAutosizingEnabled();
} }
void FastTextAutosizer::updateRenderViewInfo() void FastTextAutosizer::updatePageInfoInAllFrames()
{ {
if (!enabled())
return;
ASSERT(m_document->frame()->isMainFrame());
for (LocalFrame* frame = m_document->frame(); frame; frame = frame->tree().traverseNext()) {
if (FastTextAutosizer* textAutosizer = frame->document()->fastTextAutosizer())
textAutosizer->updatePageInfo();
}
}
void FastTextAutosizer::updatePageInfo()
{
if (!enabled())
return;
int previousFrameWidth = m_frameWidth;
int previousLayoutWidth = m_layoutWidth;
float previousBaseMultiplier = m_baseMultiplier;
RenderView* renderView = toRenderView(m_document->renderer()); RenderView* renderView = toRenderView(m_document->renderer());
bool horizontalWritingMode = isHorizontalWritingMode(renderView->style()->writingMode()); bool horizontalWritingMode = isHorizontalWritingMode(renderView->style()->writingMode());
...@@ -448,12 +467,43 @@ void FastTextAutosizer::updateRenderViewInfo() ...@@ -448,12 +467,43 @@ void FastTextAutosizer::updateRenderViewInfo()
m_baseMultiplier *= deviceScaleAdjustment; m_baseMultiplier *= deviceScaleAdjustment;
} }
m_pageAutosizingStatus = m_frameWidth && (m_baseMultiplier * (static_cast<float>(m_layoutWidth) / m_frameWidth) > 1.0f) m_pageNeedsAutosizing = !!m_frameWidth
? PageNeedsAutosizing : PageDoesNotNeedAutosizing; && (m_baseMultiplier * (static_cast<float>(m_layoutWidth) / m_frameWidth) > 1.0f);
#ifndef NDEBUG // If we are no longer autosizing the page, we won't do anything during the next layout.
m_renderViewInfoPrepared = true; // Set all the multipliers back to 1 now.
#endif if (!m_pageNeedsAutosizing && m_previouslyAutosized)
resetMultipliers();
// If page info has changed, multipliers may have changed. Force a layout to recompute them.
if (m_pageNeedsAutosizing
&& (m_frameWidth != previousFrameWidth
|| m_layoutWidth != previousLayoutWidth
|| m_baseMultiplier != previousBaseMultiplier))
setAllTextNeedsLayout();
}
void FastTextAutosizer::resetMultipliers()
{
RenderObject* renderer = m_document->renderer();
while (renderer) {
if (RenderStyle* style = renderer->style()) {
if (style->textAutosizingMultiplier() != 1)
applyMultiplier(renderer, 1, LayoutNeeded);
}
renderer = renderer->nextInPreOrder();
}
m_previouslyAutosized = false;
}
void FastTextAutosizer::setAllTextNeedsLayout()
{
RenderObject* renderer = m_document->renderer();
while (renderer) {
if (renderer->isText())
renderer->setNeedsLayout();
renderer = renderer->nextInPreOrder();
}
} }
bool FastTextAutosizer::clusterWouldHaveEnoughTextToAutosize(const RenderBlock* root, const RenderBlock* widthProvider) bool FastTextAutosizer::clusterWouldHaveEnoughTextToAutosize(const RenderBlock* root, const RenderBlock* widthProvider)
...@@ -621,7 +671,6 @@ const RenderBlock* FastTextAutosizer::deepestCommonAncestor(BlockSet& blocks) ...@@ -621,7 +671,6 @@ const RenderBlock* FastTextAutosizer::deepestCommonAncestor(BlockSet& blocks)
float FastTextAutosizer::clusterMultiplier(Cluster* cluster) float FastTextAutosizer::clusterMultiplier(Cluster* cluster)
{ {
ASSERT(m_renderViewInfoPrepared);
if (!cluster->m_multiplier) { if (!cluster->m_multiplier) {
if (cluster->m_root->isTable() if (cluster->m_root->isTable()
|| isIndependentDescendant(cluster->m_root) || isIndependentDescendant(cluster->m_root)
...@@ -790,7 +839,7 @@ const RenderObject* FastTextAutosizer::findTextLeaf(const RenderObject* parent, ...@@ -790,7 +839,7 @@ const RenderObject* FastTextAutosizer::findTextLeaf(const RenderObject* parent,
return 0; return 0;
} }
void FastTextAutosizer::applyMultiplier(RenderObject* renderer, float multiplier) void FastTextAutosizer::applyMultiplier(RenderObject* renderer, float multiplier, RelayoutBehavior relayoutBehavior)
{ {
ASSERT(renderer); ASSERT(renderer);
RenderStyle* currentStyle = renderer->style(); RenderStyle* currentStyle = renderer->style();
...@@ -801,10 +850,21 @@ void FastTextAutosizer::applyMultiplier(RenderObject* renderer, float multiplier ...@@ -801,10 +850,21 @@ void FastTextAutosizer::applyMultiplier(RenderObject* renderer, float multiplier
RefPtr<RenderStyle> style = RenderStyle::clone(currentStyle); RefPtr<RenderStyle> style = RenderStyle::clone(currentStyle);
style->setTextAutosizingMultiplier(multiplier); style->setTextAutosizingMultiplier(multiplier);
style->setUnique(); style->setUnique();
renderer->setStyleInternal(style.release());
if (renderer->isRenderBlock()) switch (relayoutBehavior) {
toRenderBlock(renderer)->invalidateLineHeight(); case AlreadyInLayout:
renderer->setStyleInternal(style.release());
if (renderer->isRenderBlock())
toRenderBlock(renderer)->invalidateLineHeight();
break;
case LayoutNeeded:
renderer->setStyle(style.release());
break;
}
if (multiplier != 1)
m_previouslyAutosized = true;
} }
bool FastTextAutosizer::isWiderOrNarrowerDescendant(Cluster* cluster) bool FastTextAutosizer::isWiderOrNarrowerDescendant(Cluster* cluster)
...@@ -915,15 +975,7 @@ FastTextAutosizer::LayoutScope::LayoutScope(RenderBlock* block) ...@@ -915,15 +975,7 @@ FastTextAutosizer::LayoutScope::LayoutScope(RenderBlock* block)
if (!m_textAutosizer) if (!m_textAutosizer)
return; return;
if (!m_textAutosizer->enabled()) { if (m_textAutosizer->enabled() && m_textAutosizer->m_pageNeedsAutosizing)
m_textAutosizer = 0;
return;
}
if (m_textAutosizer->m_pageAutosizingStatus == PageAutosizingStatusUnknown)
m_textAutosizer->updateRenderViewInfo();
if (m_textAutosizer->m_pageAutosizingStatus == PageNeedsAutosizing)
m_textAutosizer->beginLayout(m_block); m_textAutosizer->beginLayout(m_block);
else else
m_textAutosizer = 0; m_textAutosizer = 0;
......
...@@ -60,6 +60,8 @@ public: ...@@ -60,6 +60,8 @@ public:
return adoptPtr(new FastTextAutosizer(document)); return adoptPtr(new FastTextAutosizer(document));
} }
void updatePageInfoInAllFrames();
void updatePageInfo();
void record(const RenderBlock*); void record(const RenderBlock*);
void destroy(const RenderBlock*); void destroy(const RenderBlock*);
void inflateListItem(RenderListItem*, RenderListMarker*); void inflateListItem(RenderListItem*, RenderListMarker*);
...@@ -82,10 +84,9 @@ private: ...@@ -82,10 +84,9 @@ private:
NotEnoughText NotEnoughText
}; };
enum PageAutosizingStatus { enum RelayoutBehavior {
PageAutosizingStatusUnknown, AlreadyInLayout, // The default; appropriate if we are already in layout.
PageNeedsAutosizing, LayoutNeeded // Use this if changing a multiplier outside of layout.
PageDoesNotNeedAutosizing
}; };
// A supercluster represents autosizing information about a set of two or // A supercluster represents autosizing information about a set of two or
...@@ -190,7 +191,8 @@ private: ...@@ -190,7 +191,8 @@ private:
void inflateTable(RenderTable*); void inflateTable(RenderTable*);
void inflate(RenderBlock*); void inflate(RenderBlock*);
bool enabled(); bool enabled();
void updateRenderViewInfo(); void setAllTextNeedsLayout();
void resetMultipliers();
void prepareClusterStack(const RenderObject*); void prepareClusterStack(const RenderObject*);
bool isFingerprintingCandidate(const RenderBlock*); bool isFingerprintingCandidate(const RenderBlock*);
bool clusterHasEnoughTextToAutosize(Cluster*, const RenderBlock* widthProvider = 0); bool clusterHasEnoughTextToAutosize(Cluster*, const RenderBlock* widthProvider = 0);
...@@ -211,7 +213,7 @@ private: ...@@ -211,7 +213,7 @@ private:
// block's width otherwise. // block's width otherwise.
float widthFromBlock(const RenderBlock*); float widthFromBlock(const RenderBlock*);
float multiplierFromBlock(const RenderBlock*); float multiplierFromBlock(const RenderBlock*);
void applyMultiplier(RenderObject*, float); void applyMultiplier(RenderObject*, float, RelayoutBehavior = AlreadyInLayout);
bool isWiderOrNarrowerDescendant(Cluster*); bool isWiderOrNarrowerDescendant(Cluster*);
bool isLayoutRoot(const RenderBlock*) const; bool isLayoutRoot(const RenderBlock*) const;
...@@ -230,10 +232,10 @@ private: ...@@ -230,10 +232,10 @@ private:
int m_frameWidth; // LocalFrame width in density-independent pixels (DIPs). int m_frameWidth; // LocalFrame width in density-independent pixels (DIPs).
int m_layoutWidth; // Layout width in CSS pixels. int m_layoutWidth; // Layout width in CSS pixels.
float m_baseMultiplier; // Includes accessibility font scale factor and device scale adjustment. float m_baseMultiplier; // Includes accessibility font scale factor and device scale adjustment.
PageAutosizingStatus m_pageAutosizingStatus; bool m_pageNeedsAutosizing;
bool m_previouslyAutosized;
const RenderBlock* m_firstBlock; // First block to receive beginLayout. const RenderBlock* m_firstBlock; // First block to receive beginLayout.
#ifndef NDEBUG #ifndef NDEBUG
bool m_renderViewInfoPrepared;
BlockSet m_blocksThatHaveBegunLayout; // Used to ensure we don't compute properties of a block before beginLayout() is called on it. BlockSet m_blocksThatHaveBegunLayout; // Used to ensure we don't compute properties of a block before beginLayout() is called on it.
#endif #endif
......
...@@ -113,6 +113,7 @@ ...@@ -113,6 +113,7 @@
#include "core/page/PointerLockController.h" #include "core/page/PointerLockController.h"
#include "core/page/ScopedPageLoadDeferrer.h" #include "core/page/ScopedPageLoadDeferrer.h"
#include "core/page/TouchDisambiguation.h" #include "core/page/TouchDisambiguation.h"
#include "core/rendering/FastTextAutosizer.h"
#include "core/rendering/RenderView.h" #include "core/rendering/RenderView.h"
#include "core/rendering/RenderWidget.h" #include "core/rendering/RenderWidget.h"
#include "core/rendering/TextAutosizer.h" #include "core/rendering/TextAutosizer.h"
...@@ -2863,6 +2864,11 @@ void WebViewImpl::updatePageDefinedViewportConstraints(const ViewportDescription ...@@ -2863,6 +2864,11 @@ void WebViewImpl::updatePageDefinedViewportConstraints(const ViewportDescription
} }
updateMainFrameLayoutSize(); updateMainFrameLayoutSize();
if (LocalFrame* frame = page()->mainFrame()) {
if (FastTextAutosizer* textAutosizer = frame->document()->fastTextAutosizer())
textAutosizer->updatePageInfoInAllFrames();
}
} }
void WebViewImpl::updateMainFrameLayoutSize() void WebViewImpl::updateMainFrameLayoutSize()
...@@ -2881,8 +2887,7 @@ void WebViewImpl::updateMainFrameLayoutSize() ...@@ -2881,8 +2887,7 @@ void WebViewImpl::updateMainFrameLayoutSize()
bool textAutosizingEnabled = page()->settings().textAutosizingEnabled(); bool textAutosizingEnabled = page()->settings().textAutosizingEnabled();
if (textAutosizingEnabled && layoutSize.width != view->layoutSize().width()) { if (textAutosizingEnabled && layoutSize.width != view->layoutSize().width()) {
TextAutosizer* textAutosizer = page()->mainFrame()->document()->textAutosizer(); if (TextAutosizer* textAutosizer = page()->mainFrame()->document()->textAutosizer())
if (textAutosizer)
textAutosizer->recalculateMultipliers(); textAutosizer->recalculateMultipliers();
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment