Chromium Code Reviews| 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 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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 && | 225 m_overflowAnchor == other.m_overflowAnchor && |
| 226 m_overflowX == other.m_overflowX && | 226 m_overflowX == other.m_overflowX && |
| 227 m_overflowY == other.m_overflowY && | 227 m_overflowY == other.m_overflowY && |
| 228 m_verticalAlign == other.m_verticalAlign && | 228 m_verticalAlign == other.m_verticalAlign && |
| 229 m_clear == other.m_clear && m_position == other.m_position && | 229 m_clear == other.m_clear && m_position == other.m_position && |
| 230 m_tableLayout == other.m_tableLayout && | |
|
Bugs Nash
2017/01/31 19:49:47
could we add some comment to the code that indicat
shend
2017/01/31 22:03:39
Good idea! I get confused sometimes as well. Done.
| |
| 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 | 253 unsigned m_overflowAnchor : 2; // EOverflowAnchor |
| 255 unsigned m_overflowX : 3; // EOverflow | 254 unsigned m_overflowX : 3; // EOverflow |
| 256 unsigned m_overflowY : 3; // EOverflow | 255 unsigned m_overflowY : 3; // EOverflow |
| 257 unsigned m_verticalAlign : 4; // EVerticalAlign | 256 unsigned m_verticalAlign : 4; // EVerticalAlign |
| 258 unsigned m_clear : 2; // EClear | 257 unsigned m_clear : 2; // EClear |
| 259 unsigned m_position : 3; // EPosition | 258 unsigned m_position : 3; // EPosition |
| 260 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. |
| 265 mutable unsigned m_hasViewportUnits : 1; | 263 mutable unsigned m_hasViewportUnits : 1; |
| 266 | 264 |
| 267 // 32 bits | 265 // 32 bits |
| 268 | 266 |
| 269 unsigned m_breakBefore : 4; // EBreak | 267 unsigned m_breakBefore : 4; // EBreak |
| 270 unsigned m_breakAfter : 4; // EBreak | 268 unsigned m_breakAfter : 4; // EBreak |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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 = | 308 m_nonInheritedData.m_overflowAnchor = |
| 311 static_cast<unsigned>(initialOverflowAnchor()); | 309 static_cast<unsigned>(initialOverflowAnchor()); |
| 312 m_nonInheritedData.m_overflowX = static_cast<unsigned>(initialOverflowX()); | 310 m_nonInheritedData.m_overflowX = static_cast<unsigned>(initialOverflowX()); |
| 313 m_nonInheritedData.m_overflowY = static_cast<unsigned>(initialOverflowY()); | 311 m_nonInheritedData.m_overflowY = static_cast<unsigned>(initialOverflowY()); |
| 314 m_nonInheritedData.m_verticalAlign = | 312 m_nonInheritedData.m_verticalAlign = |
| 315 static_cast<unsigned>(initialVerticalAlign()); | 313 static_cast<unsigned>(initialVerticalAlign()); |
| 316 m_nonInheritedData.m_clear = initialClear(); | 314 m_nonInheritedData.m_clear = initialClear(); |
| 317 m_nonInheritedData.m_position = initialPosition(); | 315 m_nonInheritedData.m_position = initialPosition(); |
| 318 m_nonInheritedData.m_tableLayout = | |
| 319 static_cast<unsigned>(initialTableLayout()); | |
| 320 m_nonInheritedData.m_breakBefore = initialBreakBefore(); | 316 m_nonInheritedData.m_breakBefore = initialBreakBefore(); |
| 321 m_nonInheritedData.m_breakAfter = initialBreakAfter(); | 317 m_nonInheritedData.m_breakAfter = initialBreakAfter(); |
| 322 m_nonInheritedData.m_breakInside = initialBreakInside(); | 318 m_nonInheritedData.m_breakInside = initialBreakInside(); |
| 323 m_nonInheritedData.m_styleType = PseudoIdNone; | 319 m_nonInheritedData.m_styleType = PseudoIdNone; |
| 324 m_nonInheritedData.m_pseudoBits = 0; | 320 m_nonInheritedData.m_pseudoBits = 0; |
| 325 m_nonInheritedData.m_explicitInheritance = false; | 321 m_nonInheritedData.m_explicitInheritance = false; |
| 326 m_nonInheritedData.m_variableReference = false; | 322 m_nonInheritedData.m_variableReference = false; |
| 327 m_nonInheritedData.m_unique = false; | 323 m_nonInheritedData.m_unique = false; |
| 328 m_nonInheritedData.m_emptyState = false; | 324 m_nonInheritedData.m_emptyState = false; |
| 329 m_nonInheritedData.m_hasViewportUnits = false; | 325 m_nonInheritedData.m_hasViewportUnits = false; |
| (...skipping 1442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1772 } | 1768 } |
| 1773 PageSizeType getPageSizeType() const { | 1769 PageSizeType getPageSizeType() const { |
| 1774 return static_cast<PageSizeType>(m_rareNonInheritedData->m_pageSizeType); | 1770 return static_cast<PageSizeType>(m_rareNonInheritedData->m_pageSizeType); |
| 1775 } | 1771 } |
| 1776 void setPageSize(const FloatSize& s) { | 1772 void setPageSize(const FloatSize& s) { |
| 1777 SET_VAR(m_rareNonInheritedData, m_pageSize, s); | 1773 SET_VAR(m_rareNonInheritedData, m_pageSize, s); |
| 1778 } | 1774 } |
| 1779 void setPageSizeType(PageSizeType t) { | 1775 void setPageSizeType(PageSizeType t) { |
| 1780 SET_VAR(m_rareNonInheritedData, m_pageSizeType, t); | 1776 SET_VAR(m_rareNonInheritedData, m_pageSizeType, t); |
| 1781 } | 1777 } |
| 1782 // table-layout | |
| 1783 static ETableLayout initialTableLayout() { return ETableLayout::kAuto; } | |
| 1784 ETableLayout tableLayout() const { | |
| 1785 return static_cast<ETableLayout>(m_nonInheritedData.m_tableLayout); | |
| 1786 } | |
| 1787 void setTableLayout(ETableLayout v) { | |
| 1788 m_nonInheritedData.m_tableLayout = static_cast<unsigned>(v); | |
| 1789 } | |
| 1790 | 1778 |
| 1791 // Text decoration properties. | 1779 // Text decoration properties. |
| 1792 // text-decoration-line | 1780 // text-decoration-line |
| 1793 static TextDecoration initialTextDecoration() { return TextDecorationNone; } | 1781 static TextDecoration initialTextDecoration() { return TextDecorationNone; } |
| 1794 TextDecoration getTextDecoration() const { | 1782 TextDecoration getTextDecoration() const { |
| 1795 return static_cast<TextDecoration>(m_visual->textDecoration); | 1783 return static_cast<TextDecoration>(m_visual->textDecoration); |
| 1796 } | 1784 } |
| 1797 void setTextDecoration(TextDecoration v) { | 1785 void setTextDecoration(TextDecoration v) { |
| 1798 SET_VAR(m_visual, textDecoration, v); | 1786 SET_VAR(m_visual, textDecoration, v); |
| 1799 } | 1787 } |
| (...skipping 2147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3947 m_nonInheritedData.m_pseudoBits |= 1 << (pseudo - 1); | 3935 m_nonInheritedData.m_pseudoBits |= 1 << (pseudo - 1); |
| 3948 } | 3936 } |
| 3949 | 3937 |
| 3950 inline bool ComputedStyle::hasPseudoElementStyle() const { | 3938 inline bool ComputedStyle::hasPseudoElementStyle() const { |
| 3951 return m_nonInheritedData.m_pseudoBits & ElementPseudoIdMask; | 3939 return m_nonInheritedData.m_pseudoBits & ElementPseudoIdMask; |
| 3952 } | 3940 } |
| 3953 | 3941 |
| 3954 } // namespace blink | 3942 } // namespace blink |
| 3955 | 3943 |
| 3956 #endif // ComputedStyle_h | 3944 #endif // ComputedStyle_h |
| OLD | NEW |