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

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

Issue 2170383002: CustomElements: adopt node (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: layout test went from bad to good, deleting failure expectation Created 4 years, 4 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 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 104
105 void V0CustomElement::define(Element* element, V0CustomElementDefinition* defini tion) 105 void V0CustomElement::define(Element* element, V0CustomElementDefinition* defini tion)
106 { 106 {
107 switch (element->getV0CustomElementState()) { 107 switch (element->getV0CustomElementState()) {
108 case Element::V0NotCustomElement: 108 case Element::V0NotCustomElement:
109 case Element::V0Upgraded: 109 case Element::V0Upgraded:
110 ASSERT_NOT_REACHED(); 110 ASSERT_NOT_REACHED();
111 break; 111 break;
112 112
113 case Element::V0WaitingForUpgrade: 113 case Element::V0WaitingForUpgrade:
114 element->setCustomElementDefinition(definition); 114 element->v0setCustomElementDefinition(definition);
dominicc (has gone to gerrit) 2016/08/03 07:56:56 Call this v0SetCustomElementDefinition; ie treat v
115 V0CustomElementScheduler::scheduleCallback(definition->callbacks(), elem ent, V0CustomElementLifecycleCallbacks::CreatedCallback); 115 V0CustomElementScheduler::scheduleCallback(definition->callbacks(), elem ent, V0CustomElementLifecycleCallbacks::CreatedCallback);
116 break; 116 break;
117 } 117 }
118 } 118 }
119 119
120 void V0CustomElement::attributeDidChange(Element* element, const AtomicString& n ame, const AtomicString& oldValue, const AtomicString& newValue) 120 void V0CustomElement::attributeDidChange(Element* element, const AtomicString& n ame, const AtomicString& oldValue, const AtomicString& newValue)
121 { 121 {
122 DCHECK_EQ(element->getV0CustomElementState(), Element::V0Upgraded); 122 DCHECK_EQ(element->getV0CustomElementState(), Element::V0Upgraded);
123 V0CustomElementScheduler::scheduleAttributeChangedCallback(element->customEl ementDefinition()->callbacks(), element, name, oldValue, newValue); 123 V0CustomElementScheduler::scheduleAttributeChangedCallback(element->v0custom ElementDefinition()->callbacks(), element, name, oldValue, newValue);
124 } 124 }
125 125
126 void V0CustomElement::didAttach(Element* element, const Document& document) 126 void V0CustomElement::didAttach(Element* element, const Document& document)
127 { 127 {
128 DCHECK_EQ(element->getV0CustomElementState(), Element::V0Upgraded); 128 DCHECK_EQ(element->getV0CustomElementState(), Element::V0Upgraded);
129 if (!document.domWindow()) 129 if (!document.domWindow())
130 return; 130 return;
131 V0CustomElementScheduler::scheduleCallback(element->customElementDefinition( )->callbacks(), element, V0CustomElementLifecycleCallbacks::AttachedCallback); 131 V0CustomElementScheduler::scheduleCallback(element->v0customElementDefinitio n()->callbacks(), element, V0CustomElementLifecycleCallbacks::AttachedCallback);
132 } 132 }
133 133
134 void V0CustomElement::didDetach(Element* element, const Document& document) 134 void V0CustomElement::didDetach(Element* element, const Document& document)
135 { 135 {
136 DCHECK_EQ(element->getV0CustomElementState(), Element::V0Upgraded); 136 DCHECK_EQ(element->getV0CustomElementState(), Element::V0Upgraded);
137 if (!document.domWindow()) 137 if (!document.domWindow())
138 return; 138 return;
139 V0CustomElementScheduler::scheduleCallback(element->customElementDefinition( )->callbacks(), element, V0CustomElementLifecycleCallbacks::DetachedCallback); 139 V0CustomElementScheduler::scheduleCallback(element->v0customElementDefinitio n()->callbacks(), element, V0CustomElementLifecycleCallbacks::DetachedCallback);
140 } 140 }
141 141
142 void V0CustomElement::wasDestroyed(Element* element) 142 void V0CustomElement::wasDestroyed(Element* element)
143 { 143 {
144 switch (element->getV0CustomElementState()) { 144 switch (element->getV0CustomElementState()) {
145 case Element::V0NotCustomElement: 145 case Element::V0NotCustomElement:
146 ASSERT_NOT_REACHED(); 146 ASSERT_NOT_REACHED();
147 break; 147 break;
148 148
149 case Element::V0WaitingForUpgrade: 149 case Element::V0WaitingForUpgrade:
150 case Element::V0Upgraded: 150 case Element::V0Upgraded:
151 V0CustomElementObserver::notifyElementWasDestroyed(element); 151 V0CustomElementObserver::notifyElementWasDestroyed(element);
152 break; 152 break;
153 } 153 }
154 } 154 }
155 155
156 } // namespace blink 156 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698