Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(514)

Side by Side Diff: third_party/WebKit/Source/core/style/ComputedStyle.h

Issue 2528283002: Move text-transform to be generated in ComputedStyleBase (Closed)
Patch Set: Rebase Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 inline bool compareEqualIndependent(const InheritedData& other) const { 209 inline bool compareEqualIndependent(const InheritedData& other) const {
210 // These must match the properties tagged 'independent' in 210 // These must match the properties tagged 'independent' in
211 // CSSProperties.in. 211 // CSSProperties.in.
212 // TODO(sashab): Generate this function. 212 // TODO(sashab): Generate this function.
213 return (m_pointerEvents == other.m_pointerEvents); 213 return (m_pointerEvents == other.m_pointerEvents);
214 } 214 }
215 215
216 inline bool compareEqualNonIndependent(const InheritedData& other) const { 216 inline bool compareEqualNonIndependent(const InheritedData& other) const {
217 return (m_listStyleType == other.m_listStyleType) && 217 return (m_listStyleType == other.m_listStyleType) &&
218 (m_textAlign == other.m_textAlign) && 218 (m_textAlign == other.m_textAlign) &&
219 (m_textTransform == other.m_textTransform) &&
220 (m_hasSimpleUnderline == other.m_hasSimpleUnderline) && 219 (m_hasSimpleUnderline == other.m_hasSimpleUnderline) &&
221 (m_cursorStyle == other.m_cursorStyle) && 220 (m_cursorStyle == other.m_cursorStyle) &&
222 (m_direction == other.m_direction) && 221 (m_direction == other.m_direction) &&
223 (m_whiteSpace == other.m_whiteSpace) && 222 (m_whiteSpace == other.m_whiteSpace) &&
224 (m_borderCollapse == other.m_borderCollapse) && 223 (m_borderCollapse == other.m_borderCollapse) &&
225 (m_boxDirection == other.m_boxDirection) && 224 (m_boxDirection == other.m_boxDirection) &&
226 (m_rtlOrdering == other.m_rtlOrdering) && 225 (m_rtlOrdering == other.m_rtlOrdering) &&
227 (m_printColorAdjust == other.m_printColorAdjust) && 226 (m_printColorAdjust == other.m_printColorAdjust) &&
228 (m_insideLink == other.m_insideLink) && 227 (m_insideLink == other.m_insideLink) &&
229 (m_writingMode == other.m_writingMode); 228 (m_writingMode == other.m_writingMode);
230 } 229 }
231 230
232 unsigned m_listStyleType : 7; // EListStyleType 231 unsigned m_listStyleType : 7; // EListStyleType
233 unsigned m_textAlign : 4; // ETextAlign 232 unsigned m_textAlign : 4; // ETextAlign
234 unsigned m_textTransform : 2; // ETextTransform
235 unsigned m_hasSimpleUnderline : 1; // True if 'underline solid' is the only 233 unsigned m_hasSimpleUnderline : 1; // True if 'underline solid' is the only
236 // text decoration on this element. 234 // text decoration on this element.
237 unsigned m_cursorStyle : 6; // ECursor 235 unsigned m_cursorStyle : 6; // ECursor
238 unsigned m_direction : 1; // TextDirection 236 unsigned m_direction : 1; // TextDirection
239 unsigned m_whiteSpace : 3; // EWhiteSpace 237 unsigned m_whiteSpace : 3; // EWhiteSpace
240 unsigned m_borderCollapse : 1; // EBorderCollapse 238 unsigned m_borderCollapse : 1; // EBorderCollapse
241 unsigned m_boxDirection : 1; // EBoxDirection (CSS3 box_direction property, 239 unsigned m_boxDirection : 1; // EBoxDirection (CSS3 box_direction property,
242 // flexible box layout module) 240 // flexible box layout module)
243 // 32 bits 241 // 32 bits
244 242
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 // ComputedStyle::copyNonInheritedFromCached() 68 bits 353 // ComputedStyle::copyNonInheritedFromCached() 68 bits
356 } m_nonInheritedData; 354 } m_nonInheritedData;
357 355
358 // !END SYNC! 356 // !END SYNC!
359 357
360 void setBitDefaults() { 358 void setBitDefaults() {
361 ComputedStyleBase::setBitDefaults(); 359 ComputedStyleBase::setBitDefaults();
362 m_inheritedData.m_listStyleType = 360 m_inheritedData.m_listStyleType =
363 static_cast<unsigned>(initialListStyleType()); 361 static_cast<unsigned>(initialListStyleType());
364 m_inheritedData.m_textAlign = static_cast<unsigned>(initialTextAlign()); 362 m_inheritedData.m_textAlign = static_cast<unsigned>(initialTextAlign());
365 m_inheritedData.m_textTransform =
366 static_cast<unsigned>(initialTextTransform());
367 m_inheritedData.m_hasSimpleUnderline = false; 363 m_inheritedData.m_hasSimpleUnderline = false;
368 m_inheritedData.m_cursorStyle = static_cast<unsigned>(initialCursor()); 364 m_inheritedData.m_cursorStyle = static_cast<unsigned>(initialCursor());
369 m_inheritedData.m_direction = initialDirection(); 365 m_inheritedData.m_direction = initialDirection();
370 m_inheritedData.m_whiteSpace = static_cast<unsigned>(initialWhiteSpace()); 366 m_inheritedData.m_whiteSpace = static_cast<unsigned>(initialWhiteSpace());
371 m_inheritedData.m_borderCollapse = 367 m_inheritedData.m_borderCollapse =
372 static_cast<unsigned>(initialBorderCollapse()); 368 static_cast<unsigned>(initialBorderCollapse());
373 m_inheritedData.m_rtlOrdering = initialRTLOrdering(); 369 m_inheritedData.m_rtlOrdering = initialRTLOrdering();
374 m_inheritedData.m_boxDirection = 370 m_inheritedData.m_boxDirection =
375 static_cast<unsigned>(initialBoxDirection()); 371 static_cast<unsigned>(initialBoxDirection());
376 m_inheritedData.m_printColorAdjust = 372 m_inheritedData.m_printColorAdjust =
(...skipping 1895 matching lines...) Expand 10 before | Expand all | Expand 10 after
2272 static TextSizeAdjust initialTextSizeAdjust() { 2268 static TextSizeAdjust initialTextSizeAdjust() {
2273 return TextSizeAdjust::adjustAuto(); 2269 return TextSizeAdjust::adjustAuto();
2274 } 2270 }
2275 TextSizeAdjust getTextSizeAdjust() const { 2271 TextSizeAdjust getTextSizeAdjust() const {
2276 return m_rareInheritedData->m_textSizeAdjust; 2272 return m_rareInheritedData->m_textSizeAdjust;
2277 } 2273 }
2278 void setTextSizeAdjust(TextSizeAdjust sizeAdjust) { 2274 void setTextSizeAdjust(TextSizeAdjust sizeAdjust) {
2279 SET_VAR(m_rareInheritedData, m_textSizeAdjust, sizeAdjust); 2275 SET_VAR(m_rareInheritedData, m_textSizeAdjust, sizeAdjust);
2280 } 2276 }
2281 2277
2282 // text-transform (aka -epub-text-transform)
2283 static ETextTransform initialTextTransform() { return ETextTransform::None; }
2284 ETextTransform textTransform() const {
2285 return static_cast<ETextTransform>(m_inheritedData.m_textTransform);
2286 }
2287 void setTextTransform(ETextTransform v) {
2288 m_inheritedData.m_textTransform = static_cast<unsigned>(v);
2289 }
2290
2291 // white-space inherited 2278 // white-space inherited
2292 static EWhiteSpace initialWhiteSpace() { return EWhiteSpace::Normal; } 2279 static EWhiteSpace initialWhiteSpace() { return EWhiteSpace::Normal; }
2293 EWhiteSpace whiteSpace() const { 2280 EWhiteSpace whiteSpace() const {
2294 return static_cast<EWhiteSpace>(m_inheritedData.m_whiteSpace); 2281 return static_cast<EWhiteSpace>(m_inheritedData.m_whiteSpace);
2295 } 2282 }
2296 void setWhiteSpace(EWhiteSpace v) { 2283 void setWhiteSpace(EWhiteSpace v) {
2297 m_inheritedData.m_whiteSpace = static_cast<unsigned>(v); 2284 m_inheritedData.m_whiteSpace = static_cast<unsigned>(v);
2298 } 2285 }
2299 2286
2300 // word-break inherited (aka -epub-word-break) 2287 // word-break inherited (aka -epub-word-break)
(...skipping 1793 matching lines...) Expand 10 before | Expand all | Expand 10 after
4094 m_nonInheritedData.m_pseudoBits |= 1 << (pseudo - 1); 4081 m_nonInheritedData.m_pseudoBits |= 1 << (pseudo - 1);
4095 } 4082 }
4096 4083
4097 inline bool ComputedStyle::hasPseudoElementStyle() const { 4084 inline bool ComputedStyle::hasPseudoElementStyle() const {
4098 return m_nonInheritedData.m_pseudoBits & ElementPseudoIdMask; 4085 return m_nonInheritedData.m_pseudoBits & ElementPseudoIdMask;
4099 } 4086 }
4100 4087
4101 } // namespace blink 4088 } // namespace blink
4102 4089
4103 #endif // ComputedStyle_h 4090 #endif // ComputedStyle_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSProperties.in ('k') | third_party/WebKit/Source/core/style/ComputedStyle.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698