| 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 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 unsigned m_insideLink : 2; // EInsideLink | 215 unsigned m_insideLink : 2; // EInsideLink |
| 216 } m_inheritedData; | 216 } m_inheritedData; |
| 217 | 217 |
| 218 // don't inherit | 218 // don't inherit |
| 219 struct NonInheritedData { | 219 struct NonInheritedData { |
| 220 // Compare computed styles, differences in inherited bits or other flags | 220 // Compare computed styles, differences in inherited bits or other flags |
| 221 // should not cause an inequality. | 221 // should not cause an inequality. |
| 222 bool operator==(const NonInheritedData& other) const { | 222 bool operator==(const NonInheritedData& other) const { |
| 223 return m_effectiveDisplay == other.m_effectiveDisplay && | 223 return m_effectiveDisplay == other.m_effectiveDisplay && |
| 224 m_originalDisplay == other.m_originalDisplay && | 224 m_originalDisplay == other.m_originalDisplay && |
| 225 m_overflowAnchor == other.m_overflowAnchor && | |
| 226 m_overflowX == other.m_overflowX && | 225 m_overflowX == other.m_overflowX && |
| 227 m_overflowY == other.m_overflowY && | 226 m_overflowY == other.m_overflowY && |
| 228 m_verticalAlign == other.m_verticalAlign && | 227 m_verticalAlign == other.m_verticalAlign && |
| 229 m_clear == other.m_clear && m_position == other.m_position && | 228 m_clear == other.m_clear && m_position == other.m_position && |
| 230 m_tableLayout == other.m_tableLayout && | 229 m_tableLayout == other.m_tableLayout && |
| 231 // hasViewportUnits | 230 // hasViewportUnits |
| 232 m_breakBefore == other.m_breakBefore && | 231 m_breakBefore == other.m_breakBefore && |
| 233 m_breakAfter == other.m_breakAfter && | 232 m_breakAfter == other.m_breakAfter && |
| 234 m_breakInside == other.m_breakInside; | 233 m_breakInside == other.m_breakInside; |
| 235 // styleType | 234 // styleType |
| 236 // pseudoBits | 235 // pseudoBits |
| 237 // explicitInheritance | 236 // explicitInheritance |
| 238 // unique | 237 // unique |
| 239 // emptyState | 238 // emptyState |
| 240 // affectedByFocus | 239 // affectedByFocus |
| 241 // affectedByHover | 240 // affectedByHover |
| 242 // affectedByActive | 241 // affectedByActive |
| 243 // affectedByDrag | 242 // affectedByDrag |
| 244 // isLink | 243 // isLink |
| 245 // isInherited flags | 244 // isInherited flags |
| 246 } | 245 } |
| 247 | 246 |
| 248 bool operator!=(const NonInheritedData& other) const { | 247 bool operator!=(const NonInheritedData& other) const { |
| 249 return !(*this == other); | 248 return !(*this == other); |
| 250 } | 249 } |
| 251 | 250 |
| 252 unsigned m_effectiveDisplay : 5; // EDisplay | 251 unsigned m_effectiveDisplay : 5; // EDisplay |
| 253 unsigned m_originalDisplay : 5; // EDisplay | 252 unsigned m_originalDisplay : 5; // EDisplay |
| 254 unsigned m_overflowAnchor : 2; // EOverflowAnchor | |
| 255 unsigned m_overflowX : 3; // EOverflow | 253 unsigned m_overflowX : 3; // EOverflow |
| 256 unsigned m_overflowY : 3; // EOverflow | 254 unsigned m_overflowY : 3; // EOverflow |
| 257 unsigned m_verticalAlign : 4; // EVerticalAlign | 255 unsigned m_verticalAlign : 4; // EVerticalAlign |
| 258 unsigned m_clear : 2; // EClear | 256 unsigned m_clear : 2; // EClear |
| 259 unsigned m_position : 3; // EPosition | 257 unsigned m_position : 3; // EPosition |
| 260 unsigned m_tableLayout : 1; // ETableLayout | 258 unsigned m_tableLayout : 1; // ETableLayout |
| 261 | 259 |
| 262 // This is set if we used viewport units when resolving a length. | 260 // This is set if we used viewport units when resolving a length. |
| 263 // It is mutable so we can pass around const ComputedStyles to resolve | 261 // It is mutable so we can pass around const ComputedStyles to resolve |
| 264 // lengths. | 262 // lengths. |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 void setBitDefaults() { | 298 void setBitDefaults() { |
| 301 ComputedStyleBase::setBitDefaults(); | 299 ComputedStyleBase::setBitDefaults(); |
| 302 m_inheritedData.m_hasSimpleUnderline = false; | 300 m_inheritedData.m_hasSimpleUnderline = false; |
| 303 m_inheritedData.m_cursorStyle = static_cast<unsigned>(initialCursor()); | 301 m_inheritedData.m_cursorStyle = static_cast<unsigned>(initialCursor()); |
| 304 m_inheritedData.m_insideLink = | 302 m_inheritedData.m_insideLink = |
| 305 static_cast<unsigned>(EInsideLink::kNotInsideLink); | 303 static_cast<unsigned>(EInsideLink::kNotInsideLink); |
| 306 | 304 |
| 307 m_nonInheritedData.m_effectiveDisplay = | 305 m_nonInheritedData.m_effectiveDisplay = |
| 308 m_nonInheritedData.m_originalDisplay = | 306 m_nonInheritedData.m_originalDisplay = |
| 309 static_cast<unsigned>(initialDisplay()); | 307 static_cast<unsigned>(initialDisplay()); |
| 310 m_nonInheritedData.m_overflowAnchor = | |
| 311 static_cast<unsigned>(initialOverflowAnchor()); | |
| 312 m_nonInheritedData.m_overflowX = static_cast<unsigned>(initialOverflowX()); | 308 m_nonInheritedData.m_overflowX = static_cast<unsigned>(initialOverflowX()); |
| 313 m_nonInheritedData.m_overflowY = static_cast<unsigned>(initialOverflowY()); | 309 m_nonInheritedData.m_overflowY = static_cast<unsigned>(initialOverflowY()); |
| 314 m_nonInheritedData.m_verticalAlign = | 310 m_nonInheritedData.m_verticalAlign = |
| 315 static_cast<unsigned>(initialVerticalAlign()); | 311 static_cast<unsigned>(initialVerticalAlign()); |
| 316 m_nonInheritedData.m_clear = initialClear(); | 312 m_nonInheritedData.m_clear = initialClear(); |
| 317 m_nonInheritedData.m_position = initialPosition(); | 313 m_nonInheritedData.m_position = initialPosition(); |
| 318 m_nonInheritedData.m_tableLayout = initialTableLayout(); | 314 m_nonInheritedData.m_tableLayout = initialTableLayout(); |
| 319 m_nonInheritedData.m_breakBefore = initialBreakBefore(); | 315 m_nonInheritedData.m_breakBefore = initialBreakBefore(); |
| 320 m_nonInheritedData.m_breakAfter = initialBreakAfter(); | 316 m_nonInheritedData.m_breakAfter = initialBreakAfter(); |
| 321 m_nonInheritedData.m_breakInside = initialBreakInside(); | 317 m_nonInheritedData.m_breakInside = initialBreakInside(); |
| (...skipping 1147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1469 static int initialOutlineOffset() { return 0; } | 1465 static int initialOutlineOffset() { return 0; } |
| 1470 int outlineOffset() const { | 1466 int outlineOffset() const { |
| 1471 if (m_rareNonInheritedData->m_outline.style() == BorderStyleNone) | 1467 if (m_rareNonInheritedData->m_outline.style() == BorderStyleNone) |
| 1472 return 0; | 1468 return 0; |
| 1473 return m_rareNonInheritedData->m_outline.offset(); | 1469 return m_rareNonInheritedData->m_outline.offset(); |
| 1474 } | 1470 } |
| 1475 void setOutlineOffset(int v) { | 1471 void setOutlineOffset(int v) { |
| 1476 SET_VAR(m_rareNonInheritedData, m_outline.m_offset, v); | 1472 SET_VAR(m_rareNonInheritedData, m_outline.m_offset, v); |
| 1477 } | 1473 } |
| 1478 | 1474 |
| 1479 // Overflow properties. | |
| 1480 // overflow-anchor | |
| 1481 static EOverflowAnchor initialOverflowAnchor() { | |
| 1482 return EOverflowAnchor::kAuto; | |
| 1483 } | |
| 1484 EOverflowAnchor overflowAnchor() const { | |
| 1485 return static_cast<EOverflowAnchor>(m_nonInheritedData.m_overflowAnchor); | |
| 1486 } | |
| 1487 void setOverflowAnchor(EOverflowAnchor v) { | |
| 1488 m_nonInheritedData.m_overflowAnchor = static_cast<unsigned>(v); | |
| 1489 } | |
| 1490 | |
| 1491 // overflow-x | 1475 // overflow-x |
| 1492 static EOverflow initialOverflowX() { return EOverflow::Visible; } | 1476 static EOverflow initialOverflowX() { return EOverflow::Visible; } |
| 1493 EOverflow overflowX() const { | 1477 EOverflow overflowX() const { |
| 1494 return static_cast<EOverflow>(m_nonInheritedData.m_overflowX); | 1478 return static_cast<EOverflow>(m_nonInheritedData.m_overflowX); |
| 1495 } | 1479 } |
| 1496 void setOverflowX(EOverflow v) { | 1480 void setOverflowX(EOverflow v) { |
| 1497 m_nonInheritedData.m_overflowX = static_cast<unsigned>(v); | 1481 m_nonInheritedData.m_overflowX = static_cast<unsigned>(v); |
| 1498 } | 1482 } |
| 1499 | 1483 |
| 1500 // overflow-y | 1484 // overflow-y |
| (...skipping 2443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3944 m_nonInheritedData.m_pseudoBits |= 1 << (pseudo - 1); | 3928 m_nonInheritedData.m_pseudoBits |= 1 << (pseudo - 1); |
| 3945 } | 3929 } |
| 3946 | 3930 |
| 3947 inline bool ComputedStyle::hasPseudoElementStyle() const { | 3931 inline bool ComputedStyle::hasPseudoElementStyle() const { |
| 3948 return m_nonInheritedData.m_pseudoBits & ElementPseudoIdMask; | 3932 return m_nonInheritedData.m_pseudoBits & ElementPseudoIdMask; |
| 3949 } | 3933 } |
| 3950 | 3934 |
| 3951 } // namespace blink | 3935 } // namespace blink |
| 3952 | 3936 |
| 3953 #endif // ComputedStyle_h | 3937 #endif // ComputedStyle_h |
| OLD | NEW |