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

Side by Side Diff: sky/engine/core/dom/Element.cpp

Issue 772673002: Fix Animations, Remove Compostior Animations. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: cleanup 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
« no previous file with comments | « sky/engine/core/dom/DocumentLifecycle.cpp ('k') | sky/engine/core/frame/FrameView.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) 2001 Peter Kelly (pmk@post.com) 4 * (C) 2001 Peter Kelly (pmk@post.com)
5 * (C) 2001 Dirk Mueller (mueller@kde.org) 5 * (C) 2001 Dirk Mueller (mueller@kde.org)
6 * (C) 2007 David Smith (catfish.man@gmail.com) 6 * (C) 2007 David Smith (catfish.man@gmail.com)
7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. All rights reserved. 7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. All rights reserved.
8 * (C) 2007 Eric Seidel (eric@webkit.org) 8 * (C) 2007 Eric Seidel (eric@webkit.org)
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 824 matching lines...) Expand 10 before | Expand all | Expand 10 after
835 ElementRareData* data = elementRareData(); 835 ElementRareData* data = elementRareData();
836 836
837 // attach() will perform the below steps for us when inside recalcStyle. 837 // attach() will perform the below steps for us when inside recalcStyle.
838 if (!document().inStyleRecalc()) { 838 if (!document().inStyleRecalc()) {
839 data->clearComputedStyle(); 839 data->clearComputedStyle();
840 } 840 }
841 841
842 if (ActiveAnimations* activeAnimations = data->activeAnimations()) { 842 if (ActiveAnimations* activeAnimations = data->activeAnimations()) {
843 if (context.performingReattach) { 843 if (context.performingReattach) {
844 // FIXME: restart compositor animations rather than pull back to the main thread 844 // FIXME: restart compositor animations rather than pull back to the main thread
845 activeAnimations->cancelAnimationOnCompositor(); 845 // FIXME(rafaelw): What should we do here?
846 // activeAnimations->cancelAnimationOnCompositor();
esprehn 2014/12/02 07:02:02 I don't think we need to do anything, the animatio
846 } else { 847 } else {
847 activeAnimations->cssAnimations().cancel(); 848 activeAnimations->cssAnimations().cancel();
848 activeAnimations->setAnimationStyleChange(false); 849 activeAnimations->setAnimationStyleChange(false);
849 } 850 }
850 } 851 }
851 852
852 if (ElementShadow* shadow = data->shadow()) 853 if (ElementShadow* shadow = data->shadow())
853 shadow->detach(context); 854 shadow->detach(context);
854 } 855 }
855 ContainerNode::detach(context); 856 ContainerNode::detach(context);
856 } 857 }
857 858
858 PassRefPtr<RenderStyle> Element::styleForRenderer() 859 PassRefPtr<RenderStyle> Element::styleForRenderer()
859 { 860 {
860 ASSERT(document().inStyleRecalc()); 861 ASSERT(document().inStyleRecalc());
861 862
862 // FIXME: Instead of clearing updates that may have been added from calls to styleForElement 863 // FIXME: Instead of clearing updates that may have been added from calls to styleForElement
863 // outside recalcStyle, we should just never set them if we're not inside re calcStyle. 864 // outside recalcStyle, we should just never set them if we're not inside re calcStyle.
864 if (ActiveAnimations* activeAnimations = this->activeAnimations()) 865 if (ActiveAnimations* activeAnimations = this->activeAnimations())
865 activeAnimations->cssAnimations().setPendingUpdate(nullptr); 866 activeAnimations->cssAnimations().setPendingUpdate(nullptr);
866 867
867 RefPtr<RenderStyle> style = document().ensureStyleResolver().styleForElement (this); 868 RefPtr<RenderStyle> style = document().ensureStyleResolver().styleForElement (this);
868 ASSERT(style); 869 ASSERT(style);
869 870
870 // styleForElement() might add active animations so we need to get it again. 871 // styleForElement() might add active animations so we need to get it again.
871 if (ActiveAnimations* activeAnimations = this->activeAnimations()) { 872 if (ActiveAnimations* activeAnimations = this->activeAnimations()) {
872 activeAnimations->cssAnimations().maybeApplyPendingUpdate(this); 873 activeAnimations->cssAnimations().maybeApplyPendingUpdate(this);
873 activeAnimations->updateAnimationFlags(*style);
874 } 874 }
875 875
876 if (style->hasTransform()) { 876 if (style->hasTransform()) {
877 if (const StylePropertySet* inlineStyle = this->inlineStyle()) 877 if (const StylePropertySet* inlineStyle = this->inlineStyle())
878 style->setHasInlineTransform(inlineStyle->hasProperty(CSSPropertyTra nsform) || inlineStyle->hasProperty(CSSPropertyWebkitTransform)); 878 style->setHasInlineTransform(inlineStyle->hasProperty(CSSPropertyTra nsform) || inlineStyle->hasProperty(CSSPropertyWebkitTransform));
879 } 879 }
880 880
881 document().didRecalculateStyleForElement(); 881 document().didRecalculateStyleForElement();
882 return style.release(); 882 return style.release();
883 } 883 }
(...skipping 897 matching lines...) Expand 10 before | Expand all | Expand 10 after
1781 return false; 1781 return false;
1782 // Turn off style sharing for elements that can gain layers for reasons outs ide of the style system. 1782 // Turn off style sharing for elements that can gain layers for reasons outs ide of the style system.
1783 // See comments in RenderObject::setStyle(). 1783 // See comments in RenderObject::setStyle().
1784 // FIXME: Why does gaining a layer from outside the style system require dis abling sharing? 1784 // FIXME: Why does gaining a layer from outside the style system require dis abling sharing?
1785 if (isHTMLCanvasElement(*this)) 1785 if (isHTMLCanvasElement(*this))
1786 return false; 1786 return false;
1787 return true; 1787 return true;
1788 } 1788 }
1789 1789
1790 } // namespace blink 1790 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/core/dom/DocumentLifecycle.cpp ('k') | sky/engine/core/frame/FrameView.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698