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

Side by Side Diff: Source/core/testing/Internals.cpp

Issue 139273007: Web Animations: Remove legacy animations engine. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 10 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 * Copyright (C) 2013 Apple Inc. All rights reserved. 3 * Copyright (C) 2013 Apple Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 #include "core/loader/HistoryItem.h" 97 #include "core/loader/HistoryItem.h"
98 #include "core/page/Chrome.h" 98 #include "core/page/Chrome.h"
99 #include "core/page/ChromeClient.h" 99 #include "core/page/ChromeClient.h"
100 #include "core/frame/DOMWindow.h" 100 #include "core/frame/DOMWindow.h"
101 #include "core/page/EventHandler.h" 101 #include "core/page/EventHandler.h"
102 #include "core/frame/FrameView.h" 102 #include "core/frame/FrameView.h"
103 #include "core/page/Page.h" 103 #include "core/page/Page.h"
104 #include "core/page/PagePopupController.h" 104 #include "core/page/PagePopupController.h"
105 #include "core/page/PrintContext.h" 105 #include "core/page/PrintContext.h"
106 #include "core/frame/Settings.h" 106 #include "core/frame/Settings.h"
107 #include "core/frame/animation/AnimationController.h"
108 #include "core/rendering/CompositedLayerMapping.h" 107 #include "core/rendering/CompositedLayerMapping.h"
109 #include "core/rendering/RenderLayer.h" 108 #include "core/rendering/RenderLayer.h"
110 #include "core/rendering/RenderLayerCompositor.h" 109 #include "core/rendering/RenderLayerCompositor.h"
111 #include "core/rendering/RenderMenuList.h" 110 #include "core/rendering/RenderMenuList.h"
112 #include "core/rendering/RenderObject.h" 111 #include "core/rendering/RenderObject.h"
113 #include "core/rendering/RenderTreeAsText.h" 112 #include "core/rendering/RenderTreeAsText.h"
114 #include "core/rendering/RenderView.h" 113 #include "core/rendering/RenderView.h"
115 #include "core/testing/GCObservation.h" 114 #include "core/testing/GCObservation.h"
116 #include "core/workers/WorkerThread.h" 115 #include "core/workers/WorkerThread.h"
117 #include "platform/ColorChooser.h" 116 #include "platform/ColorChooser.h"
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after
481 } 480 }
482 return treeScope1->comparePosition(*treeScope2); 481 return treeScope1->comparePosition(*treeScope2);
483 } 482 }
484 483
485 unsigned Internals::numberOfActiveAnimations() const 484 unsigned Internals::numberOfActiveAnimations() const
486 { 485 {
487 Frame* contextFrame = frame(); 486 Frame* contextFrame = frame();
488 Document* document = contextFrame->document(); 487 Document* document = contextFrame->document();
489 if (RuntimeEnabledFeatures::webAnimationsCSSEnabled()) 488 if (RuntimeEnabledFeatures::webAnimationsCSSEnabled())
490 return document->timeline()->numberOfActiveAnimationsForTesting() + docu ment->transitionTimeline()->numberOfActiveAnimationsForTesting(); 489 return document->timeline()->numberOfActiveAnimationsForTesting() + docu ment->transitionTimeline()->numberOfActiveAnimationsForTesting();
491 return contextFrame->animation().numberOfActiveAnimations(document); 490 return 0;
492 } 491 }
493 492
494 void Internals::pauseAnimations(double pauseTime, ExceptionState& exceptionState ) 493 void Internals::pauseAnimations(double pauseTime, ExceptionState& exceptionState )
495 { 494 {
496 if (pauseTime < 0) { 495 if (pauseTime < 0) {
497 exceptionState.throwDOMException(InvalidAccessError, "The pauseTime prov ided is negative."); 496 exceptionState.throwDOMException(InvalidAccessError, "The pauseTime prov ided is negative.");
498 return; 497 return;
499 } 498 }
500 499
501 if (RuntimeEnabledFeatures::webAnimationsCSSEnabled()) { 500 if (RuntimeEnabledFeatures::webAnimationsCSSEnabled()) {
502 frame()->document()->timeline()->pauseAnimationsForTesting(pauseTime); 501 frame()->document()->timeline()->pauseAnimationsForTesting(pauseTime);
503 frame()->document()->transitionTimeline()->pauseAnimationsForTesting(pau seTime); 502 frame()->document()->transitionTimeline()->pauseAnimationsForTesting(pau seTime);
504 } else {
505 frame()->animation().pauseAnimationsForTesting(pauseTime);
506 } 503 }
507 } 504 }
508 505
509 bool Internals::hasShadowInsertionPoint(const Node* root, ExceptionState& except ionState) const 506 bool Internals::hasShadowInsertionPoint(const Node* root, ExceptionState& except ionState) const
510 { 507 {
511 if (root && root->isShadowRoot()) 508 if (root && root->isShadowRoot())
512 return toShadowRoot(root)->containsShadowElements(); 509 return toShadowRoot(root)->containsShadowElements();
513 510
514 exceptionState.throwDOMException(InvalidAccessError, "The root node provided is invalid."); 511 exceptionState.throwDOMException(InvalidAccessError, "The root node provided is invalid.");
515 return 0; 512 return 0;
(...skipping 1908 matching lines...) Expand 10 before | Expand all | Expand 10 after
2424 }; 2421 };
2425 2422
2426 } // namespace 2423 } // namespace
2427 2424
2428 ScriptPromise Internals::addOneToPromise(ExecutionContext* context, ScriptPromis e promise) 2425 ScriptPromise Internals::addOneToPromise(ExecutionContext* context, ScriptPromis e promise)
2429 { 2426 {
2430 return promise.then(AddOneFunction::create(context)); 2427 return promise.then(AddOneFunction::create(context));
2431 } 2428 }
2432 2429
2433 } 2430 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698