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

Side by Side Diff: Source/core/inspector/DOMPatchSupport.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/html/HTMLImportsController.cpp ('k') | Source/core/loader/DocumentLoader.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) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 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 18 matching lines...) Expand all
29 */ 29 */
30 30
31 #include "config.h" 31 #include "config.h"
32 32
33 33
34 #include "core/inspector/DOMPatchSupport.h" 34 #include "core/inspector/DOMPatchSupport.h"
35 35
36 #include "HTMLNames.h" 36 #include "HTMLNames.h"
37 #include "core/dom/Attribute.h" 37 #include "core/dom/Attribute.h"
38 #include "core/dom/ContextFeatures.h" 38 #include "core/dom/ContextFeatures.h"
39 #include "core/dom/CustomElementRegistrationContextualizer.h"
39 #include "core/dom/Document.h" 40 #include "core/dom/Document.h"
40 #include "core/dom/DocumentFragment.h" 41 #include "core/dom/DocumentFragment.h"
41 #include "core/dom/Node.h" 42 #include "core/dom/Node.h"
42 #include "core/html/HTMLDocument.h" 43 #include "core/html/HTMLDocument.h"
43 #include "core/html/parser/HTMLDocumentParser.h" 44 #include "core/html/parser/HTMLDocumentParser.h"
44 #include "core/inspector/DOMEditor.h" 45 #include "core/inspector/DOMEditor.h"
45 #include "core/inspector/InspectorHistory.h" 46 #include "core/inspector/InspectorHistory.h"
46 #include "core/xml/parser/XMLDocumentParser.h" 47 #include "core/xml/parser/XMLDocumentParser.h"
47 48
48 #include <wtf/Deque.h> 49 #include <wtf/Deque.h>
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 RefPtr<Document> newDocument; 91 RefPtr<Document> newDocument;
91 if (m_document->isHTMLDocument()) 92 if (m_document->isHTMLDocument())
92 newDocument = HTMLDocument::create(0, KURL()); 93 newDocument = HTMLDocument::create(0, KURL());
93 else if (m_document->isXHTMLDocument()) 94 else if (m_document->isXHTMLDocument())
94 newDocument = HTMLDocument::createXHTML(0, KURL()); 95 newDocument = HTMLDocument::createXHTML(0, KURL());
95 else if (m_document->isSVGDocument()) 96 else if (m_document->isSVGDocument())
96 newDocument = Document::create(0, KURL()); 97 newDocument = Document::create(0, KURL());
97 98
98 ASSERT(newDocument); 99 ASSERT(newDocument);
99 newDocument->setContextFeatures(m_document->contextFeatures()); 100 newDocument->setContextFeatures(m_document->contextFeatures());
101 CustomElementRegistrationContextualizer::didCreateRelatedDocument(m_document ->registrationContext(), CustomElementRegistrationContextualizer::InspectorDOMPa tch, newDocument.get());
100 RefPtr<DocumentParser> parser; 102 RefPtr<DocumentParser> parser;
101 if (m_document->isHTMLDocument()) 103 if (m_document->isHTMLDocument())
102 parser = HTMLDocumentParser::create(static_cast<HTMLDocument*>(newDocume nt.get()), false); 104 parser = HTMLDocumentParser::create(static_cast<HTMLDocument*>(newDocume nt.get()), false);
103 else 105 else
104 parser = XMLDocumentParser::create(newDocument.get(), 0); 106 parser = XMLDocumentParser::create(newDocument.get(), 0);
105 parser->insert(markup); // Use insert() so that the parser will not yield. 107 parser->insert(markup); // Use insert() so that the parser will not yield.
106 parser->finish(); 108 parser->finish();
107 parser->detach(); 109 parser->detach();
108 110
109 OwnPtr<Digest> oldInfo = createDigest(m_document->documentElement(), 0); 111 OwnPtr<Digest> oldInfo = createDigest(m_document->documentElement(), 0);
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
512 void DOMPatchSupport::dumpMap(const ResultMap& map, const String& name) 514 void DOMPatchSupport::dumpMap(const ResultMap& map, const String& name)
513 { 515 {
514 fprintf(stderr, "\n\n"); 516 fprintf(stderr, "\n\n");
515 for (size_t i = 0; i < map.size(); ++i) 517 for (size_t i = 0; i < map.size(); ++i)
516 fprintf(stderr, "%s[%lu]: %s (%p) - [%lu]\n", name.utf8().data(), i, map [i].first ? nodeName(map[i].first->m_node).utf8().data() : "", map[i].first, map [i].second); 518 fprintf(stderr, "%s[%lu]: %s (%p) - [%lu]\n", name.utf8().data(), i, map [i].first ? nodeName(map[i].first->m_node).utf8().data() : "", map[i].first, map [i].second);
517 } 519 }
518 #endif 520 #endif
519 521
520 } // namespace WebCore 522 } // namespace WebCore
521 523
OLDNEW
« no previous file with comments | « Source/core/html/HTMLImportsController.cpp ('k') | Source/core/loader/DocumentLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698