| 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 | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All |
| 7 * rights reserved. | 7 * rights reserved. |
| 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. | 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. |
| 9 * (http://www.torchmobile.com/) | 9 * (http://www.torchmobile.com/) |
| 10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. | 10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. |
| (...skipping 1164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1175 exceptionState.throwDOMException( | 1175 exceptionState.throwDOMException( |
| 1176 HierarchyRequestError, | 1176 HierarchyRequestError, |
| 1177 "The node provided is a frame which contains this document."); | 1177 "The node provided is a frame which contains this document."); |
| 1178 return nullptr; | 1178 return nullptr; |
| 1179 } | 1179 } |
| 1180 } | 1180 } |
| 1181 if (source->parentNode()) { | 1181 if (source->parentNode()) { |
| 1182 source->parentNode()->removeChild(source, exceptionState); | 1182 source->parentNode()->removeChild(source, exceptionState); |
| 1183 if (exceptionState.hadException()) | 1183 if (exceptionState.hadException()) |
| 1184 return nullptr; | 1184 return nullptr; |
| 1185 RELEASE_ASSERT(!source->parentNode()); | 1185 CHECK(!source->parentNode()); |
| 1186 } | 1186 } |
| 1187 } | 1187 } |
| 1188 | 1188 |
| 1189 this->adoptIfNeeded(*source); | 1189 this->adoptIfNeeded(*source); |
| 1190 | 1190 |
| 1191 return source; | 1191 return source; |
| 1192 } | 1192 } |
| 1193 | 1193 |
| 1194 bool Document::hasValidNamespaceForElements(const QualifiedName& qName) { | 1194 bool Document::hasValidNamespaceForElements(const QualifiedName& qName) { |
| 1195 // These checks are from DOM Core Level 2, createElementNS | 1195 // These checks are from DOM Core Level 2, createElementNS |
| (...skipping 788 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1984 return; | 1984 return; |
| 1985 } | 1985 } |
| 1986 | 1986 |
| 1987 if (inStyleRecalc()) | 1987 if (inStyleRecalc()) |
| 1988 return; | 1988 return; |
| 1989 | 1989 |
| 1990 // Entering here from inside layout, paint etc. would be catastrophic since | 1990 // Entering here from inside layout, paint etc. would be catastrophic since |
| 1991 // recalcStyle can tear down the layout tree or (unfortunately) run | 1991 // recalcStyle can tear down the layout tree or (unfortunately) run |
| 1992 // script. Kill the whole layoutObject if someone managed to get into here in | 1992 // script. Kill the whole layoutObject if someone managed to get into here in |
| 1993 // states not allowing tree mutations. | 1993 // states not allowing tree mutations. |
| 1994 RELEASE_ASSERT(lifecycle().stateAllowsTreeMutations()); | 1994 CHECK(lifecycle().stateAllowsTreeMutations()); |
| 1995 | 1995 |
| 1996 TRACE_EVENT_BEGIN1("blink,devtools.timeline", "UpdateLayoutTree", "beginData", | 1996 TRACE_EVENT_BEGIN1("blink,devtools.timeline", "UpdateLayoutTree", "beginData", |
| 1997 InspectorRecalculateStylesEvent::data(frame())); | 1997 InspectorRecalculateStylesEvent::data(frame())); |
| 1998 | 1998 |
| 1999 unsigned startElementCount = styleEngine().styleForElementCount(); | 1999 unsigned startElementCount = styleEngine().styleForElementCount(); |
| 2000 | 2000 |
| 2001 InspectorInstrumentation::RecalculateStyle recalculateStyleScope(this); | 2001 InspectorInstrumentation::RecalculateStyle recalculateStyleScope(this); |
| 2002 | 2002 |
| 2003 DocumentAnimations::updateAnimationTimingIfNeeded(*this); | 2003 DocumentAnimations::updateAnimationTimingIfNeeded(*this); |
| 2004 evaluateMediaQueryListIfNeeded(); | 2004 evaluateMediaQueryListIfNeeded(); |
| (...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2439 view()->didAttachDocument(); | 2439 view()->didAttachDocument(); |
| 2440 | 2440 |
| 2441 // Observer(s) should not be initialized until the document is initialized / | 2441 // Observer(s) should not be initialized until the document is initialized / |
| 2442 // attached to a frame. Otherwise ContextLifecycleObserver::contextDestroyed | 2442 // attached to a frame. Otherwise ContextLifecycleObserver::contextDestroyed |
| 2443 // wouldn't be fired. | 2443 // wouldn't be fired. |
| 2444 m_networkStateObserver = new NetworkStateObserver(*this); | 2444 m_networkStateObserver = new NetworkStateObserver(*this); |
| 2445 } | 2445 } |
| 2446 | 2446 |
| 2447 void Document::shutdown() { | 2447 void Document::shutdown() { |
| 2448 TRACE_EVENT0("blink", "Document::shutdown"); | 2448 TRACE_EVENT0("blink", "Document::shutdown"); |
| 2449 RELEASE_ASSERT(!m_frame || m_frame->tree().childCount() == 0); | 2449 CHECK(!m_frame || m_frame->tree().childCount() == 0); |
| 2450 if (!isActive()) | 2450 if (!isActive()) |
| 2451 return; | 2451 return; |
| 2452 | 2452 |
| 2453 // Frame navigation can cause a new Document to be attached. Don't allow that, | 2453 // Frame navigation can cause a new Document to be attached. Don't allow that, |
| 2454 // since that will cause a situation where LocalFrame still has a Document | 2454 // since that will cause a situation where LocalFrame still has a Document |
| 2455 // attached after this finishes! Normally, it shouldn't actually be possible | 2455 // attached after this finishes! Normally, it shouldn't actually be possible |
| 2456 // to trigger navigation here. However, plugins (see below) can cause lots of | 2456 // to trigger navigation here. However, plugins (see below) can cause lots of |
| 2457 // crazy things to happen, since plugin detach involves nested message loops. | 2457 // crazy things to happen, since plugin detach involves nested message loops. |
| 2458 FrameNavigationDisabler navigationDisabler(*m_frame); | 2458 FrameNavigationDisabler navigationDisabler(*m_frame); |
| 2459 // Defer FrameViewBase updates to avoid plugins trying to run script inside | 2459 // Defer FrameViewBase updates to avoid plugins trying to run script inside |
| (...skipping 4200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6660 } | 6660 } |
| 6661 | 6661 |
| 6662 void showLiveDocumentInstances() { | 6662 void showLiveDocumentInstances() { |
| 6663 WeakDocumentSet& set = liveDocumentSet(); | 6663 WeakDocumentSet& set = liveDocumentSet(); |
| 6664 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); | 6664 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); |
| 6665 for (blink::Document* document : set) | 6665 for (blink::Document* document : set) |
| 6666 fprintf(stderr, "- Document %p URL: %s\n", document, | 6666 fprintf(stderr, "- Document %p URL: %s\n", document, |
| 6667 document->url().getString().utf8().data()); | 6667 document->url().getString().utf8().data()); |
| 6668 } | 6668 } |
| 6669 #endif | 6669 #endif |
| OLD | NEW |