| 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 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 | 192 |
| 193 DataRef<SVGComputedStyle> m_svgStyle; | 193 DataRef<SVGComputedStyle> m_svgStyle; |
| 194 | 194 |
| 195 // !START SYNC!: Keep this in sync with the copy constructor in | 195 // !START SYNC!: Keep this in sync with the copy constructor in |
| 196 // ComputedStyle.cpp and implicitlyInherited() in StyleResolver.cpp | 196 // ComputedStyle.cpp and implicitlyInherited() in StyleResolver.cpp |
| 197 | 197 |
| 198 // inherit | 198 // inherit |
| 199 struct InheritedData { | 199 struct InheritedData { |
| 200 bool operator==(const InheritedData& other) const { | 200 bool operator==(const InheritedData& other) const { |
| 201 return (m_listStyleType == other.m_listStyleType) && | 201 return (m_listStyleType == other.m_listStyleType) && |
| 202 (m_textAlign == other.m_textAlign) && | |
| 203 (m_hasSimpleUnderline == other.m_hasSimpleUnderline) && | 202 (m_hasSimpleUnderline == other.m_hasSimpleUnderline) && |
| 204 (m_cursorStyle == other.m_cursorStyle) && | 203 (m_cursorStyle == other.m_cursorStyle) && |
| 205 (m_direction == other.m_direction) && | 204 (m_direction == other.m_direction) && |
| 206 (m_rtlOrdering == other.m_rtlOrdering) && | 205 (m_rtlOrdering == other.m_rtlOrdering) && |
| 207 (m_printColorAdjust == other.m_printColorAdjust) && | 206 (m_printColorAdjust == other.m_printColorAdjust) && |
| 208 (m_insideLink == other.m_insideLink) && | 207 (m_insideLink == other.m_insideLink) && |
| 209 (m_writingMode == other.m_writingMode); | 208 (m_writingMode == other.m_writingMode); |
| 210 } | 209 } |
| 211 | 210 |
| 212 bool operator!=(const InheritedData& other) const { | 211 bool operator!=(const InheritedData& other) const { |
| 213 return !(*this == other); | 212 return !(*this == other); |
| 214 } | 213 } |
| 215 | 214 |
| 216 unsigned m_listStyleType : 7; // EListStyleType | 215 unsigned m_listStyleType : 7; // EListStyleType |
| 217 unsigned m_textAlign : 4; // ETextAlign | |
| 218 unsigned m_hasSimpleUnderline : 1; // True if 'underline solid' is the only | 216 unsigned m_hasSimpleUnderline : 1; // True if 'underline solid' is the only |
| 219 // text decoration on this element. | 217 // text decoration on this element. |
| 220 unsigned m_cursorStyle : 6; // ECursor | 218 unsigned m_cursorStyle : 6; // ECursor |
| 221 unsigned m_direction : 1; // TextDirection | 219 unsigned m_direction : 1; // TextDirection |
| 222 // 32 bits | 220 // 32 bits |
| 223 | 221 |
| 224 // non CSS2 inherited | 222 // non CSS2 inherited |
| 225 unsigned m_rtlOrdering : 1; // EOrder | 223 unsigned m_rtlOrdering : 1; // EOrder |
| 226 unsigned m_printColorAdjust : 1; // PrintColorAdjust | 224 unsigned m_printColorAdjust : 1; // PrintColorAdjust |
| 227 unsigned m_insideLink : 2; // EInsideLink | 225 unsigned m_insideLink : 2; // EInsideLink |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 312 // If you add more style bits here, you will also need to update | 310 // If you add more style bits here, you will also need to update |
| 313 // ComputedStyle::copyNonInheritedFromCached() 68 bits | 311 // ComputedStyle::copyNonInheritedFromCached() 68 bits |
| 314 } m_nonInheritedData; | 312 } m_nonInheritedData; |
| 315 | 313 |
| 316 // !END SYNC! | 314 // !END SYNC! |
| 317 | 315 |
| 318 void setBitDefaults() { | 316 void setBitDefaults() { |
| 319 ComputedStyleBase::setBitDefaults(); | 317 ComputedStyleBase::setBitDefaults(); |
| 320 m_inheritedData.m_listStyleType = | 318 m_inheritedData.m_listStyleType = |
| 321 static_cast<unsigned>(initialListStyleType()); | 319 static_cast<unsigned>(initialListStyleType()); |
| 322 m_inheritedData.m_textAlign = static_cast<unsigned>(initialTextAlign()); | |
| 323 m_inheritedData.m_hasSimpleUnderline = false; | 320 m_inheritedData.m_hasSimpleUnderline = false; |
| 324 m_inheritedData.m_cursorStyle = static_cast<unsigned>(initialCursor()); | 321 m_inheritedData.m_cursorStyle = static_cast<unsigned>(initialCursor()); |
| 325 m_inheritedData.m_direction = initialDirection(); | 322 m_inheritedData.m_direction = initialDirection(); |
| 326 m_inheritedData.m_rtlOrdering = static_cast<unsigned>(initialRTLOrdering()); | 323 m_inheritedData.m_rtlOrdering = static_cast<unsigned>(initialRTLOrdering()); |
| 327 m_inheritedData.m_printColorAdjust = | 324 m_inheritedData.m_printColorAdjust = |
| 328 static_cast<unsigned>(initialPrintColorAdjust()); | 325 static_cast<unsigned>(initialPrintColorAdjust()); |
| 329 m_inheritedData.m_insideLink = NotInsideLink; | 326 m_inheritedData.m_insideLink = NotInsideLink; |
| 330 m_inheritedData.m_writingMode = initialWritingMode(); | 327 m_inheritedData.m_writingMode = initialWritingMode(); |
| 331 | 328 |
| 332 m_nonInheritedData.m_effectiveDisplay = | 329 m_nonInheritedData.m_effectiveDisplay = |
| (...skipping 1788 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2121 } | 2118 } |
| 2122 void setSpeak(ESpeak s) { SET_VAR(m_rareInheritedData, speak, s); } | 2119 void setSpeak(ESpeak s) { SET_VAR(m_rareInheritedData, speak, s); } |
| 2123 | 2120 |
| 2124 // tab-size | 2121 // tab-size |
| 2125 static TabSize initialTabSize() { return TabSize(8); } | 2122 static TabSize initialTabSize() { return TabSize(8); } |
| 2126 TabSize getTabSize() const { return m_rareInheritedData->m_tabSize; } | 2123 TabSize getTabSize() const { return m_rareInheritedData->m_tabSize; } |
| 2127 void setTabSize(TabSize size) { | 2124 void setTabSize(TabSize size) { |
| 2128 SET_VAR(m_rareInheritedData, m_tabSize, size); | 2125 SET_VAR(m_rareInheritedData, m_tabSize, size); |
| 2129 } | 2126 } |
| 2130 | 2127 |
| 2131 // text-align | |
| 2132 static ETextAlign initialTextAlign() { return ETextAlign::Start; } | |
| 2133 ETextAlign textAlign() const { | |
| 2134 return static_cast<ETextAlign>(m_inheritedData.m_textAlign); | |
| 2135 } | |
| 2136 void setTextAlign(ETextAlign v) { | |
| 2137 m_inheritedData.m_textAlign = static_cast<unsigned>(v); | |
| 2138 } | |
| 2139 | |
| 2140 // text-align-last | 2128 // text-align-last |
| 2141 static TextAlignLast initialTextAlignLast() { return TextAlignLastAuto; } | 2129 static TextAlignLast initialTextAlignLast() { return TextAlignLastAuto; } |
| 2142 TextAlignLast getTextAlignLast() const { | 2130 TextAlignLast getTextAlignLast() const { |
| 2143 return static_cast<TextAlignLast>(m_rareInheritedData->m_textAlignLast); | 2131 return static_cast<TextAlignLast>(m_rareInheritedData->m_textAlignLast); |
| 2144 } | 2132 } |
| 2145 void setTextAlignLast(TextAlignLast v) { | 2133 void setTextAlignLast(TextAlignLast v) { |
| 2146 SET_VAR(m_rareInheritedData, m_textAlignLast, v); | 2134 SET_VAR(m_rareInheritedData, m_textAlignLast, v); |
| 2147 } | 2135 } |
| 2148 | 2136 |
| 2149 // text-combine-upright (aka -webkit-text-combine, -epub-text-combine) | 2137 // text-combine-upright (aka -webkit-text-combine, -epub-text-combine) |
| (...skipping 1864 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4014 m_nonInheritedData.m_pseudoBits |= 1 << (pseudo - 1); | 4002 m_nonInheritedData.m_pseudoBits |= 1 << (pseudo - 1); |
| 4015 } | 4003 } |
| 4016 | 4004 |
| 4017 inline bool ComputedStyle::hasPseudoElementStyle() const { | 4005 inline bool ComputedStyle::hasPseudoElementStyle() const { |
| 4018 return m_nonInheritedData.m_pseudoBits & ElementPseudoIdMask; | 4006 return m_nonInheritedData.m_pseudoBits & ElementPseudoIdMask; |
| 4019 } | 4007 } |
| 4020 | 4008 |
| 4021 } // namespace blink | 4009 } // namespace blink |
| 4022 | 4010 |
| 4023 #endif // ComputedStyle_h | 4011 #endif // ComputedStyle_h |
| OLD | NEW |