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

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

Issue 2035623002: Implement the script parts of custom element upgrade steps. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ce-upgrade-in-document-dom-merge2
Patch Set: Do not assign in conditional to unbreak windows builder. 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 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 { 236 {
237 return ScriptValue(); 237 return ScriptValue();
238 } 238 }
239 239
240 bool runConstructor(Element* element) override 240 bool runConstructor(Element* element) override
241 { 241 {
242 if (constructionStack().isEmpty() 242 if (constructionStack().isEmpty()
243 || constructionStack().last() != element) 243 || constructionStack().last() != element)
244 return false; 244 return false;
245 constructionStack().last().clear(); 245 constructionStack().last().clear();
246 element->setCustomElementState(CustomElementState::Custom);
246 return true; 247 return true;
247 } 248 }
248 }; 249 };
249 250
250 // Classes which use trace macros cannot be local because of the 251 // Classes which use trace macros cannot be local because of the
251 // traceImpl template. 252 // traceImpl template.
252 class LogUpgradeDefinition : public TestCustomElementDefinition { 253 class LogUpgradeDefinition : public TestCustomElementDefinition {
253 WTF_MAKE_NONCOPYABLE(LogUpgradeDefinition); 254 WTF_MAKE_NONCOPYABLE(LogUpgradeDefinition);
254 public: 255 public:
255 LogUpgradeDefinition(const CustomElementDescriptor& descriptor) 256 LogUpgradeDefinition(const CustomElementDescriptor& descriptor)
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 EXPECT_EQ(1u, definition->m_invocationCount) 311 EXPECT_EQ(1u, definition->m_invocationCount)
311 << "defining the element should have 'upgraded' the existing element"; 312 << "defining the element should have 'upgraded' the existing element";
312 EXPECT_EQ(element, definition->m_element) 313 EXPECT_EQ(element, definition->m_element)
313 << "the existing a-a element should have been upgraded"; 314 << "the existing a-a element should have been upgraded";
314 } 315 }
315 316
316 // TODO(dominicc): Add tests which adjust the "is" attribute when type 317 // TODO(dominicc): Add tests which adjust the "is" attribute when type
317 // extensions are implemented. 318 // extensions are implemented.
318 319
319 } // namespace blink 320 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698