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

Unified Diff: Source/core/dom/Document.cpp

Issue 189113014: TextAutosizer: unlock multipliers on DOMContentLoaded. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix TestExpectation to ImageOnlyFailure Created 6 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: Source/core/dom/Document.cpp
diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp
index b2e304f6171cf67a079317d0cc1399a16ea01f57..cfb6cfda47fc6a9b3b729276cb0b90099364b774 100644
--- a/Source/core/dom/Document.cpp
+++ b/Source/core/dom/Document.cpp
@@ -4393,6 +4393,14 @@ void Document::finishedParsing()
if (!m_documentTiming.domContentLoadedEventEnd)
m_documentTiming.domContentLoadedEventEnd = monotonicallyIncreasingTime();
+ if (frame() && frame()->isMainFrame()) {
+ // Reset the text autosizing multipliers on main frame when DOM is loaded.
+ // This is to allow for a fresh text autosizing pass when the page layout
+ // changes significantly in the end.
+ if (TextAutosizer* textAutosizer = this->textAutosizer())
+ textAutosizer->recalculateMultipliers();
+ }
+
// The loader's finishedParsing() method may invoke script that causes this object to
// be dereferenced (when this document is in an iframe and the onload causes the iframe's src to change).
// Keep it alive until we are done.

Powered by Google App Engine
This is Rietveld 408576698