| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "core/dom/custom/CustomElementRegistry.h" | 5 #include "core/dom/custom/CustomElementRegistry.h" |
| 6 | 6 |
| 7 #include "bindings/core/v8/ExceptionState.h" | 7 #include "bindings/core/v8/ExceptionState.h" |
| 8 #include "core/dom/Document.h" | 8 #include "core/dom/Document.h" |
| 9 #include "core/dom/Element.h" | 9 #include "core/dom/Element.h" |
| 10 #include "core/dom/ElementDefinitionOptions.h" | 10 #include "core/dom/ElementDefinitionOptions.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 protected: | 28 protected: |
| 29 void SetUp() { | 29 void SetUp() { |
| 30 m_page.reset(DummyPageHolder::create(IntSize(1, 1)).release()); | 30 m_page.reset(DummyPageHolder::create(IntSize(1, 1)).release()); |
| 31 } | 31 } |
| 32 | 32 |
| 33 void TearDown() { m_page = nullptr; } | 33 void TearDown() { m_page = nullptr; } |
| 34 | 34 |
| 35 Document& document() { return m_page->document(); } | 35 Document& document() { return m_page->document(); } |
| 36 | 36 |
| 37 CustomElementRegistry& registry() { | 37 CustomElementRegistry& registry() { |
| 38 return *m_page->frame().localDOMWindow()->customElements(); | 38 return *m_page->frame().domWindow()->customElements(); |
| 39 } | 39 } |
| 40 | 40 |
| 41 ScriptState* scriptState() { | 41 ScriptState* scriptState() { |
| 42 return ScriptState::forMainWorld(&m_page->frame()); | 42 return ScriptState::forMainWorld(&m_page->frame()); |
| 43 } | 43 } |
| 44 | 44 |
| 45 void collectCandidates(const CustomElementDescriptor& desc, | 45 void collectCandidates(const CustomElementDescriptor& desc, |
| 46 HeapVector<Member<Element>>* elements) { | 46 HeapVector<Member<Element>>* elements) { |
| 47 registry().collectCandidates(desc, elements); | 47 registry().collectCandidates(desc, elements); |
| 48 } | 48 } |
| (...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 438 EXPECT_EQ(definitionB, definition); | 438 EXPECT_EQ(definitionB, definition); |
| 439 // look up undefined customized built-in element | 439 // look up undefined customized built-in element |
| 440 definition = registry().definitionFor(CustomElementDescriptor("a-a", "div")); | 440 definition = registry().definitionFor(CustomElementDescriptor("a-a", "div")); |
| 441 EXPECT_EQ(nullptr, definition) << "a-a, div should not be registered"; | 441 EXPECT_EQ(nullptr, definition) << "a-a, div should not be registered"; |
| 442 } | 442 } |
| 443 | 443 |
| 444 // TODO(dominicc): Add tests which adjust the "is" attribute when type | 444 // TODO(dominicc): Add tests which adjust the "is" attribute when type |
| 445 // extensions are implemented. | 445 // extensions are implemented. |
| 446 | 446 |
| 447 } // namespace blink | 447 } // namespace blink |
| OLD | NEW |