| 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/CustomElementsRegistry.h" | 5 #include "core/dom/custom/CustomElementsRegistry.h" | 
| 6 | 6 | 
| 7 #include "bindings/core/v8/ExceptionState.h" | 7 #include "bindings/core/v8/ExceptionState.h" | 
| 8 #include "bindings/core/v8/ScriptValue.h" | 8 #include "bindings/core/v8/ScriptValue.h" | 
| 9 #include "core/dom/Document.h" | 9 #include "core/dom/Document.h" | 
| 10 #include "core/dom/Element.h" | 10 #include "core/dom/Element.h" | 
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 279 | 279 | 
| 280 class LogUpgradeBuilder final : public CustomElementDefinitionBuilder { | 280 class LogUpgradeBuilder final : public CustomElementDefinitionBuilder { | 
| 281     STACK_ALLOCATED(); | 281     STACK_ALLOCATED(); | 
| 282     WTF_MAKE_NONCOPYABLE(LogUpgradeBuilder); | 282     WTF_MAKE_NONCOPYABLE(LogUpgradeBuilder); | 
| 283 public: | 283 public: | 
| 284     LogUpgradeBuilder() { } | 284     LogUpgradeBuilder() { } | 
| 285 | 285 | 
| 286     bool checkConstructorIntrinsics() override { return true; } | 286     bool checkConstructorIntrinsics() override { return true; } | 
| 287     bool checkConstructorNotRegistered() override { return true; } | 287     bool checkConstructorNotRegistered() override { return true; } | 
| 288     bool checkPrototype() override { return true; } | 288     bool checkPrototype() override { return true; } | 
|  | 289     bool rememberOriginalProperties() override { return true; } | 
| 289     CustomElementDefinition* build( | 290     CustomElementDefinition* build( | 
| 290         const CustomElementDescriptor& descriptor) { | 291         const CustomElementDescriptor& descriptor) { | 
| 291         return new LogUpgradeDefinition(descriptor); | 292         return new LogUpgradeDefinition(descriptor); | 
| 292     } | 293     } | 
| 293 }; | 294 }; | 
| 294 | 295 | 
| 295 TEST_F(CustomElementsRegistryFrameTest, define_upgradesInDocumentElements) | 296 TEST_F(CustomElementsRegistryFrameTest, define_upgradesInDocumentElements) | 
| 296 { | 297 { | 
| 297     ScriptForbiddenScope doNotRelyOnScript; | 298     ScriptForbiddenScope doNotRelyOnScript; | 
| 298 | 299 | 
| (...skipping 12 matching lines...) Expand all  Loading... | 
| 311     EXPECT_EQ(1u, definition->m_invocationCount) | 312     EXPECT_EQ(1u, definition->m_invocationCount) | 
| 312         << "defining the element should have 'upgraded' the existing element"; | 313         << "defining the element should have 'upgraded' the existing element"; | 
| 313     EXPECT_EQ(element, definition->m_element) | 314     EXPECT_EQ(element, definition->m_element) | 
| 314         << "the existing a-a element should have been upgraded"; | 315         << "the existing a-a element should have been upgraded"; | 
| 315 } | 316 } | 
| 316 | 317 | 
| 317 // TODO(dominicc): Add tests which adjust the "is" attribute when type | 318 // TODO(dominicc): Add tests which adjust the "is" attribute when type | 
| 318 // extensions are implemented. | 319 // extensions are implemented. | 
| 319 | 320 | 
| 320 } // namespace blink | 321 } // namespace blink | 
| OLD | NEW | 
|---|