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 1541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1552 // InPreLayout will recalc style itself. There's no reason to schedule anoth
er recalc. | 1552 // InPreLayout will recalc style itself. There's no reason to schedule anoth
er recalc. |
1553 if (m_lifecycle.state() == DocumentLifecycle::InPreLayout) | 1553 if (m_lifecycle.state() == DocumentLifecycle::InPreLayout) |
1554 return false; | 1554 return false; |
1555 if (!shouldScheduleLayout()) | 1555 if (!shouldScheduleLayout()) |
1556 return false; | 1556 return false; |
1557 return true; | 1557 return true; |
1558 } | 1558 } |
1559 | 1559 |
1560 void Document::scheduleLayoutTreeUpdate() | 1560 void Document::scheduleLayoutTreeUpdate() |
1561 { | 1561 { |
1562 ASSERT(!hasPendingStyleRecalc()); | 1562 ASSERT(!hasPendingVisualUpdate()); |
1563 ASSERT(shouldScheduleLayoutTreeUpdate()); | 1563 ASSERT(shouldScheduleLayoutTreeUpdate()); |
1564 ASSERT(needsLayoutTreeUpdate()); | 1564 ASSERT(needsLayoutTreeUpdate()); |
1565 | 1565 |
1566 if (!view()->canThrottleRendering()) | 1566 if (!view()->canThrottleRendering()) |
1567 page()->animator().scheduleVisualUpdate(frame()); | 1567 page()->animator().scheduleVisualUpdate(frame()); |
1568 m_lifecycle.ensureStateAtMost(DocumentLifecycle::VisualUpdatePending); | 1568 m_lifecycle.ensureStateAtMost(DocumentLifecycle::VisualUpdatePending); |
1569 | 1569 |
1570 TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "Schedu
leStyleRecalculation", TRACE_EVENT_SCOPE_THREAD, "data", InspectorRecalculateSty
lesEvent::data(frame())); | 1570 TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "Schedu
leStyleRecalculation", TRACE_EVENT_SCOPE_THREAD, "data", InspectorRecalculateSty
lesEvent::data(frame())); |
1571 InspectorInstrumentation::didScheduleStyleRecalculation(this); | 1571 InspectorInstrumentation::didScheduleStyleRecalculation(this); |
1572 | 1572 |
1573 ++m_styleVersion; | 1573 ++m_styleVersion; |
1574 } | 1574 } |
1575 | 1575 |
1576 bool Document::hasPendingForcedStyleRecalc() const | 1576 bool Document::hasPendingForcedStyleRecalc() const |
1577 { | 1577 { |
1578 return hasPendingStyleRecalc() && !inStyleRecalc() && getStyleChangeType() >
= SubtreeStyleChange; | 1578 return hasPendingVisualUpdate() && !inStyleRecalc() && getStyleChangeType()
>= SubtreeStyleChange; |
1579 } | 1579 } |
1580 | 1580 |
1581 void Document::updateStyleInvalidationIfNeeded() | 1581 void Document::updateStyleInvalidationIfNeeded() |
1582 { | 1582 { |
1583 ScriptForbiddenScope forbidScript; | 1583 ScriptForbiddenScope forbidScript; |
1584 | 1584 |
1585 if (!isActive()) | 1585 if (!isActive()) |
1586 return; | 1586 return; |
1587 if (!childNeedsStyleInvalidation()) | 1587 if (!childNeedsStyleInvalidation()) |
1588 return; | 1588 return; |
(...skipping 4456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6045 #ifndef NDEBUG | 6045 #ifndef NDEBUG |
6046 using namespace blink; | 6046 using namespace blink; |
6047 void showLiveDocumentInstances() | 6047 void showLiveDocumentInstances() |
6048 { | 6048 { |
6049 Document::WeakDocumentSet& set = Document::liveDocumentSet(); | 6049 Document::WeakDocumentSet& set = Document::liveDocumentSet(); |
6050 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); | 6050 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); |
6051 for (Document* document : set) | 6051 for (Document* document : set) |
6052 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().get
String().utf8().data()); | 6052 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().get
String().utf8().data()); |
6053 } | 6053 } |
6054 #endif | 6054 #endif |
OLD | NEW |