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

Side by Side Diff: Source/core/rendering/RenderObject.cpp

Issue 754813002: Expose setting API to set ImageAnimationPolicy(Allowed, Once, None) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Support three options for animations Created 6 years 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
OLDNEW
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) 2000 Dirk Mueller (mueller@kde.org) 4 * (C) 2000 Dirk Mueller (mueller@kde.org)
5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv ed. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv ed.
7 * Copyright (C) 2009 Google Inc. All rights reserved. 7 * Copyright (C) 2009 Google Inc. All rights reserved.
8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 2772 matching lines...) Expand 10 before | Expand all | Expand 10 after
2783 // RenderTexts don't have their own style, they just use their parent's styl e, 2783 // RenderTexts don't have their own style, they just use their parent's styl e,
2784 // so we don't want to include them. 2784 // so we don't want to include them.
2785 if (isText()) 2785 if (isText())
2786 return; 2786 return;
2787 2787
2788 addAnnotatedRegions(regions); 2788 addAnnotatedRegions(regions);
2789 for (RenderObject* curr = slowFirstChild(); curr; curr = curr->nextSibling() ) 2789 for (RenderObject* curr = slowFirstChild(); curr; curr = curr->nextSibling() )
2790 curr->collectAnnotatedRegions(regions); 2790 curr->collectAnnotatedRegions(regions);
2791 } 2791 }
2792 2792
2793 bool RenderObject::willRenderImage(ImageResource*) 2793 bool RenderObject::willRenderImage(ImageResource*, bool repeated)
2794 { 2794 {
2795 // Without visibility we won't render (and therefore don't care about animat ion). 2795 // Without visibility we won't render (and therefore don't care about animat ion).
2796 if (style()->visibility() != VISIBLE) 2796 if (style()->visibility() != VISIBLE)
2797 return false; 2797 return false;
2798 2798
2799 // We will not render a new image when Active DOM is suspended 2799 // We will not render a new image when Active DOM is suspended
2800 if (document().activeDOMObjectsAreSuspended()) 2800 if (document().activeDOMObjectsAreSuspended())
2801 return false; 2801 return false;
2802 2802
2803 // We will not render a new imagePweb
dmazzoni 2014/11/24 17:50:47 Typo?
je_julie(Not used) 2014/11/27 17:22:50 Done.
2804 // when AnimatedImageType is set to AnimatedImageTypeNone or
2805 // when AnimatedImageType is set to AnimatedImageTypeOnce and frame is last.
2806 if (document().settings()) {
2807 AnimatedImageType animation = document().settings()->animatedImageType() ;
2808 if (animation == AnimatedImageTypeNone)
2809 return false;
2810 if (animation == AnimatedImageTypeOnce && repeated)
2811 return false;
2812 }
2803 // If we're not in a window (i.e., we're dormant from being in a background tab) 2813 // If we're not in a window (i.e., we're dormant from being in a background tab)
2804 // then we don't want to render either. 2814 // then we don't want to render either.
2805 return document().view()->isVisible(); 2815 return document().view()->isVisible();
2806 } 2816 }
2807 2817
2808 int RenderObject::caretMinOffset() const 2818 int RenderObject::caretMinOffset() const
2809 { 2819 {
2810 return 0; 2820 return 0;
2811 } 2821 }
2812 2822
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after
3132 { 3142 {
3133 if (object1) { 3143 if (object1) {
3134 const blink::RenderObject* root = object1; 3144 const blink::RenderObject* root = object1;
3135 while (root->parent()) 3145 while (root->parent())
3136 root = root->parent(); 3146 root = root->parent();
3137 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); 3147 root->showRenderTreeAndMark(object1, "*", object2, "-", 0);
3138 } 3148 }
3139 } 3149 }
3140 3150
3141 #endif 3151 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698