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

Unified Diff: third_party/WebKit/Source/core/dom/custom/CustomElementsRegistry.cpp

Issue 2242743002: Make custom elements work in HTML imports (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: resolve most comments Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/dom/custom/CustomElementsRegistry.cpp
diff --git a/third_party/WebKit/Source/core/dom/custom/CustomElementsRegistry.cpp b/third_party/WebKit/Source/core/dom/custom/CustomElementsRegistry.cpp
index 6ecc7a8ea89b49ab40328c7981fe22f933eed729..39ce3d93b0d1cc52a63be7d2e63bafd96d1ffd05 100644
--- a/third_party/WebKit/Source/core/dom/custom/CustomElementsRegistry.cpp
+++ b/third_party/WebKit/Source/core/dom/custom/CustomElementsRegistry.cpp
@@ -79,6 +79,7 @@ CustomElementsRegistry::CustomElementsRegistry(const LocalDOMWindow* owner)
, m_v0 (new V0RegistrySet())
, m_upgradeCandidates(new UpgradeCandidateMap())
{
+ DCHECK(m_owner->document() == m_owner->document()->contextDocument());
kochi 2016/08/22 12:02:00 Hmm, this is a leftover from Koji's original patch
}
DEFINE_TRACE(CustomElementsRegistry)
@@ -234,6 +235,8 @@ CustomElementDefinition* CustomElementsRegistry::definitionForName(
void CustomElementsRegistry::addCandidate(Element* candidate)
{
+ DCHECK(candidate->document().contextDocument() == m_owner->document());
dominicc (has gone to gerrit) 2016/08/22 08:07:36 This should actually be harmless, but I guess I do
kochi 2016/08/22 12:02:00 After https://codereview.chromium.org/2252003002/
+
const AtomicString& name = candidate->localName();
if (nameIsDefined(name) || v0NameIsDefined(name))
return;
@@ -276,6 +279,7 @@ void CustomElementsRegistry::collectCandidates(
UpgradeCandidateMap::iterator it = m_upgradeCandidates->find(desc.name());
if (it == m_upgradeCandidates->end())
return;
+
CustomElementUpgradeSorter sorter;
for (Element* element : *it.get()->value) {
if (!element || !desc.matches(*element))

Powered by Google App Engine
This is Rietveld 408576698