| 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 1048 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1059 | 1059 |
| 1060 void Document::scheduleRenderTreeUpdate() | 1060 void Document::scheduleRenderTreeUpdate() |
| 1061 { | 1061 { |
| 1062 ASSERT(!hasPendingStyleRecalc()); | 1062 ASSERT(!hasPendingStyleRecalc()); |
| 1063 ASSERT(shouldScheduleRenderTreeUpdate()); | 1063 ASSERT(shouldScheduleRenderTreeUpdate()); |
| 1064 ASSERT(needsRenderTreeUpdate()); | 1064 ASSERT(needsRenderTreeUpdate()); |
| 1065 | 1065 |
| 1066 page()->animator().scheduleVisualUpdate(); | 1066 page()->animator().scheduleVisualUpdate(); |
| 1067 m_lifecycle.ensureStateAtMost(DocumentLifecycle::VisualUpdatePending); | 1067 m_lifecycle.ensureStateAtMost(DocumentLifecycle::VisualUpdatePending); |
| 1068 | 1068 |
| 1069 TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "Schedu
leStyleRecalculation", "frame", frame()); | 1069 TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "Schedu
leStyleRecalculation", TRACE_EVENT_SCOPE_PROCESS, "frame", frame()); |
| 1070 TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline.stack"), "
CallStack", "stack", InspectorCallStackEvent::currentCallStack()); | 1070 TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline.stack"), "
CallStack", TRACE_EVENT_SCOPE_PROCESS, "stack", InspectorCallStackEvent::current
CallStack()); |
| 1071 } | 1071 } |
| 1072 | 1072 |
| 1073 bool Document::hasPendingForcedStyleRecalc() const | 1073 bool Document::hasPendingForcedStyleRecalc() const |
| 1074 { | 1074 { |
| 1075 return hasPendingStyleRecalc() && !inStyleRecalc() && styleChangeType() >= S
ubtreeStyleChange; | 1075 return hasPendingStyleRecalc() && !inStyleRecalc() && styleChangeType() >= S
ubtreeStyleChange; |
| 1076 } | 1076 } |
| 1077 | 1077 |
| 1078 void Document::updateDistributionIfNeeded() | 1078 void Document::updateDistributionIfNeeded() |
| 1079 { | 1079 { |
| 1080 ScriptForbiddenScope forbidScript; | 1080 ScriptForbiddenScope forbidScript; |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1149 // FIXME: Can this still happen? How does script run inside | 1149 // FIXME: Can this still happen? How does script run inside |
| 1150 // UpdateSuspendScope::performDeferredWidgetTreeOperations() ? | 1150 // UpdateSuspendScope::performDeferredWidgetTreeOperations() ? |
| 1151 RefPtr<LocalFrame> protect(m_frame); | 1151 RefPtr<LocalFrame> protect(m_frame); |
| 1152 | 1152 |
| 1153 TRACE_EVENT_BEGIN0("blink", "Document::updateRenderTree"); | 1153 TRACE_EVENT_BEGIN0("blink", "Document::updateRenderTree"); |
| 1154 TRACE_EVENT_SCOPED_SAMPLING_STATE("blink", "UpdateRenderTree"); | 1154 TRACE_EVENT_SCOPED_SAMPLING_STATE("blink", "UpdateRenderTree"); |
| 1155 | 1155 |
| 1156 // FIXME: Remove m_styleRecalcElementCounter, we should just use the accessC
ount() on the resolver. | 1156 // FIXME: Remove m_styleRecalcElementCounter, we should just use the accessC
ount() on the resolver. |
| 1157 m_styleRecalcElementCounter = 0; | 1157 m_styleRecalcElementCounter = 0; |
| 1158 TRACE_EVENT_BEGIN1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "Recalcul
ateStyles", "frame", frame()); | 1158 TRACE_EVENT_BEGIN1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "Recalcul
ateStyles", "frame", frame()); |
| 1159 TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline.stack"), "
CallStack", "stack", InspectorCallStackEvent::currentCallStack()); | 1159 TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline.stack"), "
CallStack", TRACE_EVENT_SCOPE_PROCESS, "stack", InspectorCallStackEvent::current
CallStack()); |
| 1160 | 1160 |
| 1161 DocumentAnimations::updateOutdatedAnimationPlayersIfNeeded(*this); | 1161 DocumentAnimations::updateOutdatedAnimationPlayersIfNeeded(*this); |
| 1162 evaluateMediaQueryListIfNeeded(); | 1162 evaluateMediaQueryListIfNeeded(); |
| 1163 updateDistributionIfNeeded(); | 1163 updateDistributionIfNeeded(); |
| 1164 updateStyleInvalidationIfNeeded(); | 1164 updateStyleInvalidationIfNeeded(); |
| 1165 | 1165 |
| 1166 // FIXME: We should update style on our ancestor chain before proceeding | 1166 // FIXME: We should update style on our ancestor chain before proceeding |
| 1167 // however doing so currently causes several tests to crash, as LocalFrame::
setDocument calls Document::attach | 1167 // however doing so currently causes several tests to crash, as LocalFrame::
setDocument calls Document::attach |
| 1168 // before setting the LocalDOMWindow on the LocalFrame, or the SecurityOrigi
n on the document. The attach, in turn | 1168 // before setting the LocalDOMWindow on the LocalFrame, or the SecurityOrigi
n on the document. The attach, in turn |
| 1169 // resolves style (here) and then when we resolve style on the parent chain,
we may end up | 1169 // resolves style (here) and then when we resolve style on the parent chain,
we may end up |
| (...skipping 1414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2584 setParsing(false); | 2584 setParsing(false); |
| 2585 dispatchEvent(Event::createBubble(EventTypeNames::DOMContentLoaded)); | 2585 dispatchEvent(Event::createBubble(EventTypeNames::DOMContentLoaded)); |
| 2586 | 2586 |
| 2587 // The loader's finishedParsing() method may invoke script that causes this
object to | 2587 // The loader's finishedParsing() method may invoke script that causes this
object to |
| 2588 // be dereferenced (when this document is in an iframe and the onload causes
the iframe's src to change). | 2588 // be dereferenced (when this document is in an iframe and the onload causes
the iframe's src to change). |
| 2589 // Keep it alive until we are done. | 2589 // Keep it alive until we are done. |
| 2590 RefPtr<Document> protect(this); | 2590 RefPtr<Document> protect(this); |
| 2591 | 2591 |
| 2592 if (RefPtr<LocalFrame> f = frame()) { | 2592 if (RefPtr<LocalFrame> f = frame()) { |
| 2593 checkCompleted(); | 2593 checkCompleted(); |
| 2594 TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "Ma
rkDOMContent", "data", InspectorMarkLoadEvent::data(f.get())); | 2594 TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "Ma
rkDOMContent", TRACE_EVENT_SCOPE_PROCESS, "data", InspectorMarkLoadEvent::data(f
.get())); |
| 2595 } | 2595 } |
| 2596 | 2596 |
| 2597 // Schedule dropping of the ElementDataCache. We keep it alive for a while a
fter parsing finishes | 2597 // Schedule dropping of the ElementDataCache. We keep it alive for a while a
fter parsing finishes |
| 2598 // so that dynamically inserted content can also benefit from sharing optimi
zations. | 2598 // so that dynamically inserted content can also benefit from sharing optimi
zations. |
| 2599 // Note that we don't refresh the timer on cache access since that could lea
d to huge caches being kept | 2599 // Note that we don't refresh the timer on cache access since that could lea
d to huge caches being kept |
| 2600 // alive indefinitely by something innocuous like JS setting .innerHTML repe
atedly on a timer. | 2600 // alive indefinitely by something innocuous like JS setting .innerHTML repe
atedly on a timer. |
| 2601 m_elementDataCacheClearTimer.startOneShot(10, FROM_HERE); | 2601 m_elementDataCacheClearTimer.startOneShot(10, FROM_HERE); |
| 2602 | 2602 |
| 2603 // Parser should have picked up all preloads by now | 2603 // Parser should have picked up all preloads by now |
| 2604 m_fetcher->clearPreloads(); | 2604 m_fetcher->clearPreloads(); |
| (...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3129 using namespace blink; | 3129 using namespace blink; |
| 3130 void showLiveDocumentInstances() | 3130 void showLiveDocumentInstances() |
| 3131 { | 3131 { |
| 3132 WeakDocumentSet& set = liveDocumentSet(); | 3132 WeakDocumentSet& set = liveDocumentSet(); |
| 3133 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); | 3133 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); |
| 3134 for (WeakDocumentSet::const_iterator it = set.begin(); it != set.end(); ++it
) { | 3134 for (WeakDocumentSet::const_iterator it = set.begin(); it != set.end(); ++it
) { |
| 3135 fprintf(stderr, "- Document %p URL: %s\n", *it, (*it)->url().string().ut
f8().data()); | 3135 fprintf(stderr, "- Document %p URL: %s\n", *it, (*it)->url().string().ut
f8().data()); |
| 3136 } | 3136 } |
| 3137 } | 3137 } |
| 3138 #endif | 3138 #endif |
| OLD | NEW |