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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 | 65 |
66 DocumentInit::DocumentInit(const KURL& url, LocalFrame* frame, WeakPtrWillBeRawP
tr<Document> contextDocument, HTMLImportsController* importsController) | 66 DocumentInit::DocumentInit(const KURL& url, LocalFrame* frame, WeakPtrWillBeRawP
tr<Document> contextDocument, HTMLImportsController* importsController) |
67 : m_url(url) | 67 : m_url(url) |
68 , m_frame(frame) | 68 , m_frame(frame) |
69 , m_parent(parentDocument(frame)) | 69 , m_parent(parentDocument(frame)) |
70 , m_owner(ownerDocument(frame)) | 70 , m_owner(ownerDocument(frame)) |
71 , m_contextDocument(contextDocument) | 71 , m_contextDocument(contextDocument) |
72 , m_importsController(importsController) | 72 , m_importsController(importsController) |
73 , m_createNewRegistrationContext(false) | 73 , m_createNewRegistrationContext(false) |
74 , m_shouldReuseDefaultView(frame && frame->shouldReuseDefaultView(url)) | 74 , m_shouldReuseDefaultView(frame && frame->shouldReuseDefaultView(url)) |
75 , m_shouldInheritSecurityOriginFromOwner(url.isEmpty() || url.protocolIsAbou
t()) | |
76 { | 75 { |
77 } | 76 } |
78 | 77 |
79 DocumentInit::DocumentInit(const DocumentInit& other) | 78 DocumentInit::DocumentInit(const DocumentInit& other) |
80 : m_url(other.m_url) | 79 : m_url(other.m_url) |
81 , m_frame(other.m_frame) | 80 , m_frame(other.m_frame) |
82 , m_parent(other.m_parent) | 81 , m_parent(other.m_parent) |
83 , m_owner(other.m_owner) | 82 , m_owner(other.m_owner) |
84 , m_contextDocument(other.m_contextDocument) | 83 , m_contextDocument(other.m_contextDocument) |
85 , m_importsController(other.m_importsController) | 84 , m_importsController(other.m_importsController) |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 return *this; | 165 return *this; |
167 } | 166 } |
168 | 167 |
169 DocumentInit& DocumentInit::withNewRegistrationContext() | 168 DocumentInit& DocumentInit::withNewRegistrationContext() |
170 { | 169 { |
171 ASSERT(!m_createNewRegistrationContext && !m_registrationContext); | 170 ASSERT(!m_createNewRegistrationContext && !m_registrationContext); |
172 m_createNewRegistrationContext = true; | 171 m_createNewRegistrationContext = true; |
173 return *this; | 172 return *this; |
174 } | 173 } |
175 | 174 |
176 DocumentInit& DocumentInit::withoutInheritingSecurityOrigin() | |
177 { | |
178 m_shouldInheritSecurityOriginFromOwner = false; | |
179 return *this; | |
180 } | |
181 | |
182 PassRefPtrWillBeRawPtr<CustomElementRegistrationContext> DocumentInit::registrat
ionContext(Document* document) const | 175 PassRefPtrWillBeRawPtr<CustomElementRegistrationContext> DocumentInit::registrat
ionContext(Document* document) const |
183 { | 176 { |
184 if (!document->isHTMLDocument() && !document->isXHTMLDocument()) | 177 if (!document->isHTMLDocument() && !document->isXHTMLDocument()) |
185 return nullptr; | 178 return nullptr; |
186 | 179 |
187 if (m_createNewRegistrationContext) | 180 if (m_createNewRegistrationContext) |
188 return CustomElementRegistrationContext::create(); | 181 return CustomElementRegistrationContext::create(); |
189 | 182 |
190 return m_registrationContext.get(); | 183 return m_registrationContext.get(); |
191 } | 184 } |
192 | 185 |
193 WeakPtrWillBeRawPtr<Document> DocumentInit::contextDocument() const | 186 WeakPtrWillBeRawPtr<Document> DocumentInit::contextDocument() const |
194 { | 187 { |
195 return m_contextDocument; | 188 return m_contextDocument; |
196 } | 189 } |
197 | 190 |
198 DocumentInit DocumentInit::fromContext(WeakPtrWillBeRawPtr<Document> contextDocu
ment, const KURL& url) | 191 DocumentInit DocumentInit::fromContext(WeakPtrWillBeRawPtr<Document> contextDocu
ment, const KURL& url) |
199 { | 192 { |
200 return DocumentInit(url, 0, contextDocument, 0); | 193 return DocumentInit(url, 0, contextDocument, 0); |
201 } | 194 } |
202 | 195 |
203 } // namespace blink | 196 } // namespace blink |
204 | 197 |
OLD | NEW |