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

Side by Side Diff: Source/core/dom/Document.cpp

Issue 346603005: Remove the old text autosizer (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase for landing Created 6 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/dom/Document.h ('k') | Source/core/frame/FrameView.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 #include "core/page/EventWithHitTestResults.h" 166 #include "core/page/EventWithHitTestResults.h"
167 #include "core/page/FocusController.h" 167 #include "core/page/FocusController.h"
168 #include "core/page/FrameTree.h" 168 #include "core/page/FrameTree.h"
169 #include "core/page/Page.h" 169 #include "core/page/Page.h"
170 #include "core/page/PointerLockController.h" 170 #include "core/page/PointerLockController.h"
171 #include "core/page/scrolling/ScrollingCoordinator.h" 171 #include "core/page/scrolling/ScrollingCoordinator.h"
172 #include "core/rendering/FastTextAutosizer.h" 172 #include "core/rendering/FastTextAutosizer.h"
173 #include "core/rendering/HitTestResult.h" 173 #include "core/rendering/HitTestResult.h"
174 #include "core/rendering/RenderView.h" 174 #include "core/rendering/RenderView.h"
175 #include "core/rendering/RenderWidget.h" 175 #include "core/rendering/RenderWidget.h"
176 #include "core/rendering/TextAutosizer.h"
177 #include "core/rendering/compositing/RenderLayerCompositor.h" 176 #include "core/rendering/compositing/RenderLayerCompositor.h"
178 #include "core/svg/SVGDocumentExtensions.h" 177 #include "core/svg/SVGDocumentExtensions.h"
179 #include "core/svg/SVGFontFaceElement.h" 178 #include "core/svg/SVGFontFaceElement.h"
180 #include "core/svg/SVGTitleElement.h" 179 #include "core/svg/SVGTitleElement.h"
181 #include "core/svg/SVGUseElement.h" 180 #include "core/svg/SVGUseElement.h"
182 #include "core/workers/SharedWorkerRepositoryClient.h" 181 #include "core/workers/SharedWorkerRepositoryClient.h"
183 #include "core/xml/XSLTProcessor.h" 182 #include "core/xml/XSLTProcessor.h"
184 #include "core/xml/parser/XMLDocumentParser.h" 183 #include "core/xml/parser/XMLDocumentParser.h"
185 #include "platform/DateComponents.h" 184 #include "platform/DateComponents.h"
186 #include "platform/Language.h" 185 #include "platform/Language.h"
(...skipping 4430 matching lines...) Expand 10 before | Expand all | Expand 10 after
4617 { 4616 {
4618 ASSERT(!scriptableDocumentParser() || !m_parser->isParsing()); 4617 ASSERT(!scriptableDocumentParser() || !m_parser->isParsing());
4619 ASSERT(!scriptableDocumentParser() || m_readyState != Loading); 4618 ASSERT(!scriptableDocumentParser() || m_readyState != Loading);
4620 setParsing(false); 4619 setParsing(false);
4621 if (!m_documentTiming.domContentLoadedEventStart) 4620 if (!m_documentTiming.domContentLoadedEventStart)
4622 m_documentTiming.domContentLoadedEventStart = monotonicallyIncreasingTim e(); 4621 m_documentTiming.domContentLoadedEventStart = monotonicallyIncreasingTim e();
4623 dispatchEvent(Event::createBubble(EventTypeNames::DOMContentLoaded)); 4622 dispatchEvent(Event::createBubble(EventTypeNames::DOMContentLoaded));
4624 if (!m_documentTiming.domContentLoadedEventEnd) 4623 if (!m_documentTiming.domContentLoadedEventEnd)
4625 m_documentTiming.domContentLoadedEventEnd = monotonicallyIncreasingTime( ); 4624 m_documentTiming.domContentLoadedEventEnd = monotonicallyIncreasingTime( );
4626 4625
4627 if (frame() && frame()->isMainFrame()) {
4628 // Reset the text autosizing multipliers on main frame when DOM is loade d.
4629 // This is to allow for a fresh text autosizing pass when the page layou t
4630 // changes significantly in the end.
4631 if (TextAutosizer* textAutosizer = this->textAutosizer())
4632 textAutosizer->recalculateMultipliers();
4633 }
4634
4635 // The loader's finishedParsing() method may invoke script that causes this object to 4626 // The loader's finishedParsing() method may invoke script that causes this object to
4636 // be dereferenced (when this document is in an iframe and the onload causes the iframe's src to change). 4627 // be dereferenced (when this document is in an iframe and the onload causes the iframe's src to change).
4637 // Keep it alive until we are done. 4628 // Keep it alive until we are done.
4638 RefPtrWillBeRawPtr<Document> protect(this); 4629 RefPtrWillBeRawPtr<Document> protect(this);
4639 4630
4640 if (RefPtr<LocalFrame> f = frame()) { 4631 if (RefPtr<LocalFrame> f = frame()) {
4641 // Don't update the render tree if we haven't requested the main resourc e yet to avoid 4632 // Don't update the render tree if we haven't requested the main resourc e yet to avoid
4642 // adding extra latency. Note that the first render tree update can be e xpensive since it 4633 // adding extra latency. Note that the first render tree update can be e xpensive since it
4643 // triggers the parsing of the default stylesheets which are compiled-in . 4634 // triggers the parsing of the default stylesheets which are compiled-in .
4644 const bool mainResourceWasAlreadyRequested = 4635 const bool mainResourceWasAlreadyRequested =
(...skipping 1016 matching lines...) Expand 10 before | Expand all | Expand 10 after
5661 void Document::modifiedStyleSheet(StyleSheet* sheet, StyleResolverUpdateMode upd ateMode) 5652 void Document::modifiedStyleSheet(StyleSheet* sheet, StyleResolverUpdateMode upd ateMode)
5662 { 5653 {
5663 // If we're in document teardown, then we don't need this notification of ou r sheet's removal. 5654 // If we're in document teardown, then we don't need this notification of ou r sheet's removal.
5664 // styleResolverChanged() is needed even when the document is inactive so th at 5655 // styleResolverChanged() is needed even when the document is inactive so th at
5665 // imported docuements (which is inactive) notifies the change to the master document. 5656 // imported docuements (which is inactive) notifies the change to the master document.
5666 if (isActive()) 5657 if (isActive())
5667 styleEngine()->modifiedStyleSheet(sheet); 5658 styleEngine()->modifiedStyleSheet(sheet);
5668 styleResolverChanged(updateMode); 5659 styleResolverChanged(updateMode);
5669 } 5660 }
5670 5661
5671 TextAutosizer* Document::textAutosizer()
5672 {
5673 if (!m_textAutosizer && !RuntimeEnabledFeatures::fastTextAutosizingEnabled() )
5674 m_textAutosizer = TextAutosizer::create(this);
5675 return m_textAutosizer.get();
5676 }
5677
5678 FastTextAutosizer* Document::fastTextAutosizer() 5662 FastTextAutosizer* Document::fastTextAutosizer()
5679 { 5663 {
5680 if (!m_fastTextAutosizer && RuntimeEnabledFeatures::fastTextAutosizingEnable d()) 5664 if (!m_fastTextAutosizer && RuntimeEnabledFeatures::fastTextAutosizingEnable d())
5681 m_fastTextAutosizer = FastTextAutosizer::create(this); 5665 m_fastTextAutosizer = FastTextAutosizer::create(this);
5682 return m_fastTextAutosizer.get(); 5666 return m_fastTextAutosizer.get();
5683 } 5667 }
5684 5668
5685 void Document::setAutofocusElement(Element* element) 5669 void Document::setAutofocusElement(Element* element)
5686 { 5670 {
5687 if (!element) { 5671 if (!element) {
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
5896 using namespace blink; 5880 using namespace blink;
5897 void showLiveDocumentInstances() 5881 void showLiveDocumentInstances()
5898 { 5882 {
5899 WeakDocumentSet& set = liveDocumentSet(); 5883 WeakDocumentSet& set = liveDocumentSet();
5900 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 5884 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
5901 for (WeakDocumentSet::const_iterator it = set.begin(); it != set.end(); ++it ) { 5885 for (WeakDocumentSet::const_iterator it = set.begin(); it != set.end(); ++it ) {
5902 fprintf(stderr, "- Document %p URL: %s\n", *it, (*it)->url().string().ut f8().data()); 5886 fprintf(stderr, "- Document %p URL: %s\n", *it, (*it)->url().string().ut f8().data());
5903 } 5887 }
5904 } 5888 }
5905 #endif 5889 #endif
OLDNEW
« no previous file with comments | « Source/core/dom/Document.h ('k') | Source/core/frame/FrameView.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698