| Differences between
and this patch
- a/WebCore/ChangeLog +23 lines
Lines 1-5 a/WebCore/ChangeLog_sec1
1
2009-02-11  Simon Fraser  <simon.fraser@apple.com>
1
2009-02-11  Simon Fraser  <simon.fraser@apple.com>
2
2
3
        Reviewed by NOBODY (OOPS!).
4
5
        https://bugs.webkit.org/show_bug.cgi?id=23862
6
        
7
        Add bits on RenderStyle that get set when running accelerated
8
        transitions of transform or opacity. These ensure that styles
9
        compare as different during the transition, so that interruption
10
        can be detected reliably.
11
12
        * page/animation/ImplicitAnimation.cpp:
13
        (WebCore::ImplicitAnimation::animate):
14
        * rendering/style/RenderStyle.h:
15
        (WebCore::InheritedFlags::isTransformAnimating):
16
        (WebCore::InheritedFlags::isOpacityAnimating):
17
        (WebCore::InheritedFlags::setIsTransformAnimating):
18
        (WebCore::InheritedFlags::setIsOpacityAnimating):
19
        * rendering/style/StyleRareNonInheritedData.cpp:
20
        (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
21
        (WebCore::StyleRareNonInheritedData::operator==):
22
        * rendering/style/StyleRareNonInheritedData.h:
23
24
2009-02-11  Simon Fraser  <simon.fraser@apple.com>
25
3
        Reviewed by Dave Hyatt
26
        Reviewed by Dave Hyatt
4
27
5
        https://bugs.webkit.org/show_bug.cgi?id=23548
28
        https://bugs.webkit.org/show_bug.cgi?id=23548
- a/WebCore/page/animation/ImplicitAnimation.cpp +19 lines
Lines 79-86 void ImplicitAnimation::animate(CompositeAnimation*, RenderObject*, RenderStyle* a/WebCore/page/animation/ImplicitAnimation.cpp_sec1
79
        animatedStyle = RenderStyle::clone(targetStyle);
79
        animatedStyle = RenderStyle::clone(targetStyle);
80
80
81
    bool needsAnim = blendProperties(this, m_animatingProperty, animatedStyle.get(), m_fromStyle.get(), m_toStyle.get(), progress(1, 0, 0));
81
    bool needsAnim = blendProperties(this, m_animatingProperty, animatedStyle.get(), m_fromStyle.get(), m_toStyle.get(), progress(1, 0, 0));
82
    // FIXME: we also need to detect cases where we have to software animate for other reasons,
83
    // such as a child using inheriting the transform. https://bugs.webkit.org/show_bug.cgi?id=23902
82
    if (needsAnim)
84
    if (needsAnim)
83
        setAnimating();
85
        setAnimating();
86
    else {
87
#if USE(ACCELERATED_COMPOSITING)
88
        // If we are running an accelerated animation, set a flag in the style which causes it
89
        // to compare as different to any other style. This ensures that changes to the propery
90
        // that is animating are correctly detected during the animation (e.g. when a transition
91
        // gets interrupted).
92
        switch (m_animatingProperty) {
93
        case CSSPropertyOpacity:
94
            animatedStyle->setIsOpacityAnimating();
95
            break;
96
    
97
        case CSSPropertyWebkitTransform:
98
            animatedStyle->setIsTransformAnimating();
99
            break;
100
        }
101
#endif
102
    }
84
103
85
    // Fire the start timeout if needed
104
    // Fire the start timeout if needed
86
    fireAnimationEventsIfNeeded();
105
    fireAnimationEventsIfNeeded();
- a/WebCore/rendering/style/RenderStyle.h +10 lines
Lines 657-662 public: a/WebCore/rendering/style/RenderStyle.h_sec1
657
    // return the first found Animation (including 'all' transitions)
657
    // return the first found Animation (including 'all' transitions)
658
    const Animation* transitionForProperty(int property) const;
658
    const Animation* transitionForProperty(int property) const;
659
659
660
#if USE(ACCELERATED_COMPOSITING)
661
    bool isTransformAnimating() const { return rareNonInheritedData->m_isTransformAnimating; }
662
    bool isOpacityAnimating() const { return rareNonInheritedData->m_isOpacityAnimating; }
663
#endif
664
660
    int lineClamp() const { return rareNonInheritedData->lineClamp; }
665
    int lineClamp() const { return rareNonInheritedData->lineClamp; }
661
    bool textSizeAdjust() const { return rareInheritedData->textSizeAdjust; }
666
    bool textSizeAdjust() const { return rareInheritedData->textSizeAdjust; }
662
    ETextSecurity textSecurity() const { return static_cast<ETextSecurity>(rareInheritedData->textSecurity); }
667
    ETextSecurity textSecurity() const { return static_cast<ETextSecurity>(rareInheritedData->textSecurity); }
Lines 952-957 public: a/WebCore/rendering/style/RenderStyle.h_sec2
952
    void adjustAnimations();
957
    void adjustAnimations();
953
    void adjustTransitions();
958
    void adjustTransitions();
954
959
960
#if USE(ACCELERATED_COMPOSITING)
961
    void setIsTransformAnimating(bool b = true) { SET_VAR(rareNonInheritedData, m_isTransformAnimating, b); }
962
    void setIsOpacityAnimating(bool b = true) { SET_VAR(rareNonInheritedData, m_isOpacityAnimating, b); }
963
#endif
964
955
    void setLineClamp(int c) { SET_VAR(rareNonInheritedData, lineClamp, c); }
965
    void setLineClamp(int c) { SET_VAR(rareNonInheritedData, lineClamp, c); }
956
    void setTextSizeAdjust(bool b) { SET_VAR(rareInheritedData, textSizeAdjust, b); }
966
    void setTextSizeAdjust(bool b) { SET_VAR(rareInheritedData, textSizeAdjust, b); }
957
    void setTextSecurity(ETextSecurity aTextSecurity) { SET_VAR(rareInheritedData, textSecurity, aTextSecurity); }
967
    void setTextSecurity(ETextSecurity aTextSecurity) { SET_VAR(rareInheritedData, textSecurity, aTextSecurity); }
- a/WebCore/rendering/style/StyleRareNonInheritedData.cpp +14 lines
Lines 42-47 StyleRareNonInheritedData::StyleRareNonInheritedData() a/WebCore/rendering/style/StyleRareNonInheritedData.cpp_sec1
42
    , matchNearestMailBlockquoteColor(RenderStyle::initialMatchNearestMailBlockquoteColor())
42
    , matchNearestMailBlockquoteColor(RenderStyle::initialMatchNearestMailBlockquoteColor())
43
    , m_appearance(RenderStyle::initialAppearance())
43
    , m_appearance(RenderStyle::initialAppearance())
44
    , m_borderFit(RenderStyle::initialBorderFit())
44
    , m_borderFit(RenderStyle::initialBorderFit())
45
#if USE(ACCELERATED_COMPOSITING)
46
    , m_isTransformAnimating(false)
47
    , m_isOpacityAnimating(false)
48
#endif
45
    , m_boxShadow(0)
49
    , m_boxShadow(0)
46
    , m_animations(0)
50
    , m_animations(0)
47
    , m_transitions(0)
51
    , m_transitions(0)
Lines 69-74 StyleRareNonInheritedData::StyleRareNonInheritedData(const StyleRareNonInherited a/WebCore/rendering/style/StyleRareNonInheritedData.cpp_sec2
69
    , matchNearestMailBlockquoteColor(o.matchNearestMailBlockquoteColor)
73
    , matchNearestMailBlockquoteColor(o.matchNearestMailBlockquoteColor)
70
    , m_appearance(o.m_appearance)
74
    , m_appearance(o.m_appearance)
71
    , m_borderFit(o.m_borderFit)
75
    , m_borderFit(o.m_borderFit)
76
#if USE(ACCELERATED_COMPOSITING)
77
    , m_isTransformAnimating(o.m_isTransformAnimating)
78
    , m_isOpacityAnimating(o.m_isOpacityAnimating)
79
#endif
72
    , m_boxShadow(o.m_boxShadow ? new ShadowData(*o.m_boxShadow) : 0)
80
    , m_boxShadow(o.m_boxShadow ? new ShadowData(*o.m_boxShadow) : 0)
73
    , m_boxReflect(o.m_boxReflect)
81
    , m_boxReflect(o.m_boxReflect)
74
    , m_animations(o.m_animations ? new AnimationList(*o.m_animations) : 0)
82
    , m_animations(o.m_animations ? new AnimationList(*o.m_animations) : 0)
Lines 104-113 bool StyleRareNonInheritedData::operator==(const StyleRareNonInheritedData& o) c a/WebCore/rendering/style/StyleRareNonInheritedData.cpp_sec3
104
        && m_dashboardRegions == o.m_dashboardRegions
112
        && m_dashboardRegions == o.m_dashboardRegions
105
#endif
113
#endif
106
        && opacity == o.opacity
114
        && opacity == o.opacity
115
#if USE(ACCELERATED_COMPOSITING)
116
        && !m_isOpacityAnimating && !o.m_isOpacityAnimating
117
#endif
107
        && flexibleBox == o.flexibleBox
118
        && flexibleBox == o.flexibleBox
108
        && marquee == o.marquee
119
        && marquee == o.marquee
109
        && m_multiCol == o.m_multiCol
120
        && m_multiCol == o.m_multiCol
110
        && m_transform == o.m_transform
121
        && m_transform == o.m_transform
122
#if USE(ACCELERATED_COMPOSITING)
123
        && !m_isTransformAnimating && !o.m_isTransformAnimating
124
#endif
111
        && contentDataEquivalent(o)
125
        && contentDataEquivalent(o)
112
        && m_counterDirectives == o.m_counterDirectives
126
        && m_counterDirectives == o.m_counterDirectives
113
        && userDrag == o.userDrag
127
        && userDrag == o.userDrag
- a/WebCore/rendering/style/StyleRareNonInheritedData.h +5 lines
Lines 97-102 public: a/WebCore/rendering/style/StyleRareNonInheritedData.h_sec1
97
    unsigned matchNearestMailBlockquoteColor : 1; // EMatchNearestMailBlockquoteColor, FIXME: This property needs to be eliminated. It should never have been added.
97
    unsigned matchNearestMailBlockquoteColor : 1; // EMatchNearestMailBlockquoteColor, FIXME: This property needs to be eliminated. It should never have been added.
98
    unsigned m_appearance : 6; // EAppearance
98
    unsigned m_appearance : 6; // EAppearance
99
    unsigned m_borderFit : 1; // EBorderFit
99
    unsigned m_borderFit : 1; // EBorderFit
100
#if USE(ACCELERATED_COMPOSITING)
101
    // When set, these ensure that styles compare as different. Used to detect style changes during accelerated animations.
102
    bool m_isTransformAnimating : 1;
103
    bool m_isOpacityAnimating : 1;
104
#endif    
100
    OwnPtr<ShadowData> m_boxShadow;  // For box-shadow decorations.
105
    OwnPtr<ShadowData> m_boxShadow;  // For box-shadow decorations.
101
    
106
    
102
    RefPtr<StyleReflection> m_boxReflect;
107
    RefPtr<StyleReflection> m_boxReflect;

Return to Bug 23862