| OLD | NEW |
| 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 | 62 |
| 63 void CustomElementScheduler::scheduleAttributeChangedCallback(PassRefPtr<CustomE
lementLifecycleCallbacks> callbacks, PassRefPtr<Element> element, const AtomicSt
ring& name, const AtomicString& oldValue, const AtomicString& newValue) | 63 void CustomElementScheduler::scheduleAttributeChangedCallback(PassRefPtr<CustomE
lementLifecycleCallbacks> callbacks, PassRefPtr<Element> element, const AtomicSt
ring& name, const AtomicString& oldValue, const AtomicString& newValue) |
| 64 { | 64 { |
| 65 if (!callbacks->hasCallback(CustomElementLifecycleCallbacks::AttributeChange
dCallback)) | 65 if (!callbacks->hasCallback(CustomElementLifecycleCallbacks::AttributeChange
dCallback)) |
| 66 return; | 66 return; |
| 67 | 67 |
| 68 CustomElementCallbackQueue& queue = instance().schedule(element); | 68 CustomElementCallbackQueue& queue = instance().schedule(element); |
| 69 queue.append(CustomElementCallbackInvocation::createAttributeChangedInvocati
on(callbacks, name, oldValue, newValue)); | 69 queue.append(CustomElementCallbackInvocation::createAttributeChangedInvocati
on(callbacks, name, oldValue, newValue)); |
| 70 } | 70 } |
| 71 | 71 |
| 72 void CustomElementScheduler::resolveOrScheduleResolution(PassRefPtr<CustomElemen
tRegistrationContext> context, PassRefPtr<Element> element, const CustomElementD
escriptor& descriptor) | 72 void CustomElementScheduler::resolveOrScheduleResolution(PassRefPtr<CustomElemen
tRegistrationContext> context, PassRefPtr<Element> element) |
| 73 { | 73 { |
| 74 if (CustomElementProcessingStack::inCallbackDeliveryScope()) { | 74 if (CustomElementProcessingStack::inCallbackDeliveryScope()) { |
| 75 context->resolve(element.get(), descriptor); | 75 context->resolve(element.get()); |
| 76 return; | 76 return; |
| 77 } | 77 } |
| 78 | 78 |
| 79 Document& document = element->document(); | 79 Document& document = element->document(); |
| 80 OwnPtr<CustomElementMicrotaskResolutionStep> step = CustomElementMicrotaskRe
solutionStep::create(context, element, descriptor); | 80 OwnPtr<CustomElementMicrotaskResolutionStep> step = CustomElementMicrotaskRe
solutionStep::create(context, element); |
| 81 enqueueMicrotaskStep(document, step.release()); | 81 enqueueMicrotaskStep(document, step.release()); |
| 82 } | 82 } |
| 83 | 83 |
| 84 CustomElementMicrotaskImportStep* CustomElementScheduler::scheduleImport(HTMLImp
ortChild* import) | 84 CustomElementMicrotaskImportStep* CustomElementScheduler::scheduleImport(HTMLImp
ortChild* import) |
| 85 { | 85 { |
| 86 ASSERT(!import->isDone()); | 86 ASSERT(!import->isDone()); |
| 87 ASSERT(import->parent()); | 87 ASSERT(import->parent()); |
| 88 | 88 |
| 89 // Ownership of the new step is transferred to the parent | 89 // Ownership of the new step is transferred to the parent |
| 90 // processing step, or the base queue. | 90 // processing step, or the base queue. |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 // The processing stack is active. | 150 // The processing stack is active. |
| 151 CustomElementProcessingStack::instance().enqueue(&callbackQueue); | 151 CustomElementProcessingStack::instance().enqueue(&callbackQueue); |
| 152 return callbackQueue; | 152 return callbackQueue; |
| 153 } | 153 } |
| 154 | 154 |
| 155 CustomElementMicrotaskDispatcher::instance().enqueue(&callbackQueue); | 155 CustomElementMicrotaskDispatcher::instance().enqueue(&callbackQueue); |
| 156 return callbackQueue; | 156 return callbackQueue; |
| 157 } | 157 } |
| 158 | 158 |
| 159 } // namespace blink | 159 } // namespace blink |
| OLD | NEW |