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

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

Issue 23009004: Process Custom Elements in post-order. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Patch for landing. Created 7 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 | Annotate | Revision Log
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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 45
46 CustomElementCallbackQueue* queue = CustomElementCallbackDispatcher::instanc e().ensureInCurrentElementQueue(element); 46 CustomElementCallbackQueue* queue = CustomElementCallbackDispatcher::instanc e().ensureInCurrentElementQueue(element);
47 queue->append(CustomElementCallbackInvocation::createAttributeChangedInvocat ion(callbacks, name, oldValue, newValue)); 47 queue->append(CustomElementCallbackInvocation::createAttributeChangedInvocat ion(callbacks, name, oldValue, newValue));
48 } 48 }
49 49
50 void CustomElementCallbackScheduler::scheduleCreatedCallback(PassRefPtr<CustomEl ementLifecycleCallbacks> callbacks, PassRefPtr<Element> element) 50 void CustomElementCallbackScheduler::scheduleCreatedCallback(PassRefPtr<CustomEl ementLifecycleCallbacks> callbacks, PassRefPtr<Element> element)
51 { 51 {
52 if (!callbacks->hasCreatedCallback()) 52 if (!callbacks->hasCreatedCallback())
53 return; 53 return;
54 54
55 CustomElementCallbackQueue* queue = CustomElementCallbackDispatcher::instanc e().createAtFrontOfCurrentElementQueue(element); 55 CustomElementCallbackQueue* queue = CustomElementCallbackDispatcher::instanc e().ensureInCurrentElementQueue(element);
56 queue->append(CustomElementCallbackInvocation::createInvocation(callbacks, C ustomElementLifecycleCallbacks::Created)); 56 queue->append(CustomElementCallbackInvocation::createInvocation(callbacks, C ustomElementLifecycleCallbacks::Created));
57 } 57 }
58 58
59 void CustomElementCallbackScheduler::scheduleEnteredDocumentCallback(PassRefPtr< CustomElementLifecycleCallbacks> callbacks, PassRefPtr<Element> element) 59 void CustomElementCallbackScheduler::scheduleEnteredDocumentCallback(PassRefPtr< CustomElementLifecycleCallbacks> callbacks, PassRefPtr<Element> element)
60 { 60 {
61 if (!callbacks->hasEnteredDocumentCallback()) 61 if (!callbacks->hasEnteredDocumentCallback())
62 return; 62 return;
63 63
64 CustomElementCallbackQueue* queue = CustomElementCallbackDispatcher::instanc e().ensureInCurrentElementQueue(element); 64 CustomElementCallbackQueue* queue = CustomElementCallbackDispatcher::instanc e().ensureInCurrentElementQueue(element);
65 queue->append(CustomElementCallbackInvocation::createInvocation(callbacks, C ustomElementLifecycleCallbacks::EnteredDocument)); 65 queue->append(CustomElementCallbackInvocation::createInvocation(callbacks, C ustomElementLifecycleCallbacks::EnteredDocument));
66 } 66 }
67 67
68 void CustomElementCallbackScheduler::scheduleLeftDocumentCallback(PassRefPtr<Cus tomElementLifecycleCallbacks> callbacks, PassRefPtr<Element> element) 68 void CustomElementCallbackScheduler::scheduleLeftDocumentCallback(PassRefPtr<Cus tomElementLifecycleCallbacks> callbacks, PassRefPtr<Element> element)
69 { 69 {
70 if (!callbacks->hasLeftDocumentCallback()) 70 if (!callbacks->hasLeftDocumentCallback())
71 return; 71 return;
72 72
73 CustomElementCallbackQueue* queue = CustomElementCallbackDispatcher::instanc e().ensureInCurrentElementQueue(element); 73 CustomElementCallbackQueue* queue = CustomElementCallbackDispatcher::instanc e().ensureInCurrentElementQueue(element);
74 queue->append(CustomElementCallbackInvocation::createInvocation(callbacks, C ustomElementLifecycleCallbacks::LeftDocument)); 74 queue->append(CustomElementCallbackInvocation::createInvocation(callbacks, C ustomElementLifecycleCallbacks::LeftDocument));
75 } 75 }
76 76
77 } // namespace WebCore 77 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/dom/CustomElementCallbackDispatcher.cpp ('k') | Source/core/dom/CustomElementObserver.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698