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 5193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5204 | 5204 |
5205 HTMLCollection* Document::windowNamedItems(const AtomicString& name) { | 5205 HTMLCollection* Document::windowNamedItems(const AtomicString& name) { |
5206 return ensureCachedCollection<WindowNameCollection>(WindowNamedItems, name); | 5206 return ensureCachedCollection<WindowNameCollection>(WindowNamedItems, name); |
5207 } | 5207 } |
5208 | 5208 |
5209 DocumentNameCollection* Document::documentNamedItems(const AtomicString& name) { | 5209 DocumentNameCollection* Document::documentNamedItems(const AtomicString& name) { |
5210 return ensureCachedCollection<DocumentNameCollection>(DocumentNamedItems, | 5210 return ensureCachedCollection<DocumentNameCollection>(DocumentNamedItems, |
5211 name); | 5211 name); |
5212 } | 5212 } |
5213 | 5213 |
5214 LocalDOMWindow* Document::defaultView() const { | |
5215 // The HTML spec requires to return null if the document is detached from a | |
5216 // frame. However, |m_domWindow| is not cleared on the detachment. So, we | |
5217 // need to check |m_frame| to tell whether the document is attached or not. | |
5218 return m_frame ? m_domWindow : nullptr; | |
5219 } | |
5220 | |
5221 void Document::finishedParsing() { | 5214 void Document::finishedParsing() { |
5222 DCHECK(!scriptableDocumentParser() || !m_parser->isParsing()); | 5215 DCHECK(!scriptableDocumentParser() || !m_parser->isParsing()); |
5223 DCHECK(!scriptableDocumentParser() || m_readyState != Loading); | 5216 DCHECK(!scriptableDocumentParser() || m_readyState != Loading); |
5224 setParsingState(InDOMContentLoaded); | 5217 setParsingState(InDOMContentLoaded); |
5225 DocumentParserTiming::from(*this).markParserStop(); | 5218 DocumentParserTiming::from(*this).markParserStop(); |
5226 | 5219 |
5227 // FIXME: DOMContentLoaded is dispatched synchronously, but this should be | 5220 // FIXME: DOMContentLoaded is dispatched synchronously, but this should be |
5228 // dispatched in a queued task, see https://crbug.com/425790 | 5221 // dispatched in a queued task, see https://crbug.com/425790 |
5229 if (!m_documentTiming.domContentLoadedEventStart()) | 5222 if (!m_documentTiming.domContentLoadedEventStart()) |
5230 m_documentTiming.markDomContentLoadedEventStart(); | 5223 m_documentTiming.markDomContentLoadedEventStart(); |
(...skipping 1356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6587 } | 6580 } |
6588 | 6581 |
6589 void showLiveDocumentInstances() { | 6582 void showLiveDocumentInstances() { |
6590 WeakDocumentSet& set = liveDocumentSet(); | 6583 WeakDocumentSet& set = liveDocumentSet(); |
6591 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); | 6584 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); |
6592 for (blink::Document* document : set) | 6585 for (blink::Document* document : set) |
6593 fprintf(stderr, "- Document %p URL: %s\n", document, | 6586 fprintf(stderr, "- Document %p URL: %s\n", document, |
6594 document->url().getString().utf8().data()); | 6587 document->url().getString().utf8().data()); |
6595 } | 6588 } |
6596 #endif | 6589 #endif |
OLD | NEW |