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

Side by Side 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved.
7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. 8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved.
9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved.
(...skipping 4408 matching lines...) Expand 10 before | Expand all | Expand 10 after
4419 { 4419 {
4420 ASSERT(!scriptableDocumentParser() || !m_parser->isParsing()); 4420 ASSERT(!scriptableDocumentParser() || !m_parser->isParsing());
4421 ASSERT(!scriptableDocumentParser() || m_readyState != Loading); 4421 ASSERT(!scriptableDocumentParser() || m_readyState != Loading);
4422 setParsing(false); 4422 setParsing(false);
4423 if (!m_documentTiming.domContentLoadedEventStart) 4423 if (!m_documentTiming.domContentLoadedEventStart)
4424 m_documentTiming.domContentLoadedEventStart = monotonicallyIncreasingTim e(); 4424 m_documentTiming.domContentLoadedEventStart = monotonicallyIncreasingTim e();
4425 dispatchEvent(Event::createBubble(EventTypeNames::DOMContentLoaded)); 4425 dispatchEvent(Event::createBubble(EventTypeNames::DOMContentLoaded));
4426 if (!m_documentTiming.domContentLoadedEventEnd) 4426 if (!m_documentTiming.domContentLoadedEventEnd)
4427 m_documentTiming.domContentLoadedEventEnd = monotonicallyIncreasingTime( ); 4427 m_documentTiming.domContentLoadedEventEnd = monotonicallyIncreasingTime( );
4428 4428
4429 if (frame() && frame()->isMainFrame()) {
4430 // Reset the text autosizing multipliers on main frame when DOM is loade d.
4431 // This is to allow for a fresh text autosizing pass when the page layou t
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
4432 // changes significantly in the end.
4433 if (TextAutosizer* textAutosizer = this->textAutosizer())
4434 textAutosizer->recalculateMultipliers();
4435 }
4436
4429 // The loader's finishedParsing() method may invoke script that causes this object to 4437 // The loader's finishedParsing() method may invoke script that causes this object to
4430 // be dereferenced (when this document is in an iframe and the onload causes the iframe's src to change). 4438 // be dereferenced (when this document is in an iframe and the onload causes the iframe's src to change).
4431 // Keep it alive until we are done. 4439 // Keep it alive until we are done.
4432 RefPtr<Document> protect(this); 4440 RefPtr<Document> protect(this);
4433 4441
4434 if (RefPtr<LocalFrame> f = frame()) { 4442 if (RefPtr<LocalFrame> f = frame()) {
4435 // FrameLoader::finishedParsing() might end up calling Document::implici tClose() if all 4443 // FrameLoader::finishedParsing() might end up calling Document::implici tClose() if all
4436 // resource loads are complete. HTMLObjectElements can start loading the ir resources from 4444 // resource loads are complete. HTMLObjectElements can start loading the ir resources from
4437 // post attach callbacks triggered by recalcStyle(). This means if we p arse out an <object> 4445 // post attach callbacks triggered by recalcStyle(). This means if we p arse out an <object>
4438 // tag and then reach the end of the document without updating styles, w e might not have yet 4446 // tag and then reach the end of the document without updating styles, w e might not have yet
(...skipping 1045 matching lines...) Expand 10 before | Expand all | Expand 10 after
5484 } 5492 }
5485 5493
5486 void Document::invalidateNodeListCaches(const QualifiedName* attrName) 5494 void Document::invalidateNodeListCaches(const QualifiedName* attrName)
5487 { 5495 {
5488 HashSet<LiveNodeListBase*>::iterator end = m_listsInvalidatedAtDocument.end( ); 5496 HashSet<LiveNodeListBase*>::iterator end = m_listsInvalidatedAtDocument.end( );
5489 for (HashSet<LiveNodeListBase*>::iterator it = m_listsInvalidatedAtDocument. begin(); it != end; ++it) 5497 for (HashSet<LiveNodeListBase*>::iterator it = m_listsInvalidatedAtDocument. begin(); it != end; ++it)
5490 (*it)->invalidateCache(attrName); 5498 (*it)->invalidateCache(attrName);
5491 } 5499 }
5492 5500
5493 } // namespace WebCore 5501 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698