~oif-team/ubuntu/natty/qt4-x11/xi2.1

« back to all changes in this revision

Viewing changes to src/3rdparty/webkit/WebCore/rendering/style/StyleRareNonInheritedData.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Alessandro Ghersi
  • Date: 2009-11-02 18:30:08 UTC
  • mfrom: (1.2.2 upstream)
  • mto: (15.2.5 experimental)
  • mto: This revision was merged to the branch mainline in revision 88.
  • Revision ID: james.westby@ubuntu.com-20091102183008-b6a4gcs128mvfb3m
Tags: upstream-4.6.0~beta1
ImportĀ upstreamĀ versionĀ 4.6.0~beta1

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
#include "StyleRareNonInheritedData.h"
24
24
 
25
25
#include "CSSStyleSelector.h"
 
26
#include "ContentData.h"
 
27
#include "RenderCounter.h"
26
28
#include "RenderStyle.h"
 
29
#include "StyleImage.h"
27
30
 
28
31
namespace WebCore {
29
32
 
39
42
    , matchNearestMailBlockquoteColor(RenderStyle::initialMatchNearestMailBlockquoteColor())
40
43
    , m_appearance(RenderStyle::initialAppearance())
41
44
    , m_borderFit(RenderStyle::initialBorderFit())
 
45
#if USE(ACCELERATED_COMPOSITING)
 
46
    , m_runningAcceleratedAnimation(false)
 
47
#endif
42
48
    , m_boxShadow(0)
43
49
    , m_animations(0)
44
50
    , m_transitions(0)
45
51
    , m_mask(FillLayer(MaskFillLayer))
 
52
    , m_transformStyle3D(RenderStyle::initialTransformStyle3D())
 
53
    , m_backfaceVisibility(RenderStyle::initialBackfaceVisibility())
 
54
    , m_perspective(RenderStyle::initialPerspective())
 
55
    , m_perspectiveOriginX(RenderStyle::initialPerspectiveOriginX())
 
56
    , m_perspectiveOriginY(RenderStyle::initialPerspectiveOriginY())
46
57
#if ENABLE(XBL)
47
58
    , bindingURI(0)
48
59
#endif
66
77
    , matchNearestMailBlockquoteColor(o.matchNearestMailBlockquoteColor)
67
78
    , m_appearance(o.m_appearance)
68
79
    , m_borderFit(o.m_borderFit)
 
80
#if USE(ACCELERATED_COMPOSITING)
 
81
    , m_runningAcceleratedAnimation(o.m_runningAcceleratedAnimation)
 
82
#endif
69
83
    , m_boxShadow(o.m_boxShadow ? new ShadowData(*o.m_boxShadow) : 0)
70
84
    , m_boxReflect(o.m_boxReflect)
71
85
    , m_animations(o.m_animations ? new AnimationList(*o.m_animations) : 0)
72
86
    , m_transitions(o.m_transitions ? new AnimationList(*o.m_transitions) : 0)
73
87
    , m_mask(o.m_mask)
74
88
    , m_maskBoxImage(o.m_maskBoxImage)
 
89
    , m_transformStyle3D(o.m_transformStyle3D)
 
90
    , m_backfaceVisibility(o.m_backfaceVisibility)
 
91
    , m_perspective(o.m_perspective)
 
92
    , m_perspectiveOriginX(o.m_perspectiveOriginX)
 
93
    , m_perspectiveOriginY(o.m_perspectiveOriginY)
75
94
#if ENABLE(XBL)
76
95
    , bindingURI(o.bindingURI ? o.bindingURI->copy() : 0)
77
96
#endif
105
124
        && marquee == o.marquee
106
125
        && m_multiCol == o.m_multiCol
107
126
        && m_transform == o.m_transform
108
 
        && m_content == o.m_content
 
127
        && contentDataEquivalent(o)
109
128
        && m_counterDirectives == o.m_counterDirectives
110
129
        && userDrag == o.userDrag
111
130
        && textOverflow == o.textOverflow
114
133
        && matchNearestMailBlockquoteColor == o.matchNearestMailBlockquoteColor
115
134
        && m_appearance == o.m_appearance
116
135
        && m_borderFit == o.m_borderFit
 
136
#if USE(ACCELERATED_COMPOSITING)
 
137
        && !m_runningAcceleratedAnimation && !o.m_runningAcceleratedAnimation
 
138
#endif
117
139
        && shadowDataEquivalent(o)
118
140
        && reflectionDataEquivalent(o)
119
141
        && animationDataEquivalent(o)
123
145
#if ENABLE(XBL)
124
146
        && bindingsEquivalent(o)
125
147
#endif
 
148
        && (m_transformStyle3D == o.m_transformStyle3D)
 
149
        && (m_backfaceVisibility == o.m_backfaceVisibility)
 
150
        && (m_perspective == o.m_perspective)
 
151
        && (m_perspectiveOriginX == o.m_perspectiveOriginX)
 
152
        && (m_perspectiveOriginY == o.m_perspectiveOriginY)
126
153
        ;
127
154
}
128
155
 
 
156
bool StyleRareNonInheritedData::contentDataEquivalent(const StyleRareNonInheritedData& o) const
 
157
{
 
158
    ContentData* c1 = m_content.get();
 
159
    ContentData* c2 = o.m_content.get();
 
160
 
 
161
    while (c1 && c2) {
 
162
        if (!c1->dataEquivalent(*c2))
 
163
            return false;
 
164
        c1 = c1->next();
 
165
        c2 = c2->next();
 
166
    }
 
167
 
 
168
    return !c1 && !c2;
 
169
}
 
170
 
129
171
bool StyleRareNonInheritedData::shadowDataEquivalent(const StyleRareNonInheritedData& o) const
130
172
{
131
 
    if (!m_boxShadow && o.m_boxShadow || m_boxShadow && !o.m_boxShadow)
 
173
    if ((!m_boxShadow && o.m_boxShadow) || (m_boxShadow && !o.m_boxShadow))
132
174
        return false;
133
175
    if (m_boxShadow && o.m_boxShadow && (*m_boxShadow != *o.m_boxShadow))
134
176
        return false;
148
190
 
149
191
bool StyleRareNonInheritedData::animationDataEquivalent(const StyleRareNonInheritedData& o) const
150
192
{
151
 
    if (!m_animations && o.m_animations || m_animations && !o.m_animations)
 
193
    if ((!m_animations && o.m_animations) || (m_animations && !o.m_animations))
152
194
        return false;
153
195
    if (m_animations && o.m_animations && (*m_animations != *o.m_animations))
154
196
        return false;
157
199
 
158
200
bool StyleRareNonInheritedData::transitionDataEquivalent(const StyleRareNonInheritedData& o) const
159
201
{
160
 
    if (!m_transitions && o.m_transitions || m_transitions && !o.m_transitions)
 
202
    if ((!m_transitions && o.m_transitions) || (m_transitions && !o.m_transitions))
161
203
        return false;
162
204
    if (m_transitions && o.m_transitions && (*m_transitions != *o.m_transitions))
163
205
        return false;