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

Side by Side Diff: Source/core/dom/CustomElementRegistry.cpp

Issue 14660019: Run Mutation Observer and Custom Element callbacks consistently at microtask checkpoint (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 7 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 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 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 { 318 {
319 while (!activeCustomElementRegistries().isEmpty()) { 319 while (!activeCustomElementRegistries().isEmpty()) {
320 Vector<RefPtr<CustomElementRegistry> > registries; 320 Vector<RefPtr<CustomElementRegistry> > registries;
321 copyToVector(activeCustomElementRegistries(), registries); 321 copyToVector(activeCustomElementRegistries(), registries);
322 activeCustomElementRegistries().clear(); 322 activeCustomElementRegistries().clear();
323 for (size_t i = 0; i < registries.size(); ++i) 323 for (size_t i = 0; i < registries.size(); ++i)
324 registries[i]->deliverLifecycleCallbacks(); 324 registries[i]->deliverLifecycleCallbacks();
325 } 325 }
326 } 326 }
327 327
328 bool CustomElementRegistry::hasQueuedLifecycleCallbacks()
329 {
330 return !activeCustomElementRegistries().isEmpty();
328 } 331 }
332
333 void CustomElementRegistry::abandonAllQueuedLifecycleCallbacks()
334 {
335 for (InstanceSet::iterator it = activeCustomElementRegistries().begin(); it != activeCustomElementRegistries().end(); ++it)
336 (*it)->abandonQueuedLifecycleCallbacks();
337 activeCustomElementRegistries().clear();
338 }
339
340 void CustomElementRegistry::abandonQueuedLifecycleCallbacks()
341 {
342 m_invocations.clear();
343 }
344
345 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698