Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1087)

Side by Side Diff: Source/core/html/HTMLImportsController.cpp

Issue 19002005: Share Custom Element registration contexts between related documents. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Tweak the test to do lazy wrapping in both cases. Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/editing/markup.cpp ('k') | Source/core/inspector/DOMPatchSupport.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 13 matching lines...) Expand all
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 #include "config.h" 31 #include "config.h"
32 #include "core/html/HTMLImportsController.h" 32 #include "core/html/HTMLImportsController.h"
33 33
34 #include "core/dom/CustomElementRegistrationContextualizer.h"
34 #include "core/dom/Document.h" 35 #include "core/dom/Document.h"
35 #include "core/html/HTMLDocument.h" 36 #include "core/html/HTMLDocument.h"
36 #include "core/html/HTMLLinkElement.h" 37 #include "core/html/HTMLLinkElement.h"
37 #include "core/loader/CrossOriginAccessControl.h" 38 #include "core/loader/CrossOriginAccessControl.h"
38 #include "core/loader/DocumentWriter.h" 39 #include "core/loader/DocumentWriter.h"
39 #include "core/loader/cache/CachedResourceLoader.h" 40 #include "core/loader/cache/CachedResourceLoader.h"
40 #include "core/loader/cache/CachedScript.h" 41 #include "core/loader/cache/CachedScript.h"
41 #include "weborigin/SecurityOrigin.h" 42 #include "weborigin/SecurityOrigin.h"
42 43
43 namespace WebCore { 44 namespace WebCore {
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 } 175 }
175 176
176 HTMLImportLoader::State HTMLImportLoader::startParsing(const ResourceResponse& r esponse) 177 HTMLImportLoader::State HTMLImportLoader::startParsing(const ResourceResponse& r esponse)
177 { 178 {
178 // Current canAccess() implementation isn't sufficient for catching cross-do main redirects: http://crbug.com/256976 179 // Current canAccess() implementation isn't sufficient for catching cross-do main redirects: http://crbug.com/256976
179 if (!controller()->cachedResourceLoader()->canAccess(m_resource.get())) 180 if (!controller()->cachedResourceLoader()->canAccess(m_resource.get()))
180 return StateError; 181 return StateError;
181 182
182 m_importedDocument = HTMLDocument::create(0, response.url()); 183 m_importedDocument = HTMLDocument::create(0, response.url());
183 m_importedDocument->setImport(this); 184 m_importedDocument->setImport(this);
185 CustomElementRegistrationContextualizer::didCreateRelatedDocument(controller ()->document()->registrationContext(), CustomElementRegistrationContextualizer:: HTMLImport, m_importedDocument.get());
184 m_writer = DocumentWriter::create(m_importedDocument.get(), response.mimeTyp e(), response.textEncodingName()); 186 m_writer = DocumentWriter::create(m_importedDocument.get(), response.mimeTyp e(), response.textEncodingName());
185 187
186 return StateLoading; 188 return StateLoading;
187 } 189 }
188 190
189 HTMLImportLoader::State HTMLImportLoader::finish() 191 HTMLImportLoader::State HTMLImportLoader::finish()
190 { 192 {
191 if (!m_parent) 193 if (!m_parent)
192 return StateError; 194 return StateError;
193 // The writer instance indicates that a part of the document can be already loaded. 195 // The writer instance indicates that a part of the document can be already loaded.
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
323 { 325 {
324 return m_master; 326 return m_master;
325 } 327 }
326 328
327 void HTMLImportsController::wasDetachedFromDocument() 329 void HTMLImportsController::wasDetachedFromDocument()
328 { 330 {
329 clear(); 331 clear();
330 } 332 }
331 333
332 } // namespace WebCore 334 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/editing/markup.cpp ('k') | Source/core/inspector/DOMPatchSupport.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698