OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org) | 2 * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org) |
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. | 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
9 * | 9 * |
10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 * Library General Public License for more details. | 13 * Library General Public License for more details. |
14 * | 14 * |
15 * You should have received a copy of the GNU Library General Public License | 15 * You should have received a copy of the GNU Library General Public License |
16 * along with this library; see the file COPYING.LIB. If not, write to | 16 * along with this library; see the file COPYING.LIB. If not, write to |
17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
18 * Boston, MA 02110-1301, USA. | 18 * Boston, MA 02110-1301, USA. |
19 * | 19 * |
20 */ | 20 */ |
21 | 21 |
22 #include "config.h" | 22 #include "config.h" |
23 #include "StyleRareNonInheritedData.h" | 23 #include "StyleRareNonInheritedData.h" |
24 | 24 |
25 #include "CSSStyleSelector.h" | 25 #include "CSSStyleSelector.h" |
| 26 #include "ContentData.h" |
| 27 #include "RenderCounter.h" |
26 #include "RenderStyle.h" | 28 #include "RenderStyle.h" |
| 29 #include "StyleImage.h" |
27 | 30 |
28 namespace WebCore { | 31 namespace WebCore { |
29 | 32 |
30 StyleRareNonInheritedData::StyleRareNonInheritedData() | 33 StyleRareNonInheritedData::StyleRareNonInheritedData() |
31 : lineClamp(RenderStyle::initialLineClamp()) | 34 : lineClamp(RenderStyle::initialLineClamp()) |
32 , opacity(RenderStyle::initialOpacity()) | 35 , opacity(RenderStyle::initialOpacity()) |
33 , m_content(0) | 36 , m_content(0) |
34 , m_counterDirectives(0) | 37 , m_counterDirectives(0) |
35 , userDrag(RenderStyle::initialUserDrag()) | 38 , userDrag(RenderStyle::initialUserDrag()) |
36 , textOverflow(RenderStyle::initialTextOverflow()) | 39 , textOverflow(RenderStyle::initialTextOverflow()) |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 { | 101 { |
99 return lineClamp == o.lineClamp | 102 return lineClamp == o.lineClamp |
100 #if ENABLE(DASHBOARD_SUPPORT) | 103 #if ENABLE(DASHBOARD_SUPPORT) |
101 && m_dashboardRegions == o.m_dashboardRegions | 104 && m_dashboardRegions == o.m_dashboardRegions |
102 #endif | 105 #endif |
103 && opacity == o.opacity | 106 && opacity == o.opacity |
104 && flexibleBox == o.flexibleBox | 107 && flexibleBox == o.flexibleBox |
105 && marquee == o.marquee | 108 && marquee == o.marquee |
106 && m_multiCol == o.m_multiCol | 109 && m_multiCol == o.m_multiCol |
107 && m_transform == o.m_transform | 110 && m_transform == o.m_transform |
108 && m_content == o.m_content | 111 && contentDataEquivalent(o) |
109 && m_counterDirectives == o.m_counterDirectives | 112 && m_counterDirectives == o.m_counterDirectives |
110 && userDrag == o.userDrag | 113 && userDrag == o.userDrag |
111 && textOverflow == o.textOverflow | 114 && textOverflow == o.textOverflow |
112 && marginTopCollapse == o.marginTopCollapse | 115 && marginTopCollapse == o.marginTopCollapse |
113 && marginBottomCollapse == o.marginBottomCollapse | 116 && marginBottomCollapse == o.marginBottomCollapse |
114 && matchNearestMailBlockquoteColor == o.matchNearestMailBlockquoteColor | 117 && matchNearestMailBlockquoteColor == o.matchNearestMailBlockquoteColor |
115 && m_appearance == o.m_appearance | 118 && m_appearance == o.m_appearance |
116 && m_borderFit == o.m_borderFit | 119 && m_borderFit == o.m_borderFit |
117 && shadowDataEquivalent(o) | 120 && shadowDataEquivalent(o) |
118 && reflectionDataEquivalent(o) | 121 && reflectionDataEquivalent(o) |
119 && animationDataEquivalent(o) | 122 && animationDataEquivalent(o) |
120 && transitionDataEquivalent(o) | 123 && transitionDataEquivalent(o) |
121 && m_mask == o.m_mask | 124 && m_mask == o.m_mask |
122 && m_maskBoxImage == o.m_maskBoxImage | 125 && m_maskBoxImage == o.m_maskBoxImage |
123 #if ENABLE(XBL) | 126 #if ENABLE(XBL) |
124 && bindingsEquivalent(o) | 127 && bindingsEquivalent(o) |
125 #endif | 128 #endif |
126 ; | 129 ; |
127 } | 130 } |
128 | 131 |
| 132 bool StyleRareNonInheritedData::contentDataEquivalent(const StyleRareNonInherite
dData& o) const |
| 133 { |
| 134 ContentData* c1 = m_content.get(); |
| 135 ContentData* c2 = o.m_content.get(); |
| 136 |
| 137 while (c1 && c2) { |
| 138 if (c1->m_type != c2->m_type) |
| 139 return false; |
| 140 |
| 141 switch (c1->m_type) { |
| 142 case CONTENT_NONE: |
| 143 break; |
| 144 case CONTENT_TEXT: |
| 145 if (!equal(c1->m_content.m_text, c2->m_content.m_text)) |
| 146 return false; |
| 147 break; |
| 148 case CONTENT_OBJECT: |
| 149 if (!StyleImage::imagesEquivalent(c1->m_content.m_image, c2->m_c
ontent.m_image)) |
| 150 return false; |
| 151 break; |
| 152 case CONTENT_COUNTER: |
| 153 if (*c1->m_content.m_counter != *c2->m_content.m_counter) |
| 154 return false; |
| 155 break; |
| 156 } |
| 157 |
| 158 c1 = c1->m_next; |
| 159 c2 = c2->m_next; |
| 160 } |
| 161 |
| 162 return !c1 && !c2; |
| 163 } |
| 164 |
129 bool StyleRareNonInheritedData::shadowDataEquivalent(const StyleRareNonInherited
Data& o) const | 165 bool StyleRareNonInheritedData::shadowDataEquivalent(const StyleRareNonInherited
Data& o) const |
130 { | 166 { |
131 if (!m_boxShadow && o.m_boxShadow || m_boxShadow && !o.m_boxShadow) | 167 if (!m_boxShadow && o.m_boxShadow || m_boxShadow && !o.m_boxShadow) |
132 return false; | 168 return false; |
133 if (m_boxShadow && o.m_boxShadow && (*m_boxShadow != *o.m_boxShadow)) | 169 if (m_boxShadow && o.m_boxShadow && (*m_boxShadow != *o.m_boxShadow)) |
134 return false; | 170 return false; |
135 return true; | 171 return true; |
136 } | 172 } |
137 | 173 |
138 bool StyleRareNonInheritedData::reflectionDataEquivalent(const StyleRareNonInher
itedData& o) const | 174 bool StyleRareNonInheritedData::reflectionDataEquivalent(const StyleRareNonInher
itedData& o) const |
(...skipping 19 matching lines...) Expand all Loading... |
158 bool StyleRareNonInheritedData::transitionDataEquivalent(const StyleRareNonInher
itedData& o) const | 194 bool StyleRareNonInheritedData::transitionDataEquivalent(const StyleRareNonInher
itedData& o) const |
159 { | 195 { |
160 if (!m_transitions && o.m_transitions || m_transitions && !o.m_transitions) | 196 if (!m_transitions && o.m_transitions || m_transitions && !o.m_transitions) |
161 return false; | 197 return false; |
162 if (m_transitions && o.m_transitions && (*m_transitions != *o.m_transitions)
) | 198 if (m_transitions && o.m_transitions && (*m_transitions != *o.m_transitions)
) |
163 return false; | 199 return false; |
164 return true; | 200 return true; |
165 } | 201 } |
166 | 202 |
167 } // namespace WebCore | 203 } // namespace WebCore |
OLD | NEW |