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

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

Issue 2032373002: Revert of 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: 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
« no previous file with comments | « third_party/WebKit/Source/core/dom/custom/CustomElementDefinition.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
247 return true; 246 return true;
248 } 247 }
249 }; 248 };
250 249
251 // Classes which use trace macros cannot be local because of the 250 // Classes which use trace macros cannot be local because of the
252 // traceImpl template. 251 // traceImpl template.
253 class LogUpgradeDefinition : public TestCustomElementDefinition { 252 class LogUpgradeDefinition : public TestCustomElementDefinition {
254 WTF_MAKE_NONCOPYABLE(LogUpgradeDefinition); 253 WTF_MAKE_NONCOPYABLE(LogUpgradeDefinition);
255 public: 254 public:
256 LogUpgradeDefinition(const CustomElementDescriptor& descriptor) 255 LogUpgradeDefinition(const CustomElementDescriptor& descriptor)
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 EXPECT_EQ(1u, definition->m_invocationCount) 310 EXPECT_EQ(1u, definition->m_invocationCount)
312 << "defining the element should have 'upgraded' the existing element"; 311 << "defining the element should have 'upgraded' the existing element";
313 EXPECT_EQ(element, definition->m_element) 312 EXPECT_EQ(element, definition->m_element)
314 << "the existing a-a element should have been upgraded"; 313 << "the existing a-a element should have been upgraded";
315 } 314 }
316 315
317 // TODO(dominicc): Add tests which adjust the "is" attribute when type 316 // TODO(dominicc): Add tests which adjust the "is" attribute when type
318 // extensions are implemented. 317 // extensions are implemented.
319 318
320 } // namespace blink 319 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/custom/CustomElementDefinition.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698