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

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

Issue 1300043003: Centralize deferred commit conditions. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 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/web/WebViewImpl.h » ('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 349 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 element->focus(); 360 element->focus();
361 } 361 }
362 } 362 }
363 }; 363 };
364 364
365 Document::Document(const DocumentInit& initializer, DocumentClassFlags documentC lasses) 365 Document::Document(const DocumentInit& initializer, DocumentClassFlags documentC lasses)
366 : ContainerNode(0, CreateDocument) 366 : ContainerNode(0, CreateDocument)
367 , TreeScope(*this) 367 , TreeScope(*this)
368 , m_hasNodesWithPlaceholderStyle(false) 368 , m_hasNodesWithPlaceholderStyle(false)
369 , m_evaluateMediaQueriesOnStyleRecalc(false) 369 , m_evaluateMediaQueriesOnStyleRecalc(false)
370 , m_shouldProcessFrameLifecycle(false)
370 , m_pendingSheetLayout(NoLayoutWithPendingSheets) 371 , m_pendingSheetLayout(NoLayoutWithPendingSheets)
371 , m_frame(initializer.frame()) 372 , m_frame(initializer.frame())
372 , m_domWindow(m_frame ? m_frame->localDOMWindow() : 0) 373 , m_domWindow(m_frame ? m_frame->localDOMWindow() : 0)
373 , m_importsController(initializer.importsController()) 374 , m_importsController(initializer.importsController())
374 , m_activeParserCount(0) 375 , m_activeParserCount(0)
375 , m_contextFeatures(ContextFeatures::defaultSwitch()) 376 , m_contextFeatures(ContextFeatures::defaultSwitch())
376 , m_wellFormed(false) 377 , m_wellFormed(false)
377 , m_printing(false) 378 , m_printing(false)
378 , m_paginatedForScreen(false) 379 , m_paginatedForScreen(false)
379 , m_compatibilityMode(NoQuirksMode) 380 , m_compatibilityMode(NoQuirksMode)
(...skipping 4699 matching lines...) Expand 10 before | Expand all | Expand 10 after
5079 // FIXME: Remove this timer once we don't need to compute layout to load plu gins. 5080 // FIXME: Remove this timer once we don't need to compute layout to load plu gins.
5080 if (!m_pluginLoadingTimer.isActive()) 5081 if (!m_pluginLoadingTimer.isActive())
5081 m_pluginLoadingTimer.startOneShot(0, FROM_HERE); 5082 m_pluginLoadingTimer.startOneShot(0, FROM_HERE);
5082 } 5083 }
5083 5084
5084 void Document::pluginLoadingTimerFired(Timer<Document>*) 5085 void Document::pluginLoadingTimerFired(Timer<Document>*)
5085 { 5086 {
5086 updateLayout(); 5087 updateLayout();
5087 } 5088 }
5088 5089
5090 bool Document::shouldProcessFrameLifecycle()
5091 {
5092 if (m_shouldProcessFrameLifecycle)
5093 return true;
5094 if (!isRenderingReady())
5095 return false;
5096 if ((isHTMLDocument() || isXHTMLDocument()) && !body() && parsing())
5097 return false;
5098 // Once the page starts processing the pipeline we should never stop.
5099 m_shouldProcessFrameLifecycle = true;
5100 return true;
5101 }
5102
5089 ScriptedAnimationController& Document::ensureScriptedAnimationController() 5103 ScriptedAnimationController& Document::ensureScriptedAnimationController()
5090 { 5104 {
5091 if (!m_scriptedAnimationController) { 5105 if (!m_scriptedAnimationController) {
5092 m_scriptedAnimationController = ScriptedAnimationController::create(this ); 5106 m_scriptedAnimationController = ScriptedAnimationController::create(this );
5093 // We need to make sure that we don't start up the animation controller on a background tab, for example. 5107 // We need to make sure that we don't start up the animation controller on a background tab, for example.
5094 if (!page()) 5108 if (!page())
5095 m_scriptedAnimationController->suspend(); 5109 m_scriptedAnimationController->suspend();
5096 } 5110 }
5097 return *m_scriptedAnimationController; 5111 return *m_scriptedAnimationController;
5098 } 5112 }
(...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after
5679 #ifndef NDEBUG 5693 #ifndef NDEBUG
5680 using namespace blink; 5694 using namespace blink;
5681 void showLiveDocumentInstances() 5695 void showLiveDocumentInstances()
5682 { 5696 {
5683 Document::WeakDocumentSet& set = Document::liveDocumentSet(); 5697 Document::WeakDocumentSet& set = Document::liveDocumentSet();
5684 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 5698 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
5685 for (Document* document : set) 5699 for (Document* document : set)
5686 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str ing().utf8().data()); 5700 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str ing().utf8().data());
5687 } 5701 }
5688 #endif 5702 #endif
OLDNEW
« no previous file with comments | « Source/core/dom/Document.h ('k') | Source/web/WebViewImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698