| 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 | 5 * Copyright (C) 2003, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All |
| 6 * rights reserved. | 6 * rights reserved. |
| 7 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) | 7 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) |
| 8 * | 8 * |
| 9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
| 10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 } m_inheritedData; | 217 } m_inheritedData; |
| 218 | 218 |
| 219 // don't inherit | 219 // don't inherit |
| 220 struct NonInheritedData { | 220 struct NonInheritedData { |
| 221 // Compare computed styles, differences in inherited bits or other flags | 221 // Compare computed styles, differences in inherited bits or other flags |
| 222 // should not cause an inequality. | 222 // should not cause an inequality. |
| 223 bool operator==(const NonInheritedData& other) const { | 223 bool operator==(const NonInheritedData& other) const { |
| 224 // Generated properties are compared in ComputedStyleBase | 224 // Generated properties are compared in ComputedStyleBase |
| 225 return m_effectiveDisplay == other.m_effectiveDisplay && | 225 return m_effectiveDisplay == other.m_effectiveDisplay && |
| 226 m_originalDisplay == other.m_originalDisplay && | 226 m_originalDisplay == other.m_originalDisplay && |
| 227 m_overflowX == other.m_overflowX && | |
| 228 m_overflowY == other.m_overflowY && | |
| 229 m_verticalAlign == other.m_verticalAlign && | 227 m_verticalAlign == other.m_verticalAlign && |
| 230 m_position == other.m_position && | 228 m_position == other.m_position && |
| 231 // hasViewportUnits | 229 // hasViewportUnits |
| 232 m_breakBefore == other.m_breakBefore && | 230 m_breakBefore == other.m_breakBefore && |
| 233 m_breakAfter == other.m_breakAfter && | 231 m_breakAfter == other.m_breakAfter && |
| 234 m_breakInside == other.m_breakInside; | 232 m_breakInside == other.m_breakInside; |
| 235 // styleType | 233 // styleType |
| 236 // pseudoBits | 234 // pseudoBits |
| 237 // explicitInheritance | 235 // explicitInheritance |
| 238 // unique | 236 // unique |
| 239 // emptyState | 237 // emptyState |
| 240 // affectedByFocus | 238 // affectedByFocus |
| 241 // affectedByHover | 239 // affectedByHover |
| 242 // affectedByActive | 240 // affectedByActive |
| 243 // affectedByDrag | 241 // affectedByDrag |
| 244 // isLink | 242 // isLink |
| 245 // isInherited flags | 243 // isInherited flags |
| 246 } | 244 } |
| 247 | 245 |
| 248 bool operator!=(const NonInheritedData& other) const { | 246 bool operator!=(const NonInheritedData& other) const { |
| 249 return !(*this == other); | 247 return !(*this == other); |
| 250 } | 248 } |
| 251 | 249 |
| 252 unsigned m_effectiveDisplay : 5; // EDisplay | 250 unsigned m_effectiveDisplay : 5; // EDisplay |
| 253 unsigned m_originalDisplay : 5; // EDisplay | 251 unsigned m_originalDisplay : 5; // EDisplay |
| 254 unsigned m_overflowX : 3; // EOverflow | |
| 255 unsigned m_overflowY : 3; // EOverflow | |
| 256 unsigned m_verticalAlign : 4; // EVerticalAlign | 252 unsigned m_verticalAlign : 4; // EVerticalAlign |
| 257 unsigned m_position : 3; // EPosition | 253 unsigned m_position : 3; // EPosition |
| 258 | 254 |
| 259 // This is set if we used viewport units when resolving a length. | 255 // This is set if we used viewport units when resolving a length. |
| 260 // It is mutable so we can pass around const ComputedStyles to resolve | 256 // It is mutable so we can pass around const ComputedStyles to resolve |
| 261 // lengths. | 257 // lengths. |
| 262 mutable unsigned m_hasViewportUnits : 1; | 258 mutable unsigned m_hasViewportUnits : 1; |
| 263 | 259 |
| 264 // 32 bits | 260 // 32 bits |
| 265 | 261 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 // Generated properties are updated in ComputedStyleBase | 294 // Generated properties are updated in ComputedStyleBase |
| 299 ComputedStyleBase::setBitDefaults(); | 295 ComputedStyleBase::setBitDefaults(); |
| 300 m_inheritedData.m_hasSimpleUnderline = false; | 296 m_inheritedData.m_hasSimpleUnderline = false; |
| 301 m_inheritedData.m_cursorStyle = static_cast<unsigned>(initialCursor()); | 297 m_inheritedData.m_cursorStyle = static_cast<unsigned>(initialCursor()); |
| 302 m_inheritedData.m_insideLink = | 298 m_inheritedData.m_insideLink = |
| 303 static_cast<unsigned>(EInsideLink::kNotInsideLink); | 299 static_cast<unsigned>(EInsideLink::kNotInsideLink); |
| 304 | 300 |
| 305 m_nonInheritedData.m_effectiveDisplay = | 301 m_nonInheritedData.m_effectiveDisplay = |
| 306 m_nonInheritedData.m_originalDisplay = | 302 m_nonInheritedData.m_originalDisplay = |
| 307 static_cast<unsigned>(initialDisplay()); | 303 static_cast<unsigned>(initialDisplay()); |
| 308 m_nonInheritedData.m_overflowX = static_cast<unsigned>(initialOverflowX()); | |
| 309 m_nonInheritedData.m_overflowY = static_cast<unsigned>(initialOverflowY()); | |
| 310 m_nonInheritedData.m_verticalAlign = | 304 m_nonInheritedData.m_verticalAlign = |
| 311 static_cast<unsigned>(initialVerticalAlign()); | 305 static_cast<unsigned>(initialVerticalAlign()); |
| 312 m_nonInheritedData.m_position = initialPosition(); | 306 m_nonInheritedData.m_position = initialPosition(); |
| 313 m_nonInheritedData.m_breakBefore = initialBreakBefore(); | 307 m_nonInheritedData.m_breakBefore = initialBreakBefore(); |
| 314 m_nonInheritedData.m_breakAfter = initialBreakAfter(); | 308 m_nonInheritedData.m_breakAfter = initialBreakAfter(); |
| 315 m_nonInheritedData.m_breakInside = initialBreakInside(); | 309 m_nonInheritedData.m_breakInside = initialBreakInside(); |
| 316 m_nonInheritedData.m_styleType = PseudoIdNone; | 310 m_nonInheritedData.m_styleType = PseudoIdNone; |
| 317 m_nonInheritedData.m_pseudoBits = 0; | 311 m_nonInheritedData.m_pseudoBits = 0; |
| 318 m_nonInheritedData.m_explicitInheritance = false; | 312 m_nonInheritedData.m_explicitInheritance = false; |
| 319 m_nonInheritedData.m_variableReference = false; | 313 m_nonInheritedData.m_variableReference = false; |
| (...skipping 1136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1456 static int initialOutlineOffset() { return 0; } | 1450 static int initialOutlineOffset() { return 0; } |
| 1457 int outlineOffset() const { | 1451 int outlineOffset() const { |
| 1458 if (m_rareNonInheritedData->m_outline.style() == BorderStyleNone) | 1452 if (m_rareNonInheritedData->m_outline.style() == BorderStyleNone) |
| 1459 return 0; | 1453 return 0; |
| 1460 return m_rareNonInheritedData->m_outline.offset(); | 1454 return m_rareNonInheritedData->m_outline.offset(); |
| 1461 } | 1455 } |
| 1462 void setOutlineOffset(int v) { | 1456 void setOutlineOffset(int v) { |
| 1463 SET_VAR(m_rareNonInheritedData, m_outline.m_offset, v); | 1457 SET_VAR(m_rareNonInheritedData, m_outline.m_offset, v); |
| 1464 } | 1458 } |
| 1465 | 1459 |
| 1466 // overflow-x | |
| 1467 static EOverflow initialOverflowX() { return EOverflow::kVisible; } | |
| 1468 EOverflow overflowX() const { | |
| 1469 return static_cast<EOverflow>(m_nonInheritedData.m_overflowX); | |
| 1470 } | |
| 1471 void setOverflowX(EOverflow v) { | |
| 1472 m_nonInheritedData.m_overflowX = static_cast<unsigned>(v); | |
| 1473 } | |
| 1474 | |
| 1475 // overflow-y | |
| 1476 static EOverflow initialOverflowY() { return EOverflow::kVisible; } | |
| 1477 EOverflow overflowY() const { | |
| 1478 return static_cast<EOverflow>(m_nonInheritedData.m_overflowY); | |
| 1479 } | |
| 1480 void setOverflowY(EOverflow v) { | |
| 1481 m_nonInheritedData.m_overflowY = static_cast<unsigned>(v); | |
| 1482 } | |
| 1483 | |
| 1484 // Padding properties. | 1460 // Padding properties. |
| 1485 static Length initialPadding() { return Length(Fixed); } | 1461 static Length initialPadding() { return Length(Fixed); } |
| 1486 | 1462 |
| 1487 // padding-bottom | 1463 // padding-bottom |
| 1488 const Length& paddingBottom() const { return m_surround->padding.bottom(); } | 1464 const Length& paddingBottom() const { return m_surround->padding.bottom(); } |
| 1489 void setPaddingBottom(const Length& v) { | 1465 void setPaddingBottom(const Length& v) { |
| 1490 SET_VAR(m_surround, padding.m_bottom, v); | 1466 SET_VAR(m_surround, padding.m_bottom, v); |
| 1491 } | 1467 } |
| 1492 | 1468 |
| 1493 // padding-left | 1469 // padding-left |
| (...skipping 2422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3916 m_nonInheritedData.m_pseudoBits |= 1 << (pseudo - 1); | 3892 m_nonInheritedData.m_pseudoBits |= 1 << (pseudo - 1); |
| 3917 } | 3893 } |
| 3918 | 3894 |
| 3919 inline bool ComputedStyle::hasPseudoElementStyle() const { | 3895 inline bool ComputedStyle::hasPseudoElementStyle() const { |
| 3920 return m_nonInheritedData.m_pseudoBits & ElementPseudoIdMask; | 3896 return m_nonInheritedData.m_pseudoBits & ElementPseudoIdMask; |
| 3921 } | 3897 } |
| 3922 | 3898 |
| 3923 } // namespace blink | 3899 } // namespace blink |
| 3924 | 3900 |
| 3925 #endif // ComputedStyle_h | 3901 #endif // ComputedStyle_h |
| OLD | NEW |