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

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: similarity=90 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 e8ef2cf7c438b303bde920dd19ce242e5aec7fab..66867199120831c94a4cc338769b1a0d67c76290 100644
--- a/Source/core/dom/Document.cpp
+++ b/Source/core/dom/Document.cpp
@@ -4426,6 +4426,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
skobes 2014/03/11 17:47:58 I'm confused here - the autosizer is called by lay
timvolodine 2014/03/11 17:57:05 Yes, what I meant is to allow for a fresh autosizi
skobes 2014/03/11 19:30:22 I see, this is because you don't allow the multipl
+ // 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