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

Side by Side Diff: third_party/WebKit/Source/core/dom/custom/CustomElementsRegistryTest.cpp

Issue 2054433002: Implement "create an element" when sync for Custom Element V1 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@async-ce
Patch Set: dominicc review Created 4 years, 6 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
OLDNEW
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 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 240
241 bool runConstructor(Element* element) override 241 bool runConstructor(Element* element) override
242 { 242 {
243 if (constructionStack().isEmpty() 243 if (constructionStack().isEmpty()
244 || constructionStack().last() != element) 244 || constructionStack().last() != element)
245 return false; 245 return false;
246 constructionStack().last().clear(); 246 constructionStack().last().clear();
247 element->setCustomElementState(CustomElementState::Custom); 247 element->setCustomElementState(CustomElementState::Custom);
248 return true; 248 return true;
249 } 249 }
250
251 HTMLElement* createElementSync(Document&, const QualifiedName&) override
252 {
253 return nullptr;
254 }
255
256 HTMLElement* createElementSync(Document&, const QualifiedName&, ExceptionSta te&) override
257 {
258 return nullptr;
259 }
250 }; 260 };
251 261
252 // Classes which use trace macros cannot be local because of the 262 // Classes which use trace macros cannot be local because of the
253 // traceImpl template. 263 // traceImpl template.
254 class LogUpgradeDefinition : public TestCustomElementDefinition { 264 class LogUpgradeDefinition : public TestCustomElementDefinition {
255 WTF_MAKE_NONCOPYABLE(LogUpgradeDefinition); 265 WTF_MAKE_NONCOPYABLE(LogUpgradeDefinition);
256 public: 266 public:
257 LogUpgradeDefinition(const CustomElementDescriptor& descriptor) 267 LogUpgradeDefinition(const CustomElementDescriptor& descriptor)
258 : TestCustomElementDefinition(descriptor) 268 : TestCustomElementDefinition(descriptor)
259 { 269 {
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 EXPECT_EQ(1u, definition->m_invocationCount) 326 EXPECT_EQ(1u, definition->m_invocationCount)
317 << "defining the element should have 'upgraded' the existing element"; 327 << "defining the element should have 'upgraded' the existing element";
318 EXPECT_EQ(element, definition->m_element) 328 EXPECT_EQ(element, definition->m_element)
319 << "the existing a-a element should have been upgraded"; 329 << "the existing a-a element should have been upgraded";
320 } 330 }
321 331
322 // TODO(dominicc): Add tests which adjust the "is" attribute when type 332 // TODO(dominicc): Add tests which adjust the "is" attribute when type
323 // extensions are implemented. 333 // extensions are implemented.
324 334
325 } // namespace blink 335 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698