OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006 Eric Seidel <eric@webkit.org> | 2 * Copyright (C) 2006 Eric Seidel <eric@webkit.org> |
3 * Copyright (C) 2008, 2009 Apple Inc. All rights reserved. | 3 * Copyright (C) 2008, 2009 Apple Inc. All rights reserved. |
4 * Copyright (C) Research In Motion Limited 2011. All rights reserved. | 4 * Copyright (C) Research In Motion Limited 2011. All rights reserved. |
5 * | 5 * |
6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
8 * are met: | 8 * are met: |
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 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 } | 388 } |
389 | 389 |
390 bool SVGImage::hasAnimations() const | 390 bool SVGImage::hasAnimations() const |
391 { | 391 { |
392 SVGSVGElement* rootElement = svgRootElement(m_page.get()); | 392 SVGSVGElement* rootElement = svgRootElement(m_page.get()); |
393 if (!rootElement) | 393 if (!rootElement) |
394 return false; | 394 return false; |
395 return rootElement->timeContainer()->hasAnimations() || toLocalFrame(m_page-
>mainFrame())->document()->timeline().hasPendingUpdates(); | 395 return rootElement->timeContainer()->hasAnimations() || toLocalFrame(m_page-
>mainFrame())->document()->timeline().hasPendingUpdates(); |
396 } | 396 } |
397 | 397 |
| 398 void SVGImage::advanceAnimationForTesting() |
| 399 { |
| 400 if (SVGSVGElement* rootElement = svgRootElement(m_page.get())) { |
| 401 rootElement->timeContainer()->advanceFrameForTesting(); |
| 402 |
| 403 // The following triggers animation updates which can issue a new draw |
| 404 // but will not permanently change the animation timeline. |
| 405 // TODO(pdr): Actually advance the document timeline so CSS animations |
| 406 // can be properly tested. |
| 407 rootElement->document().page()->animator().serviceScriptedAnimations(roo
tElement->getCurrentTime()); |
| 408 imageObserver()->animationAdvanced(this); |
| 409 } |
| 410 } |
| 411 |
398 void SVGImage::updateUseCounters(Document& document) const | 412 void SVGImage::updateUseCounters(Document& document) const |
399 { | 413 { |
400 if (SVGSVGElement* rootElement = svgRootElement(m_page.get())) { | 414 if (SVGSVGElement* rootElement = svgRootElement(m_page.get())) { |
401 if (rootElement->timeContainer()->hasAnimations()) | 415 if (rootElement->timeContainer()->hasAnimations()) |
402 UseCounter::countDeprecation(document, UseCounter::SVGSMILAnimationI
nImageRegardlessOfCache); | 416 UseCounter::countDeprecation(document, UseCounter::SVGSMILAnimationI
nImageRegardlessOfCache); |
403 } | 417 } |
404 } | 418 } |
405 | 419 |
406 bool SVGImage::dataChanged(bool allDataReceived) | 420 bool SVGImage::dataChanged(bool allDataReceived) |
407 { | 421 { |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
479 | 493 |
480 return m_page; | 494 return m_page; |
481 } | 495 } |
482 | 496 |
483 String SVGImage::filenameExtension() const | 497 String SVGImage::filenameExtension() const |
484 { | 498 { |
485 return "svg"; | 499 return "svg"; |
486 } | 500 } |
487 | 501 |
488 } | 502 } |
OLD | NEW |