| 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 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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) && | 202 (m_textAlign == other.m_textAlign) && |
| 203 (m_hasSimpleUnderline == other.m_hasSimpleUnderline) && | 203 (m_hasSimpleUnderline == other.m_hasSimpleUnderline) && |
| 204 (m_cursorStyle == other.m_cursorStyle) && | 204 (m_cursorStyle == other.m_cursorStyle) && |
| 205 (m_direction == other.m_direction) && | 205 (m_direction == other.m_direction) && |
| 206 (m_rtlOrdering == other.m_rtlOrdering) && | 206 (m_rtlOrdering == other.m_rtlOrdering) && |
| 207 (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 | 216 unsigned m_textAlign : 4; // ETextAlign |
| 218 unsigned m_hasSimpleUnderline : 1; // True if 'underline solid' is the only | 217 unsigned m_hasSimpleUnderline : 1; // True if 'underline solid' is the only |
| 219 // text decoration on this element. | 218 // text decoration on this element. |
| 220 unsigned m_cursorStyle : 6; // ECursor | 219 unsigned m_cursorStyle : 6; // ECursor |
| 221 unsigned m_direction : 1; // TextDirection | 220 unsigned m_direction : 1; // TextDirection |
| 222 // 32 bits | 221 // 32 bits |
| 223 | 222 |
| 224 // non CSS2 inherited | 223 // non CSS2 inherited |
| 225 unsigned m_rtlOrdering : 1; // EOrder | 224 unsigned m_rtlOrdering : 1; // EOrder |
| 226 unsigned m_printColorAdjust : 1; // PrintColorAdjust | |
| 227 unsigned m_insideLink : 2; // EInsideLink | 225 unsigned m_insideLink : 2; // EInsideLink |
| 228 | 226 |
| 229 // CSS Text Layout Module Level 3: Vertical writing support | 227 // CSS Text Layout Module Level 3: Vertical writing support |
| 230 unsigned m_writingMode : 2; // WritingMode | 228 unsigned m_writingMode : 2; // WritingMode |
| 231 // 42 bits | 229 // 42 bits |
| 232 } m_inheritedData; | 230 } m_inheritedData; |
| 233 | 231 |
| 234 // don't inherit | 232 // don't inherit |
| 235 struct NonInheritedData { | 233 struct NonInheritedData { |
| 236 // Compare computed styles, differences in inherited bits or other flags | 234 // Compare computed styles, differences in inherited bits or other flags |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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()); | 320 m_inheritedData.m_textAlign = static_cast<unsigned>(initialTextAlign()); |
| 323 m_inheritedData.m_hasSimpleUnderline = false; | 321 m_inheritedData.m_hasSimpleUnderline = false; |
| 324 m_inheritedData.m_cursorStyle = static_cast<unsigned>(initialCursor()); | 322 m_inheritedData.m_cursorStyle = static_cast<unsigned>(initialCursor()); |
| 325 m_inheritedData.m_direction = initialDirection(); | 323 m_inheritedData.m_direction = initialDirection(); |
| 326 m_inheritedData.m_rtlOrdering = static_cast<unsigned>(initialRTLOrdering()); | 324 m_inheritedData.m_rtlOrdering = static_cast<unsigned>(initialRTLOrdering()); |
| 327 m_inheritedData.m_printColorAdjust = | |
| 328 static_cast<unsigned>(initialPrintColorAdjust()); | |
| 329 m_inheritedData.m_insideLink = NotInsideLink; | 325 m_inheritedData.m_insideLink = NotInsideLink; |
| 330 m_inheritedData.m_writingMode = initialWritingMode(); | 326 m_inheritedData.m_writingMode = initialWritingMode(); |
| 331 | 327 |
| 332 m_nonInheritedData.m_effectiveDisplay = | 328 m_nonInheritedData.m_effectiveDisplay = |
| 333 m_nonInheritedData.m_originalDisplay = | 329 m_nonInheritedData.m_originalDisplay = |
| 334 static_cast<unsigned>(initialDisplay()); | 330 static_cast<unsigned>(initialDisplay()); |
| 335 m_nonInheritedData.m_overflowAnchor = | 331 m_nonInheritedData.m_overflowAnchor = |
| 336 static_cast<unsigned>(initialOverflowAnchor()); | 332 static_cast<unsigned>(initialOverflowAnchor()); |
| 337 m_nonInheritedData.m_overflowX = static_cast<unsigned>(initialOverflowX()); | 333 m_nonInheritedData.m_overflowX = static_cast<unsigned>(initialOverflowX()); |
| 338 m_nonInheritedData.m_overflowY = static_cast<unsigned>(initialOverflowY()); | 334 m_nonInheritedData.m_overflowY = static_cast<unsigned>(initialOverflowY()); |
| (...skipping 1953 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2292 | 2288 |
| 2293 // -webkit-line-clamp | 2289 // -webkit-line-clamp |
| 2294 static LineClampValue initialLineClamp() { return LineClampValue(); } | 2290 static LineClampValue initialLineClamp() { return LineClampValue(); } |
| 2295 const LineClampValue& lineClamp() const { | 2291 const LineClampValue& lineClamp() const { |
| 2296 return m_rareNonInheritedData->lineClamp; | 2292 return m_rareNonInheritedData->lineClamp; |
| 2297 } | 2293 } |
| 2298 void setLineClamp(LineClampValue c) { | 2294 void setLineClamp(LineClampValue c) { |
| 2299 SET_VAR(m_rareNonInheritedData, lineClamp, c); | 2295 SET_VAR(m_rareNonInheritedData, lineClamp, c); |
| 2300 } | 2296 } |
| 2301 | 2297 |
| 2302 // -webkit-print-color-adjust | |
| 2303 static PrintColorAdjust initialPrintColorAdjust() { | |
| 2304 return PrintColorAdjust::Economy; | |
| 2305 } | |
| 2306 PrintColorAdjust getPrintColorAdjust() const { | |
| 2307 return static_cast<PrintColorAdjust>(m_inheritedData.m_printColorAdjust); | |
| 2308 } | |
| 2309 void setPrintColorAdjust(PrintColorAdjust value) { | |
| 2310 m_inheritedData.m_printColorAdjust = static_cast<unsigned>(value); | |
| 2311 } | |
| 2312 | |
| 2313 // -webkit-rtl-ordering | 2298 // -webkit-rtl-ordering |
| 2314 static EOrder initialRTLOrdering() { return EOrder::Logical; } | 2299 static EOrder initialRTLOrdering() { return EOrder::Logical; } |
| 2315 EOrder rtlOrdering() const { | 2300 EOrder rtlOrdering() const { |
| 2316 return static_cast<EOrder>(m_inheritedData.m_rtlOrdering); | 2301 return static_cast<EOrder>(m_inheritedData.m_rtlOrdering); |
| 2317 } | 2302 } |
| 2318 void setRTLOrdering(EOrder o) { | 2303 void setRTLOrdering(EOrder o) { |
| 2319 m_inheritedData.m_rtlOrdering = static_cast<unsigned>(o); | 2304 m_inheritedData.m_rtlOrdering = static_cast<unsigned>(o); |
| 2320 } | 2305 } |
| 2321 | 2306 |
| 2322 // -webkit-ruby-position | 2307 // -webkit-ruby-position |
| (...skipping 1691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4014 m_nonInheritedData.m_pseudoBits |= 1 << (pseudo - 1); | 3999 m_nonInheritedData.m_pseudoBits |= 1 << (pseudo - 1); |
| 4015 } | 4000 } |
| 4016 | 4001 |
| 4017 inline bool ComputedStyle::hasPseudoElementStyle() const { | 4002 inline bool ComputedStyle::hasPseudoElementStyle() const { |
| 4018 return m_nonInheritedData.m_pseudoBits & ElementPseudoIdMask; | 4003 return m_nonInheritedData.m_pseudoBits & ElementPseudoIdMask; |
| 4019 } | 4004 } |
| 4020 | 4005 |
| 4021 } // namespace blink | 4006 } // namespace blink |
| 4022 | 4007 |
| 4023 #endif // ComputedStyle_h | 4008 #endif // ComputedStyle_h |
| OLD | NEW |