| Index: Source/core/rendering/TextAutosizer.cpp
|
| diff --git a/Source/core/rendering/TextAutosizer.cpp b/Source/core/rendering/TextAutosizer.cpp
|
| index c1bb64adf55906929daf5c51977c38ed551cf51d..99fe26cc91ea94fce907c018ffeaf3f1aca591da 100644
|
| --- a/Source/core/rendering/TextAutosizer.cpp
|
| +++ b/Source/core/rendering/TextAutosizer.cpp
|
| @@ -169,8 +169,20 @@ unsigned TextAutosizer::getCachedHash(const RenderObject* renderer, bool putInCa
|
| return combinedHashValue;
|
| }
|
|
|
| +bool TextAutosizer::isApplicable() const
|
| +{
|
| + return m_document->settings()
|
| + && m_document->settings()->textAutosizingEnabled()
|
| + && m_document->page()
|
| + && m_document->page()->mainFrame()
|
| + && m_document->page()->mainFrame()->loader().stateMachine()->committedFirstRealDocumentLoad();
|
| +}
|
| +
|
| void TextAutosizer::recalculateMultipliers()
|
| {
|
| + if (!isApplicable())
|
| + return;
|
| +
|
| RenderObject* renderer = m_document->renderer();
|
| while (renderer) {
|
| if (renderer->style() && renderer->style()->textAutosizingMultiplier() != 1)
|
| @@ -183,19 +195,12 @@ bool TextAutosizer::processSubtree(RenderObject* layoutRoot)
|
| {
|
| TRACE_EVENT0("webkit", "TextAutosizer::processSubtree");
|
|
|
| - if (!m_document->settings() || layoutRoot->view()->document().printing() || !m_document->page())
|
| - return false;
|
| -
|
| - bool textAutosizingEnabled = m_document->settings()->textAutosizingEnabled();
|
| - if (!textAutosizingEnabled)
|
| + if (!isApplicable() || layoutRoot->view()->document().printing())
|
| return false;
|
|
|
| LocalFrame* mainFrame = m_document->page()->mainFrame();
|
| TextAutosizingWindowInfo windowInfo;
|
|
|
| - if (!mainFrame->loader().stateMachine()->committedFirstRealDocumentLoad())
|
| - return false;
|
| -
|
| InspectorInstrumentation::willAutosizeText(layoutRoot);
|
|
|
| // Window area, in logical (density-independent) pixels.
|
|
|