OLD | NEW |
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 Loading... |
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) | |
371 , m_pendingSheetLayout(NoLayoutWithPendingSheets) | 370 , m_pendingSheetLayout(NoLayoutWithPendingSheets) |
372 , m_frame(initializer.frame()) | 371 , m_frame(initializer.frame()) |
373 , m_domWindow(m_frame ? m_frame->localDOMWindow() : 0) | 372 , m_domWindow(m_frame ? m_frame->localDOMWindow() : 0) |
374 , m_importsController(initializer.importsController()) | 373 , m_importsController(initializer.importsController()) |
375 , m_activeParserCount(0) | 374 , m_activeParserCount(0) |
376 , m_contextFeatures(ContextFeatures::defaultSwitch()) | 375 , m_contextFeatures(ContextFeatures::defaultSwitch()) |
377 , m_wellFormed(false) | 376 , m_wellFormed(false) |
378 , m_printing(false) | 377 , m_printing(false) |
379 , m_paginatedForScreen(false) | 378 , m_paginatedForScreen(false) |
380 , m_compatibilityMode(NoQuirksMode) | 379 , m_compatibilityMode(NoQuirksMode) |
(...skipping 4699 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5080 // FIXME: Remove this timer once we don't need to compute layout to load plu
gins. | 5079 // FIXME: Remove this timer once we don't need to compute layout to load plu
gins. |
5081 if (!m_pluginLoadingTimer.isActive()) | 5080 if (!m_pluginLoadingTimer.isActive()) |
5082 m_pluginLoadingTimer.startOneShot(0, FROM_HERE); | 5081 m_pluginLoadingTimer.startOneShot(0, FROM_HERE); |
5083 } | 5082 } |
5084 | 5083 |
5085 void Document::pluginLoadingTimerFired(Timer<Document>*) | 5084 void Document::pluginLoadingTimerFired(Timer<Document>*) |
5086 { | 5085 { |
5087 updateLayout(); | 5086 updateLayout(); |
5088 } | 5087 } |
5089 | 5088 |
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 | |
5103 ScriptedAnimationController& Document::ensureScriptedAnimationController() | 5089 ScriptedAnimationController& Document::ensureScriptedAnimationController() |
5104 { | 5090 { |
5105 if (!m_scriptedAnimationController) { | 5091 if (!m_scriptedAnimationController) { |
5106 m_scriptedAnimationController = ScriptedAnimationController::create(this
); | 5092 m_scriptedAnimationController = ScriptedAnimationController::create(this
); |
5107 // We need to make sure that we don't start up the animation controller
on a background tab, for example. | 5093 // We need to make sure that we don't start up the animation controller
on a background tab, for example. |
5108 if (!page()) | 5094 if (!page()) |
5109 m_scriptedAnimationController->suspend(); | 5095 m_scriptedAnimationController->suspend(); |
5110 } | 5096 } |
5111 return *m_scriptedAnimationController; | 5097 return *m_scriptedAnimationController; |
5112 } | 5098 } |
(...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5693 #ifndef NDEBUG | 5679 #ifndef NDEBUG |
5694 using namespace blink; | 5680 using namespace blink; |
5695 void showLiveDocumentInstances() | 5681 void showLiveDocumentInstances() |
5696 { | 5682 { |
5697 Document::WeakDocumentSet& set = Document::liveDocumentSet(); | 5683 Document::WeakDocumentSet& set = Document::liveDocumentSet(); |
5698 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); | 5684 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); |
5699 for (Document* document : set) | 5685 for (Document* document : set) |
5700 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str
ing().utf8().data()); | 5686 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str
ing().utf8().data()); |
5701 } | 5687 } |
5702 #endif | 5688 #endif |
OLD | NEW |