Chromium Code Reviews| 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)) |