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

Side by Side Diff: Source/core/svg/graphics/SVGImage.cpp

Issue 196223014: Fix running of CSS Animations in SVG-in-<img>/background-image/etc. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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) 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 11 matching lines...) Expand all
22 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 22 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
23 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */ 26 */
27 27
28 #include "config.h" 28 #include "config.h"
29 29
30 #include "core/svg/graphics/SVGImage.h" 30 #include "core/svg/graphics/SVGImage.h"
31 31
32 #include "core/animation/DocumentTimeline.h"
32 #include "core/dom/NodeTraversal.h" 33 #include "core/dom/NodeTraversal.h"
33 #include "core/dom/shadow/ComposedTreeWalker.h" 34 #include "core/dom/shadow/ComposedTreeWalker.h"
34 #include "core/frame/FrameView.h" 35 #include "core/frame/FrameView.h"
35 #include "core/frame/LocalFrame.h" 36 #include "core/frame/LocalFrame.h"
36 #include "core/frame/Settings.h" 37 #include "core/frame/Settings.h"
37 #include "core/loader/FrameLoadRequest.h" 38 #include "core/loader/FrameLoadRequest.h"
38 #include "core/page/Chrome.h" 39 #include "core/page/Chrome.h"
39 #include "core/rendering/style/RenderStyle.h" 40 #include "core/rendering/style/RenderStyle.h"
40 #include "core/rendering/svg/RenderSVGRoot.h" 41 #include "core/rendering/svg/RenderSVGRoot.h"
41 #include "core/svg/SVGDocument.h" 42 #include "core/svg/SVGDocument.h"
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 } 425 }
425 426
426 bool SVGImage::hasAnimations() const 427 bool SVGImage::hasAnimations() const
427 { 428 {
428 if (!m_page) 429 if (!m_page)
429 return false; 430 return false;
430 LocalFrame* frame = m_page->mainFrame(); 431 LocalFrame* frame = m_page->mainFrame();
431 SVGSVGElement* rootElement = toSVGDocument(frame->document())->rootElement() ; 432 SVGSVGElement* rootElement = toSVGDocument(frame->document())->rootElement() ;
432 if (!rootElement) 433 if (!rootElement)
433 return false; 434 return false;
434 return rootElement->timeContainer()->hasAnimations(); 435 return rootElement->timeContainer()->hasAnimations() || frame->document()->t imeline().hasPendingUpdates();
435 } 436 }
436 437
437 bool SVGImage::dataChanged(bool allDataReceived) 438 bool SVGImage::dataChanged(bool allDataReceived)
438 { 439 {
439 TRACE_EVENT0("webkit", "SVGImage::dataChanged"); 440 TRACE_EVENT0("webkit", "SVGImage::dataChanged");
440 441
441 // Don't do anything if is an empty image. 442 // Don't do anything if is an empty image.
442 if (!data()->size()) 443 if (!data()->size())
443 return true; 444 return true;
444 445
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
480 481
481 return m_page; 482 return m_page;
482 } 483 }
483 484
484 String SVGImage::filenameExtension() const 485 String SVGImage::filenameExtension() const
485 { 486 {
486 return "svg"; 487 return "svg";
487 } 488 }
488 489
489 } 490 }
OLDNEW
« no previous file with comments | « Source/core/animation/DocumentTimeline.h ('k') | Source/core/svg/graphics/SVGImageChromeClient.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698