OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) |
3 * (C) 2000 Antti Koivisto (koivisto@kde.org) | 3 * (C) 2000 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2000 Dirk Mueller (mueller@kde.org) | 4 * (C) 2000 Dirk Mueller (mueller@kde.org) |
5 * Copyright (C) 2003, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ights reserved. | 5 * Copyright (C) 2003, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ights reserved. |
6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) | 6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 std::unique_ptr<PseudoStyleCache> m_cachedPseudoStyles; | 157 std::unique_ptr<PseudoStyleCache> m_cachedPseudoStyles; |
158 | 158 |
159 DataRef<SVGComputedStyle> m_svgStyle; | 159 DataRef<SVGComputedStyle> m_svgStyle; |
160 | 160 |
161 // !START SYNC!: Keep this in sync with the copy constructor in ComputedStyle.cp
p and implicitlyInherited() in StyleResolver.cpp | 161 // !START SYNC!: Keep this in sync with the copy constructor in ComputedStyle.cp
p and implicitlyInherited() in StyleResolver.cpp |
162 | 162 |
163 // inherit | 163 // inherit |
164 struct InheritedData { | 164 struct InheritedData { |
165 bool operator==(const InheritedData& other) const | 165 bool operator==(const InheritedData& other) const |
166 { | 166 { |
| 167 return compareEqualIndependent(other) |
| 168 && compareEqualNonIndependent(other); |
| 169 } |
| 170 |
| 171 bool operator!=(const InheritedData& other) const { return !(*this == ot
her); } |
| 172 |
| 173 inline bool compareEqualIndependent(const InheritedData& other) const |
| 174 { |
| 175 // These must match the properties tagged 'independent' in |
| 176 // CSSProperties.in. |
| 177 // TODO(sashab): Generate this function. |
| 178 return (m_visibility == other.m_visibility) |
| 179 && (m_pointerEvents == other.m_pointerEvents); |
| 180 } |
| 181 |
| 182 inline bool compareEqualNonIndependent(const InheritedData& other) const |
| 183 { |
167 return (m_emptyCells == other.m_emptyCells) | 184 return (m_emptyCells == other.m_emptyCells) |
168 && (m_captionSide == other.m_captionSide) | 185 && (m_captionSide == other.m_captionSide) |
169 && (m_listStyleType == other.m_listStyleType) | 186 && (m_listStyleType == other.m_listStyleType) |
170 && (m_listStylePosition == other.m_listStylePosition) | 187 && (m_listStylePosition == other.m_listStylePosition) |
171 && (m_visibility == other.m_visibility) | |
172 && (m_textAlign == other.m_textAlign) | 188 && (m_textAlign == other.m_textAlign) |
173 && (m_textTransform == other.m_textTransform) | 189 && (m_textTransform == other.m_textTransform) |
174 && (m_textUnderline == other.m_textUnderline) | 190 && (m_textUnderline == other.m_textUnderline) |
175 && (m_cursorStyle == other.m_cursorStyle) | 191 && (m_cursorStyle == other.m_cursorStyle) |
176 && (m_direction == other.m_direction) | 192 && (m_direction == other.m_direction) |
177 && (m_whiteSpace == other.m_whiteSpace) | 193 && (m_whiteSpace == other.m_whiteSpace) |
178 && (m_borderCollapse == other.m_borderCollapse) | 194 && (m_borderCollapse == other.m_borderCollapse) |
179 && (m_boxDirection == other.m_boxDirection) | 195 && (m_boxDirection == other.m_boxDirection) |
180 && (m_rtlOrdering == other.m_rtlOrdering) | 196 && (m_rtlOrdering == other.m_rtlOrdering) |
181 && (m_printColorAdjust == other.m_printColorAdjust) | 197 && (m_printColorAdjust == other.m_printColorAdjust) |
182 && (m_pointerEvents == other.m_pointerEvents) | |
183 && (m_insideLink == other.m_insideLink) | 198 && (m_insideLink == other.m_insideLink) |
184 && (m_writingMode == other.m_writingMode); | 199 && (m_writingMode == other.m_writingMode); |
185 } | 200 } |
186 | 201 |
187 bool operator!=(const InheritedData& other) const { return !(*this == ot
her); } | |
188 | |
189 unsigned m_emptyCells : 1; // EEmptyCells | 202 unsigned m_emptyCells : 1; // EEmptyCells |
190 unsigned m_captionSide : 2; // ECaptionSide | 203 unsigned m_captionSide : 2; // ECaptionSide |
191 unsigned m_listStyleType : 7; // EListStyleType | 204 unsigned m_listStyleType : 7; // EListStyleType |
192 unsigned m_listStylePosition : 1; // EListStylePosition | 205 unsigned m_listStylePosition : 1; // EListStylePosition |
193 unsigned m_visibility : 2; // EVisibility | 206 unsigned m_visibility : 2; // EVisibility |
194 unsigned m_textAlign : 4; // ETextAlign | 207 unsigned m_textAlign : 4; // ETextAlign |
195 unsigned m_textTransform : 2; // ETextTransform | 208 unsigned m_textTransform : 2; // ETextTransform |
196 unsigned m_textUnderline : 1; | 209 unsigned m_textUnderline : 1; |
197 unsigned m_cursorStyle : 6; // ECursor | 210 unsigned m_cursorStyle : 6; // ECursor |
198 unsigned m_direction : 1; // TextDirection | 211 unsigned m_direction : 1; // TextDirection |
199 unsigned m_whiteSpace : 3; // EWhiteSpace | 212 unsigned m_whiteSpace : 3; // EWhiteSpace |
200 unsigned m_borderCollapse : 1; // EBorderCollapse | 213 unsigned m_borderCollapse : 1; // EBorderCollapse |
201 unsigned m_boxDirection : 1; // EBoxDirection (CSS3 box_direction proper
ty, flexible box layout module) | 214 unsigned m_boxDirection : 1; // EBoxDirection (CSS3 box_direction proper
ty, flexible box layout module) |
202 // 32 bits | 215 // 32 bits |
203 | 216 |
204 // non CSS2 inherited | 217 // non CSS2 inherited |
205 unsigned m_rtlOrdering : 1; // Order | 218 unsigned m_rtlOrdering : 1; // Order |
206 unsigned m_printColorAdjust : PrintColorAdjustBits; | 219 unsigned m_printColorAdjust : PrintColorAdjustBits; |
207 unsigned m_pointerEvents : 4; // EPointerEvents | 220 unsigned m_pointerEvents : 4; // EPointerEvents |
208 unsigned m_insideLink : 2; // EInsideLink | 221 unsigned m_insideLink : 2; // EInsideLink |
209 | 222 |
210 // CSS Text Layout Module Level 3: Vertical writing support | 223 // CSS Text Layout Module Level 3: Vertical writing support |
211 unsigned m_writingMode : 2; // WritingMode | 224 unsigned m_writingMode : 2; // WritingMode |
212 // 42 bits | 225 // 42 bits |
213 } m_inheritedData; | 226 } m_inheritedData; |
214 | 227 |
215 // don't inherit | 228 // don't inherit |
216 struct NonInheritedData { | 229 struct NonInheritedData { |
217 // Compare computed styles, differences in other flags should not cause
an inequality. | 230 // Compare computed styles, differences in inherited bits or other flags |
| 231 // should not cause an inequality. |
218 bool operator==(const NonInheritedData& other) const | 232 bool operator==(const NonInheritedData& other) const |
219 { | 233 { |
220 return m_effectiveDisplay == other.m_effectiveDisplay | 234 return m_effectiveDisplay == other.m_effectiveDisplay |
221 && m_originalDisplay == other.m_originalDisplay | 235 && m_originalDisplay == other.m_originalDisplay |
222 && m_overflowAnchor == other.m_overflowAnchor | 236 && m_overflowAnchor == other.m_overflowAnchor |
223 && m_overflowX == other.m_overflowX | 237 && m_overflowX == other.m_overflowX |
224 && m_overflowY == other.m_overflowY | 238 && m_overflowY == other.m_overflowY |
225 && m_verticalAlign == other.m_verticalAlign | 239 && m_verticalAlign == other.m_verticalAlign |
226 && m_clear == other.m_clear | 240 && m_clear == other.m_clear |
227 && m_position == other.m_position | 241 && m_position == other.m_position |
228 && m_floating == other.m_floating | 242 && m_floating == other.m_floating |
229 && m_tableLayout == other.m_tableLayout | 243 && m_tableLayout == other.m_tableLayout |
230 && m_unicodeBidi == other.m_unicodeBidi | 244 && m_unicodeBidi == other.m_unicodeBidi |
231 // hasViewportUnits | 245 // hasViewportUnits |
232 && m_breakBefore == other.m_breakBefore | 246 && m_breakBefore == other.m_breakBefore |
233 && m_breakAfter == other.m_breakAfter | 247 && m_breakAfter == other.m_breakAfter |
234 && m_breakInside == other.m_breakInside; | 248 && m_breakInside == other.m_breakInside; |
235 // styleType | 249 // styleType |
236 // pseudoBits | 250 // pseudoBits |
237 // explicitInheritance | 251 // explicitInheritance |
238 // unique | 252 // unique |
239 // emptyState | 253 // emptyState |
240 // affectedByFocus | 254 // affectedByFocus |
241 // affectedByHover | 255 // affectedByHover |
242 // affectedByActive | 256 // affectedByActive |
243 // affectedByDrag | 257 // affectedByDrag |
244 // isLink | 258 // isLink |
| 259 // isInherited flags |
245 } | 260 } |
246 | 261 |
247 bool operator!=(const NonInheritedData& other) const { return !(*this ==
other); } | 262 bool operator!=(const NonInheritedData& other) const { return !(*this ==
other); } |
248 | 263 |
249 unsigned m_effectiveDisplay : 5; // EDisplay | 264 unsigned m_effectiveDisplay : 5; // EDisplay |
250 unsigned m_originalDisplay : 5; // EDisplay | 265 unsigned m_originalDisplay : 5; // EDisplay |
251 unsigned m_overflowAnchor : 2; // EOverflowAnchor | 266 unsigned m_overflowAnchor : 2; // EOverflowAnchor |
252 unsigned m_overflowX : 3; // EOverflow | 267 unsigned m_overflowX : 3; // EOverflow |
253 unsigned m_overflowY : 3; // EOverflow | 268 unsigned m_overflowY : 3; // EOverflow |
254 unsigned m_verticalAlign : 4; // EVerticalAlign | 269 unsigned m_verticalAlign : 4; // EVerticalAlign |
(...skipping 24 matching lines...) Expand all Loading... |
279 unsigned m_affectedByFocus : 1; | 294 unsigned m_affectedByFocus : 1; |
280 unsigned m_affectedByHover : 1; | 295 unsigned m_affectedByHover : 1; |
281 unsigned m_affectedByActive : 1; | 296 unsigned m_affectedByActive : 1; |
282 unsigned m_affectedByDrag : 1; | 297 unsigned m_affectedByDrag : 1; |
283 | 298 |
284 // 64 bits | 299 // 64 bits |
285 | 300 |
286 unsigned m_isLink : 1; | 301 unsigned m_isLink : 1; |
287 | 302 |
288 mutable unsigned m_hasRemUnits : 1; | 303 mutable unsigned m_hasRemUnits : 1; |
| 304 |
| 305 |
| 306 // For each independent inherited property, store a 1 if the stored |
| 307 // value was inherited from its parent, or 0 if it is explicitly set on |
| 308 // this element. |
| 309 // Eventually, all properties will have a bit in here to store whether |
| 310 // they were inherited from their parent or not. |
| 311 // Although two ComputedStyles are equal if their nonInheritedData is |
| 312 // equal regardless of the isInherited flags, this struct is stored next |
| 313 // to the existing flags to take advantage of packing as much as possibl
e. |
| 314 // TODO(sashab): Move these flags closer to inheritedData so that it's |
| 315 // clear which inherited properties have a flag stored and which don't. |
| 316 // Keep this list of fields in sync with: |
| 317 // - setBitDefaults() |
| 318 // - The ComputedStyle setter, which must take an extra boolean paramete
r and set this |
| 319 // - propagateIndependentInheritedProperties() in ComputedStyle.cpp |
| 320 // - The compareEqual() methods in the corresponding class |
| 321 // InheritedFlags |
| 322 unsigned m_isPointerEventsInherited : 1; |
| 323 unsigned m_isVisibilityInherited : 1; |
| 324 |
289 // If you add more style bits here, you will also need to update Compute
dStyle::copyNonInheritedFromCached() | 325 // If you add more style bits here, you will also need to update Compute
dStyle::copyNonInheritedFromCached() |
290 // 66 bits | 326 // 68 bits |
291 } m_nonInheritedData; | 327 } m_nonInheritedData; |
292 | 328 |
293 // !END SYNC! | 329 // !END SYNC! |
294 | 330 |
295 void setBitDefaults() | 331 void setBitDefaults() |
296 { | 332 { |
297 m_inheritedData.m_emptyCells = initialEmptyCells(); | 333 m_inheritedData.m_emptyCells = initialEmptyCells(); |
298 m_inheritedData.m_captionSide = initialCaptionSide(); | 334 m_inheritedData.m_captionSide = initialCaptionSide(); |
299 m_inheritedData.m_listStyleType = initialListStyleType(); | 335 m_inheritedData.m_listStyleType = initialListStyleType(); |
300 m_inheritedData.m_listStylePosition = initialListStylePosition(); | 336 m_inheritedData.m_listStylePosition = initialListStylePosition(); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
332 m_nonInheritedData.m_variableReference = false; | 368 m_nonInheritedData.m_variableReference = false; |
333 m_nonInheritedData.m_unique = false; | 369 m_nonInheritedData.m_unique = false; |
334 m_nonInheritedData.m_emptyState = false; | 370 m_nonInheritedData.m_emptyState = false; |
335 m_nonInheritedData.m_hasViewportUnits = false; | 371 m_nonInheritedData.m_hasViewportUnits = false; |
336 m_nonInheritedData.m_affectedByFocus = false; | 372 m_nonInheritedData.m_affectedByFocus = false; |
337 m_nonInheritedData.m_affectedByHover = false; | 373 m_nonInheritedData.m_affectedByHover = false; |
338 m_nonInheritedData.m_affectedByActive = false; | 374 m_nonInheritedData.m_affectedByActive = false; |
339 m_nonInheritedData.m_affectedByDrag = false; | 375 m_nonInheritedData.m_affectedByDrag = false; |
340 m_nonInheritedData.m_isLink = false; | 376 m_nonInheritedData.m_isLink = false; |
341 m_nonInheritedData.m_hasRemUnits = false; | 377 m_nonInheritedData.m_hasRemUnits = false; |
| 378 |
| 379 // All independently inherited properties default to being inherited. |
| 380 m_nonInheritedData.m_isPointerEventsInherited = true; |
| 381 m_nonInheritedData.m_isVisibilityInherited = true; |
342 } | 382 } |
343 | 383 |
344 private: | 384 private: |
345 // TODO(sashab): Move these to the bottom of ComputedStyle. | 385 // TODO(sashab): Move these to the bottom of ComputedStyle. |
346 ALWAYS_INLINE ComputedStyle(); | 386 ALWAYS_INLINE ComputedStyle(); |
347 | 387 |
348 enum InitialStyleTag { | 388 enum InitialStyleTag { |
349 InitialStyle | 389 InitialStyle |
350 }; | 390 }; |
351 ALWAYS_INLINE explicit ComputedStyle(InitialStyleTag); | 391 ALWAYS_INLINE explicit ComputedStyle(InitialStyleTag); |
(...skipping 10 matching lines...) Expand all Loading... |
362 public: | 402 public: |
363 static PassRefPtr<ComputedStyle> create(); | 403 static PassRefPtr<ComputedStyle> create(); |
364 static PassRefPtr<ComputedStyle> createAnonymousStyleWithDisplay(const Compu
tedStyle& parentStyle, EDisplay); | 404 static PassRefPtr<ComputedStyle> createAnonymousStyleWithDisplay(const Compu
tedStyle& parentStyle, EDisplay); |
365 static PassRefPtr<ComputedStyle> clone(const ComputedStyle&); | 405 static PassRefPtr<ComputedStyle> clone(const ComputedStyle&); |
366 static const ComputedStyle& initialStyle() { return mutableInitialStyle(); } | 406 static const ComputedStyle& initialStyle() { return mutableInitialStyle(); } |
367 static void invalidateInitialStyle(); | 407 static void invalidateInitialStyle(); |
368 | 408 |
369 // Computes how the style change should be propagated down the tree. | 409 // Computes how the style change should be propagated down the tree. |
370 static StyleRecalcChange stylePropagationDiff(const ComputedStyle* oldStyle,
const ComputedStyle* newStyle); | 410 static StyleRecalcChange stylePropagationDiff(const ComputedStyle* oldStyle,
const ComputedStyle* newStyle); |
371 | 411 |
| 412 // Copies the values of any independent inherited properties from the parent |
| 413 // that are not explicitly set in this style. |
| 414 void propagateIndependentInheritedProperties(const ComputedStyle& parentStyl
e); |
| 415 |
372 ContentPosition resolvedJustifyContentPosition(const StyleContentAlignmentDa
ta& normalValueBehavior) const; | 416 ContentPosition resolvedJustifyContentPosition(const StyleContentAlignmentDa
ta& normalValueBehavior) const; |
373 ContentDistributionType resolvedJustifyContentDistribution(const StyleConten
tAlignmentData& normalValueBehavior) const; | 417 ContentDistributionType resolvedJustifyContentDistribution(const StyleConten
tAlignmentData& normalValueBehavior) const; |
374 ContentPosition resolvedAlignContentPosition(const StyleContentAlignmentData
& normalValueBehavior) const; | 418 ContentPosition resolvedAlignContentPosition(const StyleContentAlignmentData
& normalValueBehavior) const; |
375 ContentDistributionType resolvedAlignContentDistribution(const StyleContentA
lignmentData& normalValueBehavior) const; | 419 ContentDistributionType resolvedAlignContentDistribution(const StyleContentA
lignmentData& normalValueBehavior) const; |
376 const StyleSelfAlignmentData resolvedAlignment(const ComputedStyle& parentSt
yle, ItemPosition resolvedAutoPositionForLayoutObject) const; | 420 const StyleSelfAlignmentData resolvedAlignment(const ComputedStyle& parentSt
yle, ItemPosition resolvedAutoPositionForLayoutObject) const; |
377 static ItemPosition resolveAlignment(const ComputedStyle& parentStyle, const
ComputedStyle& childStyle, ItemPosition resolvedAutoPositionForLayoutObject); | 421 static ItemPosition resolveAlignment(const ComputedStyle& parentStyle, const
ComputedStyle& childStyle, ItemPosition resolvedAutoPositionForLayoutObject); |
378 static ItemPosition resolveJustification(const ComputedStyle& parentStyle, c
onst ComputedStyle& childStyle, ItemPosition resolvedAutoPositionForLayoutObject
); | 422 static ItemPosition resolveJustification(const ComputedStyle& parentStyle, c
onst ComputedStyle& childStyle, ItemPosition resolvedAutoPositionForLayoutObject
); |
379 | 423 |
380 StyleDifference visualInvalidationDiff(const ComputedStyle&) const; | 424 StyleDifference visualInvalidationDiff(const ComputedStyle&) const; |
381 | 425 |
(...skipping 1005 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1387 | 1431 |
1388 // overflow-wrap (aka word-wrap) | 1432 // overflow-wrap (aka word-wrap) |
1389 static EOverflowWrap initialOverflowWrap() { return NormalOverflowWrap; } | 1433 static EOverflowWrap initialOverflowWrap() { return NormalOverflowWrap; } |
1390 EOverflowWrap overflowWrap() const { return static_cast<EOverflowWrap>(m_rar
eInheritedData->overflowWrap); } | 1434 EOverflowWrap overflowWrap() const { return static_cast<EOverflowWrap>(m_rar
eInheritedData->overflowWrap); } |
1391 void setOverflowWrap(EOverflowWrap b) { SET_VAR(m_rareInheritedData, overflo
wWrap, b); } | 1435 void setOverflowWrap(EOverflowWrap b) { SET_VAR(m_rareInheritedData, overflo
wWrap, b); } |
1392 | 1436 |
1393 // pointer-events | 1437 // pointer-events |
1394 static EPointerEvents initialPointerEvents() { return PE_AUTO; } | 1438 static EPointerEvents initialPointerEvents() { return PE_AUTO; } |
1395 EPointerEvents pointerEvents() const { return static_cast<EPointerEvents>(m_
inheritedData.m_pointerEvents); } | 1439 EPointerEvents pointerEvents() const { return static_cast<EPointerEvents>(m_
inheritedData.m_pointerEvents); } |
1396 void setPointerEvents(EPointerEvents p) { m_inheritedData.m_pointerEvents =
p; } | 1440 void setPointerEvents(EPointerEvents p) { m_inheritedData.m_pointerEvents =
p; } |
| 1441 void setPointerEventsIsInherited(bool isInherited) { m_nonInheritedData.m_is
PointerEventsInherited = isInherited; } |
1397 | 1442 |
1398 // quotes | 1443 // quotes |
1399 static QuotesData* initialQuotes() { return 0; } | 1444 static QuotesData* initialQuotes() { return 0; } |
1400 QuotesData* quotes() const { return m_rareInheritedData->quotes.get(); } | 1445 QuotesData* quotes() const { return m_rareInheritedData->quotes.get(); } |
1401 void setQuotes(PassRefPtr<QuotesData>); | 1446 void setQuotes(PassRefPtr<QuotesData>); |
1402 | 1447 |
1403 // snap-height | 1448 // snap-height |
1404 uint8_t snapHeightPosition() const { return m_rareInheritedData->m_snapHeigh
tPosition; } | 1449 uint8_t snapHeightPosition() const { return m_rareInheritedData->m_snapHeigh
tPosition; } |
1405 uint8_t snapHeightUnit() const { return m_rareInheritedData->m_snapHeightUni
t; } | 1450 uint8_t snapHeightUnit() const { return m_rareInheritedData->m_snapHeightUni
t; } |
1406 void setSnapHeightPosition(uint8_t position) { SET_VAR(m_rareInheritedData,
m_snapHeightPosition, position); } | 1451 void setSnapHeightPosition(uint8_t position) { SET_VAR(m_rareInheritedData,
m_snapHeightPosition, position); } |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1464 | 1509 |
1465 // text-transform (aka -epub-text-transform) | 1510 // text-transform (aka -epub-text-transform) |
1466 static ETextTransform initialTextTransform() { return TTNONE; } | 1511 static ETextTransform initialTextTransform() { return TTNONE; } |
1467 ETextTransform textTransform() const { return static_cast<ETextTransform>(m_
inheritedData.m_textTransform); } | 1512 ETextTransform textTransform() const { return static_cast<ETextTransform>(m_
inheritedData.m_textTransform); } |
1468 void setTextTransform(ETextTransform v) { m_inheritedData.m_textTransform =
v; } | 1513 void setTextTransform(ETextTransform v) { m_inheritedData.m_textTransform =
v; } |
1469 | 1514 |
1470 // visibility | 1515 // visibility |
1471 static EVisibility initialVisibility() { return VISIBLE; } | 1516 static EVisibility initialVisibility() { return VISIBLE; } |
1472 EVisibility visibility() const { return static_cast<EVisibility>(m_inherited
Data.m_visibility); } | 1517 EVisibility visibility() const { return static_cast<EVisibility>(m_inherited
Data.m_visibility); } |
1473 void setVisibility(EVisibility v) { m_inheritedData.m_visibility = v; } | 1518 void setVisibility(EVisibility v) { m_inheritedData.m_visibility = v; } |
| 1519 void setVisibilityIsInherited(bool isInherited) { m_nonInheritedData.m_isVis
ibilityInherited = isInherited; } |
1474 | 1520 |
1475 // white-space inherited | 1521 // white-space inherited |
1476 static EWhiteSpace initialWhiteSpace() { return NORMAL; } | 1522 static EWhiteSpace initialWhiteSpace() { return NORMAL; } |
1477 EWhiteSpace whiteSpace() const { return static_cast<EWhiteSpace>(m_inherited
Data.m_whiteSpace); } | 1523 EWhiteSpace whiteSpace() const { return static_cast<EWhiteSpace>(m_inherited
Data.m_whiteSpace); } |
1478 void setWhiteSpace(EWhiteSpace v) { m_inheritedData.m_whiteSpace = v; } | 1524 void setWhiteSpace(EWhiteSpace v) { m_inheritedData.m_whiteSpace = v; } |
1479 | 1525 |
1480 // word-break inherited (aka -epub-word-break) | 1526 // word-break inherited (aka -epub-word-break) |
1481 static EWordBreak initialWordBreak() { return NormalWordBreak; } | 1527 static EWordBreak initialWordBreak() { return NormalWordBreak; } |
1482 EWordBreak wordBreak() const { return static_cast<EWordBreak>(m_rareInherite
dData->wordBreak); } | 1528 EWordBreak wordBreak() const { return static_cast<EWordBreak>(m_rareInherite
dData->wordBreak); } |
1483 void setWordBreak(EWordBreak b) { SET_VAR(m_rareInheritedData, wordBreak, b)
; } | 1529 void setWordBreak(EWordBreak b) { SET_VAR(m_rareInheritedData, wordBreak, b)
; } |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1706 // stroke-width | 1752 // stroke-width |
1707 const UnzoomedLength& strokeWidth() const { return svgStyle().strokeWidth();
} | 1753 const UnzoomedLength& strokeWidth() const { return svgStyle().strokeWidth();
} |
1708 void setStrokeWidth(const UnzoomedLength& w) { accessSVGStyle().setStrokeWid
th(w); } | 1754 void setStrokeWidth(const UnzoomedLength& w) { accessSVGStyle().setStrokeWid
th(w); } |
1709 | 1755 |
1710 // Comparison operators | 1756 // Comparison operators |
1711 bool operator==(const ComputedStyle& other) const; | 1757 bool operator==(const ComputedStyle& other) const; |
1712 bool operator!=(const ComputedStyle& other) const { return !(*this == other)
; } | 1758 bool operator!=(const ComputedStyle& other) const { return !(*this == other)
; } |
1713 | 1759 |
1714 bool inheritedEqual(const ComputedStyle&) const; | 1760 bool inheritedEqual(const ComputedStyle&) const; |
1715 bool nonInheritedEqual(const ComputedStyle&) const; | 1761 bool nonInheritedEqual(const ComputedStyle&) const; |
| 1762 inline bool independentInheritedEqual(const ComputedStyle&) const; |
| 1763 inline bool nonIndependentInheritedEqual(const ComputedStyle&) const; |
1716 bool loadingCustomFontsEqual(const ComputedStyle&) const; | 1764 bool loadingCustomFontsEqual(const ComputedStyle&) const; |
1717 bool inheritedDataShared(const ComputedStyle&) const; | 1765 bool inheritedDataShared(const ComputedStyle&) const; |
1718 | 1766 |
1719 bool hasChildDependentFlags() const { return emptyState() || hasExplicitlyIn
heritedProperties(); } | 1767 bool hasChildDependentFlags() const { return emptyState() || hasExplicitlyIn
heritedProperties(); } |
1720 void copyChildDependentFlagsFrom(const ComputedStyle&); | 1768 void copyChildDependentFlagsFrom(const ComputedStyle&); |
1721 | 1769 |
1722 // Counters. | 1770 // Counters. |
1723 const CounterDirectiveMap* counterDirectives() const; | 1771 const CounterDirectiveMap* counterDirectives() const; |
1724 CounterDirectiveMap& accessCounterDirectives(); | 1772 CounterDirectiveMap& accessCounterDirectives(); |
1725 const CounterDirectives getCounterDirectives(const AtomicString& identifier)
const; | 1773 const CounterDirectives getCounterDirectives(const AtomicString& identifier)
const; |
(...skipping 828 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2554 } | 2602 } |
2555 | 2603 |
2556 inline bool ComputedStyle::hasPseudoElementStyle() const | 2604 inline bool ComputedStyle::hasPseudoElementStyle() const |
2557 { | 2605 { |
2558 return m_nonInheritedData.m_pseudoBits & ElementPseudoIdMask; | 2606 return m_nonInheritedData.m_pseudoBits & ElementPseudoIdMask; |
2559 } | 2607 } |
2560 | 2608 |
2561 } // namespace blink | 2609 } // namespace blink |
2562 | 2610 |
2563 #endif // ComputedStyle_h | 2611 #endif // ComputedStyle_h |
OLD | NEW |