| OLD | NEW |
| 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 875 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 886 | 886 |
| 887 if (hasRareData()) { | 887 if (hasRareData()) { |
| 888 ElementRareData* data = elementRareData(); | 888 ElementRareData* data = elementRareData(); |
| 889 | 889 |
| 890 // attach() will perform the below steps for us when inside recalcStyle. | 890 // attach() will perform the below steps for us when inside recalcStyle. |
| 891 if (!document().inStyleRecalc()) { | 891 if (!document().inStyleRecalc()) { |
| 892 data->clearComputedStyle(); | 892 data->clearComputedStyle(); |
| 893 } | 893 } |
| 894 | 894 |
| 895 if (ActiveAnimations* activeAnimations = data->activeAnimations()) { | 895 if (ActiveAnimations* activeAnimations = data->activeAnimations()) { |
| 896 if (context.performingReattach) { | 896 if (!context.performingReattach) { |
| 897 // FIXME: restart compositor animations rather than pull back to
the main thread | |
| 898 activeAnimations->cancelAnimationOnCompositor(); | |
| 899 } else { | |
| 900 activeAnimations->cssAnimations().cancel(); | 897 activeAnimations->cssAnimations().cancel(); |
| 901 activeAnimations->setAnimationStyleChange(false); | 898 activeAnimations->setAnimationStyleChange(false); |
| 902 } | 899 } |
| 903 } | 900 } |
| 904 | 901 |
| 905 if (ElementShadow* shadow = data->shadow()) | 902 if (ElementShadow* shadow = data->shadow()) |
| 906 shadow->detach(context); | 903 shadow->detach(context); |
| 907 } | 904 } |
| 908 ContainerNode::detach(context); | 905 ContainerNode::detach(context); |
| 909 } | 906 } |
| 910 | 907 |
| 911 PassRefPtr<RenderStyle> Element::styleForRenderer() | 908 PassRefPtr<RenderStyle> Element::styleForRenderer() |
| 912 { | 909 { |
| 913 ASSERT(document().inStyleRecalc()); | 910 ASSERT(document().inStyleRecalc()); |
| 914 | 911 |
| 915 // FIXME: Instead of clearing updates that may have been added from calls to
styleForElement | 912 // FIXME: Instead of clearing updates that may have been added from calls to
styleForElement |
| 916 // outside recalcStyle, we should just never set them if we're not inside re
calcStyle. | 913 // outside recalcStyle, we should just never set them if we're not inside re
calcStyle. |
| 917 if (ActiveAnimations* activeAnimations = this->activeAnimations()) | 914 if (ActiveAnimations* activeAnimations = this->activeAnimations()) |
| 918 activeAnimations->cssAnimations().setPendingUpdate(nullptr); | 915 activeAnimations->cssAnimations().setPendingUpdate(nullptr); |
| 919 | 916 |
| 920 RefPtr<RenderStyle> style = document().ensureStyleResolver().styleForElement
(this); | 917 RefPtr<RenderStyle> style = document().ensureStyleResolver().styleForElement
(this); |
| 921 ASSERT(style); | 918 ASSERT(style); |
| 922 | 919 |
| 923 // styleForElement() might add active animations so we need to get it again. | 920 // styleForElement() might add active animations so we need to get it again. |
| 924 if (ActiveAnimations* activeAnimations = this->activeAnimations()) { | 921 if (ActiveAnimations* activeAnimations = this->activeAnimations()) { |
| 925 activeAnimations->cssAnimations().maybeApplyPendingUpdate(this); | 922 activeAnimations->cssAnimations().maybeApplyPendingUpdate(this); |
| 926 activeAnimations->updateAnimationFlags(*style); | |
| 927 } | 923 } |
| 928 | 924 |
| 929 if (style->hasTransform()) { | 925 if (style->hasTransform()) { |
| 930 if (const StylePropertySet* inlineStyle = this->inlineStyle()) | 926 if (const StylePropertySet* inlineStyle = this->inlineStyle()) |
| 931 style->setHasInlineTransform(inlineStyle->hasProperty(CSSPropertyTra
nsform) || inlineStyle->hasProperty(CSSPropertyWebkitTransform)); | 927 style->setHasInlineTransform(inlineStyle->hasProperty(CSSPropertyTra
nsform) || inlineStyle->hasProperty(CSSPropertyWebkitTransform)); |
| 932 } | 928 } |
| 933 | 929 |
| 934 document().didRecalculateStyleForElement(); | 930 document().didRecalculateStyleForElement(); |
| 935 return style.release(); | 931 return style.release(); |
| 936 } | 932 } |
| (...skipping 897 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1834 return false; | 1830 return false; |
| 1835 // Turn off style sharing for elements that can gain layers for reasons outs
ide of the style system. | 1831 // Turn off style sharing for elements that can gain layers for reasons outs
ide of the style system. |
| 1836 // See comments in RenderObject::setStyle(). | 1832 // See comments in RenderObject::setStyle(). |
| 1837 // FIXME: Why does gaining a layer from outside the style system require dis
abling sharing? | 1833 // FIXME: Why does gaining a layer from outside the style system require dis
abling sharing? |
| 1838 if (isHTMLCanvasElement(*this)) | 1834 if (isHTMLCanvasElement(*this)) |
| 1839 return false; | 1835 return false; |
| 1840 return true; | 1836 return true; |
| 1841 } | 1837 } |
| 1842 | 1838 |
| 1843 } // namespace blink | 1839 } // namespace blink |
| OLD | NEW |