| 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 1700 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1711 } | 1711 } |
| 1712 | 1712 |
| 1713 if (Element* oe = ownerElement()) | 1713 if (Element* oe = ownerElement()) |
| 1714 oe->document()->updateLayout(); | 1714 oe->document()->updateLayout(); |
| 1715 | 1715 |
| 1716 updateStyleIfNeeded(); | 1716 updateStyleIfNeeded(); |
| 1717 | 1717 |
| 1718 StackStats::LayoutCheckPoint layoutCheckPoint; | 1718 StackStats::LayoutCheckPoint layoutCheckPoint; |
| 1719 | 1719 |
| 1720 // Only do a layout if changes have occurred that make it necessary. | 1720 // Only do a layout if changes have occurred that make it necessary. |
| 1721 if (frameView && renderer() && (frameView->layoutPending() || renderer()->ne
edsLayout())) | 1721 if (frameView && renderer() && (frameView->layoutIsScheduledWithEmbedder() |
| renderer()->needsLayout())) |
| 1722 frameView->layout(); | 1722 frameView->layout(); |
| 1723 | 1723 |
| 1724 // FIXME: Using a Task doesn't look a good idea. | 1724 // FIXME: Using a Task doesn't look a good idea. |
| 1725 if (m_focusedElement && !m_didPostCheckFocusedElementTask) { | 1725 if (m_focusedElement && !m_didPostCheckFocusedElementTask) { |
| 1726 postTask(CheckFocusedElementTask::create()); | 1726 postTask(CheckFocusedElementTask::create()); |
| 1727 m_didPostCheckFocusedElementTask = true; | 1727 m_didPostCheckFocusedElementTask = true; |
| 1728 } | 1728 } |
| 1729 } | 1729 } |
| 1730 | 1730 |
| 1731 // FIXME: This is a bad idea and needs to be removed eventually. | 1731 // FIXME: This is a bad idea and needs to be removed eventually. |
| (...skipping 577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2309 // | 2309 // |
| 2310 // (a) Only schedule a layout once the stylesheets are loaded. | 2310 // (a) Only schedule a layout once the stylesheets are loaded. |
| 2311 // (b) Only schedule layout once we have a body element. | 2311 // (b) Only schedule layout once we have a body element. |
| 2312 | 2312 |
| 2313 return (haveStylesheetsLoaded() && body()) | 2313 return (haveStylesheetsLoaded() && body()) |
| 2314 || (documentElement() && !isHTMLHtmlElement(documentElement())); | 2314 || (documentElement() && !isHTMLHtmlElement(documentElement())); |
| 2315 } | 2315 } |
| 2316 | 2316 |
| 2317 bool Document::shouldParserYieldAgressivelyBeforeScriptExecution() | 2317 bool Document::shouldParserYieldAgressivelyBeforeScriptExecution() |
| 2318 { | 2318 { |
| 2319 return view() && view()->layoutPending() && !minimumLayoutDelay(); | 2319 return view() && view()->layoutIsScheduledWithEmbedder() && !minimumLayoutDe
lay(); |
| 2320 } | 2320 } |
| 2321 | 2321 |
| 2322 // FIXME: I believe this whole function is useless. |
| 2322 int Document::minimumLayoutDelay() | 2323 int Document::minimumLayoutDelay() |
| 2323 { | 2324 { |
| 2324 if (m_overMinimumLayoutThreshold) | 2325 if (m_overMinimumLayoutThreshold) |
| 2325 return 0; | 2326 return 0; |
| 2326 | 2327 |
| 2327 int elapsed = elapsedTime(); | 2328 int elapsed = elapsedTime(); |
| 2328 m_overMinimumLayoutThreshold = elapsed > cLayoutScheduleThreshold; | 2329 m_overMinimumLayoutThreshold = elapsed > cLayoutScheduleThreshold; |
| 2329 | 2330 |
| 2330 // We'll want to schedule the timer to fire at the minimum layout threshold. | 2331 // We'll want to schedule the timer to fire at the minimum layout threshold. |
| 2331 return max(0, cLayoutScheduleThreshold - elapsed); | 2332 return max(0, cLayoutScheduleThreshold - elapsed); |
| (...skipping 2755 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5087 { | 5088 { |
| 5088 return DocumentLifecycleNotifier::create(this); | 5089 return DocumentLifecycleNotifier::create(this); |
| 5089 } | 5090 } |
| 5090 | 5091 |
| 5091 DocumentLifecycleNotifier* Document::lifecycleNotifier() | 5092 DocumentLifecycleNotifier* Document::lifecycleNotifier() |
| 5092 { | 5093 { |
| 5093 return static_cast<DocumentLifecycleNotifier*>(ScriptExecutionContext::lifec
ycleNotifier()); | 5094 return static_cast<DocumentLifecycleNotifier*>(ScriptExecutionContext::lifec
ycleNotifier()); |
| 5094 } | 5095 } |
| 5095 | 5096 |
| 5096 } // namespace WebCore | 5097 } // namespace WebCore |
| OLD | NEW |