| 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, 2010, 2012 Apple Inc. All r
ights reserved. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 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) 2010 Nokia Corporation and/or its subsidiary(-ies) | 8 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) |
| 9 * Copyright (C) 2013 Google Inc. All rights reserved. | 9 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 10 * | 10 * |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 * Boston, MA 02110-1301, USA. | 24 * Boston, MA 02110-1301, USA. |
| 25 * | 25 * |
| 26 */ | 26 */ |
| 27 | 27 |
| 28 #include "sky/engine/core/dom/DocumentInit.h" | 28 #include "sky/engine/core/dom/DocumentInit.h" |
| 29 | 29 |
| 30 #include "gen/sky/platform/RuntimeEnabledFeatures.h" | 30 #include "gen/sky/platform/RuntimeEnabledFeatures.h" |
| 31 #include "sky/engine/core/dom/Document.h" | 31 #include "sky/engine/core/dom/Document.h" |
| 32 #include "sky/engine/core/dom/custom/custom_element_registry.h" | 32 #include "sky/engine/core/dom/custom/custom_element_registry.h" |
| 33 #include "sky/engine/core/frame/LocalFrame.h" | 33 #include "sky/engine/core/frame/LocalFrame.h" |
| 34 #include "sky/engine/core/html/imports/HTMLImportsController.h" | |
| 35 | 34 |
| 36 namespace blink { | 35 namespace blink { |
| 37 | 36 |
| 38 DocumentInit::DocumentInit(const KURL& url, LocalFrame* frame, WeakPtr<Document>
contextDocument, HTMLImportsController* importsController) | 37 DocumentInit::DocumentInit(const KURL& url, LocalFrame* frame, WeakPtr<Document>
contextDocument) |
| 39 : m_url(url) | 38 : m_url(url) |
| 40 , m_frame(frame) | 39 , m_frame(frame) |
| 41 , m_contextDocument(contextDocument) | 40 , m_contextDocument(contextDocument) |
| 42 , m_importsController(importsController) | |
| 43 { | 41 { |
| 44 } | 42 } |
| 45 | 43 |
| 46 DocumentInit::DocumentInit(const DocumentInit& other) | 44 DocumentInit::DocumentInit(const DocumentInit& other) |
| 47 : m_url(other.m_url) | 45 : m_url(other.m_url) |
| 48 , m_frame(other.m_frame) | 46 , m_frame(other.m_frame) |
| 49 , m_contextDocument(other.m_contextDocument) | 47 , m_contextDocument(other.m_contextDocument) |
| 50 , m_importsController(other.m_importsController) | |
| 51 , m_elementRegistry(other.m_elementRegistry) | 48 , m_elementRegistry(other.m_elementRegistry) |
| 52 { | 49 { |
| 53 } | 50 } |
| 54 | 51 |
| 55 DocumentInit::~DocumentInit() | 52 DocumentInit::~DocumentInit() |
| 56 { | 53 { |
| 57 } | 54 } |
| 58 | 55 |
| 59 bool DocumentInit::shouldSetURL() const | 56 bool DocumentInit::shouldSetURL() const |
| 60 { | 57 { |
| 61 return !m_url.isEmpty(); | 58 return !m_url.isEmpty(); |
| 62 } | 59 } |
| 63 | 60 |
| 64 LocalFrame* DocumentInit::frameForSecurityContext() const | 61 LocalFrame* DocumentInit::frameForSecurityContext() const |
| 65 { | 62 { |
| 66 if (m_frame) | 63 return m_frame; |
| 67 return m_frame; | |
| 68 if (m_importsController) | |
| 69 return m_importsController->master()->frame(); | |
| 70 return 0; | |
| 71 } | 64 } |
| 72 | 65 |
| 73 Settings* DocumentInit::settings() const | 66 Settings* DocumentInit::settings() const |
| 74 { | 67 { |
| 75 ASSERT(frameForSecurityContext()); | 68 ASSERT(frameForSecurityContext()); |
| 76 return frameForSecurityContext()->settings(); | 69 return frameForSecurityContext()->settings(); |
| 77 } | 70 } |
| 78 | 71 |
| 79 DocumentInit& DocumentInit::withElementRegistry(CustomElementRegistry& elementre
gistry) | 72 DocumentInit& DocumentInit::withElementRegistry(CustomElementRegistry& elementre
gistry) |
| 80 { | 73 { |
| 81 ASSERT(!m_elementRegistry); | 74 ASSERT(!m_elementRegistry); |
| 82 m_elementRegistry = &elementregistry; | 75 m_elementRegistry = &elementregistry; |
| 83 return *this; | 76 return *this; |
| 84 } | 77 } |
| 85 | 78 |
| 86 WeakPtr<Document> DocumentInit::contextDocument() const | 79 WeakPtr<Document> DocumentInit::contextDocument() const |
| 87 { | 80 { |
| 88 return m_contextDocument; | 81 return m_contextDocument; |
| 89 } | 82 } |
| 90 | 83 |
| 91 DocumentInit DocumentInit::fromContext(WeakPtr<Document> contextDocument, const
KURL& url) | 84 DocumentInit DocumentInit::fromContext(WeakPtr<Document> contextDocument, const
KURL& url) |
| 92 { | 85 { |
| 93 return DocumentInit(url, 0, contextDocument, 0); | 86 return DocumentInit(url, 0, contextDocument); |
| 94 } | 87 } |
| 95 | 88 |
| 96 } // namespace blink | 89 } // namespace blink |
| 97 | |
| OLD | NEW |