Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 4 * (C) 2001 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
| 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) | 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) |
| 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All |
| 7 * rights reserved. | 7 * rights reserved. |
| 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. | 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. |
| 9 * (http://www.torchmobile.com/) | 9 * (http://www.torchmobile.com/) |
| 10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. | 10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 41 #include "core/HTMLElementFactory.h" | 41 #include "core/HTMLElementFactory.h" |
| 42 #include "core/HTMLElementTypeHelpers.h" | 42 #include "core/HTMLElementTypeHelpers.h" |
| 43 #include "core/HTMLNames.h" | 43 #include "core/HTMLNames.h" |
| 44 #include "core/SVGElementFactory.h" | 44 #include "core/SVGElementFactory.h" |
| 45 #include "core/SVGNames.h" | 45 #include "core/SVGNames.h" |
| 46 #include "core/XMLNSNames.h" | 46 #include "core/XMLNSNames.h" |
| 47 #include "core/XMLNames.h" | 47 #include "core/XMLNames.h" |
| 48 #include "core/animation/CompositorPendingAnimations.h" | 48 #include "core/animation/CompositorPendingAnimations.h" |
| 49 #include "core/animation/DocumentAnimations.h" | 49 #include "core/animation/DocumentAnimations.h" |
| 50 #include "core/animation/DocumentTimeline.h" | 50 #include "core/animation/DocumentTimeline.h" |
| 51 #include "core/animation/WorkletAnimationBase.h" | |
| 52 #include "core/animation/WorkletAnimationController.h" | |
| 51 #include "core/css/CSSFontSelector.h" | 53 #include "core/css/CSSFontSelector.h" |
| 52 #include "core/css/CSSStyleDeclaration.h" | 54 #include "core/css/CSSStyleDeclaration.h" |
| 53 #include "core/css/CSSStyleSheet.h" | 55 #include "core/css/CSSStyleSheet.h" |
| 54 #include "core/css/CSSTiming.h" | 56 #include "core/css/CSSTiming.h" |
| 55 #include "core/css/FontFaceSet.h" | 57 #include "core/css/FontFaceSet.h" |
| 56 #include "core/css/MediaQueryMatcher.h" | 58 #include "core/css/MediaQueryMatcher.h" |
| 57 #include "core/css/PropertyRegistry.h" | 59 #include "core/css/PropertyRegistry.h" |
| 58 #include "core/css/StylePropertySet.h" | 60 #include "core/css/StylePropertySet.h" |
| 59 #include "core/css/StyleSheetContents.h" | 61 #include "core/css/StyleSheetContents.h" |
| 60 #include "core/css/StyleSheetList.h" | 62 #include "core/css/StyleSheetList.h" |
| (...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 575 document_timing_(*this), | 577 document_timing_(*this), |
| 576 write_recursion_is_too_deep_(false), | 578 write_recursion_is_too_deep_(false), |
| 577 write_recursion_depth_(0), | 579 write_recursion_depth_(0), |
| 578 registration_context_(initializer.RegistrationContext(this)), | 580 registration_context_(initializer.RegistrationContext(this)), |
| 579 element_data_cache_clear_timer_( | 581 element_data_cache_clear_timer_( |
| 580 TaskRunnerHelper::Get(TaskType::kUnspecedTimer, this), | 582 TaskRunnerHelper::Get(TaskType::kUnspecedTimer, this), |
| 581 this, | 583 this, |
| 582 &Document::ElementDataCacheClearTimerFired), | 584 &Document::ElementDataCacheClearTimerFired), |
| 583 timeline_(DocumentTimeline::Create(this)), | 585 timeline_(DocumentTimeline::Create(this)), |
| 584 compositor_pending_animations_(new CompositorPendingAnimations(*this)), | 586 compositor_pending_animations_(new CompositorPendingAnimations(*this)), |
| 587 worklet_animation_controller_(new WorkletAnimationController), | |
| 585 template_document_host_(nullptr), | 588 template_document_host_(nullptr), |
| 586 did_associate_form_controls_timer_( | 589 did_associate_form_controls_timer_( |
| 587 TaskRunnerHelper::Get(TaskType::kUnspecedLoading, this), | 590 TaskRunnerHelper::Get(TaskType::kUnspecedLoading, this), |
| 588 this, | 591 this, |
| 589 &Document::DidAssociateFormControlsTimerFired), | 592 &Document::DidAssociateFormControlsTimerFired), |
| 590 timers_(TaskRunnerHelper::Get(TaskType::kTimer, this)), | 593 timers_(TaskRunnerHelper::Get(TaskType::kTimer, this)), |
| 591 has_viewport_units_(false), | 594 has_viewport_units_(false), |
| 592 parser_sync_policy_(kAllowAsynchronousParsing), | 595 parser_sync_policy_(kAllowAsynchronousParsing), |
| 593 node_count_(0), | 596 node_count_(0), |
| 594 would_load_reason_(WouldLoadReason::kInvalid), | 597 would_load_reason_(WouldLoadReason::kInvalid), |
| (...skipping 5619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6214 } | 6217 } |
| 6215 | 6218 |
| 6216 void Document::ServiceScriptedAnimations( | 6219 void Document::ServiceScriptedAnimations( |
| 6217 double monotonic_animation_start_time) { | 6220 double monotonic_animation_start_time) { |
| 6218 if (!scripted_animation_controller_) | 6221 if (!scripted_animation_controller_) |
| 6219 return; | 6222 return; |
| 6220 scripted_animation_controller_->ServiceScriptedAnimations( | 6223 scripted_animation_controller_->ServiceScriptedAnimations( |
| 6221 monotonic_animation_start_time); | 6224 monotonic_animation_start_time); |
| 6222 } | 6225 } |
| 6223 | 6226 |
| 6227 void Document::RegisterWorkletAnimation(WorkletAnimationBase* animation) { | |
| 6228 worklet_animation_controller_->RegisterAnimation(animation); | |
| 6229 } | |
|
majidvp
2017/06/06 16:04:27
Can we just expose worklet_animation_controller_ a
smcgruer
2017/06/07 18:23:25
Done.
| |
| 6230 | |
| 6231 void Document::DeregisterWorkletAnimation(WorkletAnimationBase* animation) { | |
| 6232 worklet_animation_controller_->DeregisterAnimation(animation); | |
| 6233 } | |
| 6234 | |
| 6224 ScriptedIdleTaskController& Document::EnsureScriptedIdleTaskController() { | 6235 ScriptedIdleTaskController& Document::EnsureScriptedIdleTaskController() { |
| 6225 if (!scripted_idle_task_controller_) | 6236 if (!scripted_idle_task_controller_) |
| 6226 scripted_idle_task_controller_ = ScriptedIdleTaskController::Create(this); | 6237 scripted_idle_task_controller_ = ScriptedIdleTaskController::Create(this); |
| 6227 return *scripted_idle_task_controller_; | 6238 return *scripted_idle_task_controller_; |
| 6228 } | 6239 } |
| 6229 | 6240 |
| 6230 int Document::RequestIdleCallback(IdleRequestCallback* callback, | 6241 int Document::RequestIdleCallback(IdleRequestCallback* callback, |
| 6231 const IdleRequestOptions& options) { | 6242 const IdleRequestOptions& options) { |
| 6232 return EnsureScriptedIdleTaskController().RegisterCallback(callback, options); | 6243 return EnsureScriptedIdleTaskController().RegisterCallback(callback, options); |
| 6233 } | 6244 } |
| (...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6778 visitor->Trace(custom_element_microtask_run_queue_); | 6789 visitor->Trace(custom_element_microtask_run_queue_); |
| 6779 visitor->Trace(element_data_cache_); | 6790 visitor->Trace(element_data_cache_); |
| 6780 visitor->Trace(use_elements_needing_update_); | 6791 visitor->Trace(use_elements_needing_update_); |
| 6781 visitor->Trace(timers_); | 6792 visitor->Trace(timers_); |
| 6782 visitor->Trace(template_document_); | 6793 visitor->Trace(template_document_); |
| 6783 visitor->Trace(template_document_host_); | 6794 visitor->Trace(template_document_host_); |
| 6784 visitor->Trace(user_action_elements_); | 6795 visitor->Trace(user_action_elements_); |
| 6785 visitor->Trace(svg_extensions_); | 6796 visitor->Trace(svg_extensions_); |
| 6786 visitor->Trace(timeline_); | 6797 visitor->Trace(timeline_); |
| 6787 visitor->Trace(compositor_pending_animations_); | 6798 visitor->Trace(compositor_pending_animations_); |
| 6799 visitor->Trace(worklet_animation_controller_); | |
| 6788 visitor->Trace(context_document_); | 6800 visitor->Trace(context_document_); |
| 6789 visitor->Trace(canvas_font_cache_); | 6801 visitor->Trace(canvas_font_cache_); |
| 6790 visitor->Trace(intersection_observer_controller_); | 6802 visitor->Trace(intersection_observer_controller_); |
| 6791 visitor->Trace(snap_coordinator_); | 6803 visitor->Trace(snap_coordinator_); |
| 6792 visitor->Trace(resize_observer_controller_); | 6804 visitor->Trace(resize_observer_controller_); |
| 6793 visitor->Trace(property_registry_); | 6805 visitor->Trace(property_registry_); |
| 6794 visitor->Trace(network_state_observer_); | 6806 visitor->Trace(network_state_observer_); |
| 6795 Supplementable<Document>::Trace(visitor); | 6807 Supplementable<Document>::Trace(visitor); |
| 6796 TreeScope::Trace(visitor); | 6808 TreeScope::Trace(visitor); |
| 6797 ContainerNode::Trace(visitor); | 6809 ContainerNode::Trace(visitor); |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6842 } | 6854 } |
| 6843 | 6855 |
| 6844 void showLiveDocumentInstances() { | 6856 void showLiveDocumentInstances() { |
| 6845 WeakDocumentSet& set = liveDocumentSet(); | 6857 WeakDocumentSet& set = liveDocumentSet(); |
| 6846 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); | 6858 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); |
| 6847 for (blink::Document* document : set) | 6859 for (blink::Document* document : set) |
| 6848 fprintf(stderr, "- Document %p URL: %s\n", document, | 6860 fprintf(stderr, "- Document %p URL: %s\n", document, |
| 6849 document->Url().GetString().Utf8().data()); | 6861 document->Url().GetString().Utf8().data()); |
| 6850 } | 6862 } |
| 6851 #endif | 6863 #endif |
| OLD | NEW |