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

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: 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 = initialBorderCollapse(); 367 m_inheritedData.m_borderCollapse = initialBorderCollapse();
372 m_inheritedData.m_rtlOrdering = initialRTLOrdering(); 368 m_inheritedData.m_rtlOrdering = initialRTLOrdering();
373 m_inheritedData.m_boxDirection = 369 m_inheritedData.m_boxDirection =
374 static_cast<unsigned>(initialBoxDirection()); 370 static_cast<unsigned>(initialBoxDirection());
375 m_inheritedData.m_printColorAdjust = 371 m_inheritedData.m_printColorAdjust =
376 static_cast<unsigned>(initialPrintColorAdjust()); 372 static_cast<unsigned>(initialPrintColorAdjust());
(...skipping 1894 matching lines...) Expand 10 before | Expand all | Expand 10 after
2271 static TextSizeAdjust initialTextSizeAdjust() { 2267 static TextSizeAdjust initialTextSizeAdjust() {
2272 return TextSizeAdjust::adjustAuto(); 2268 return TextSizeAdjust::adjustAuto();
2273 } 2269 }
2274 TextSizeAdjust getTextSizeAdjust() const { 2270 TextSizeAdjust getTextSizeAdjust() const {
2275 return m_rareInheritedData->m_textSizeAdjust; 2271 return m_rareInheritedData->m_textSizeAdjust;
2276 } 2272 }
2277 void setTextSizeAdjust(TextSizeAdjust sizeAdjust) { 2273 void setTextSizeAdjust(TextSizeAdjust sizeAdjust) {
2278 SET_VAR(m_rareInheritedData, m_textSizeAdjust, sizeAdjust); 2274 SET_VAR(m_rareInheritedData, m_textSizeAdjust, sizeAdjust);
2279 } 2275 }
2280 2276
2281 // text-transform (aka -epub-text-transform)
2282 static ETextTransform initialTextTransform() { return ETextTransform::None; }
2283 ETextTransform textTransform() const {
2284 return static_cast<ETextTransform>(m_inheritedData.m_textTransform);
2285 }
2286 void setTextTransform(ETextTransform v) {
2287 m_inheritedData.m_textTransform = static_cast<unsigned>(v);
2288 }
2289
2290 // white-space inherited 2277 // white-space inherited
2291 static EWhiteSpace initialWhiteSpace() { return EWhiteSpace::Normal; } 2278 static EWhiteSpace initialWhiteSpace() { return EWhiteSpace::Normal; }
2292 EWhiteSpace whiteSpace() const { 2279 EWhiteSpace whiteSpace() const {
2293 return static_cast<EWhiteSpace>(m_inheritedData.m_whiteSpace); 2280 return static_cast<EWhiteSpace>(m_inheritedData.m_whiteSpace);
2294 } 2281 }
2295 void setWhiteSpace(EWhiteSpace v) { 2282 void setWhiteSpace(EWhiteSpace v) {
2296 m_inheritedData.m_whiteSpace = static_cast<unsigned>(v); 2283 m_inheritedData.m_whiteSpace = static_cast<unsigned>(v);
2297 } 2284 }
2298 2285
2299 // word-break inherited (aka -epub-word-break) 2286 // word-break inherited (aka -epub-word-break)
(...skipping 1793 matching lines...) Expand 10 before | Expand all | Expand 10 after
4093 m_nonInheritedData.m_pseudoBits |= 1 << (pseudo - 1); 4080 m_nonInheritedData.m_pseudoBits |= 1 << (pseudo - 1);
4094 } 4081 }
4095 4082
4096 inline bool ComputedStyle::hasPseudoElementStyle() const { 4083 inline bool ComputedStyle::hasPseudoElementStyle() const {
4097 return m_nonInheritedData.m_pseudoBits & ElementPseudoIdMask; 4084 return m_nonInheritedData.m_pseudoBits & ElementPseudoIdMask;
4098 } 4085 }
4099 4086
4100 } // namespace blink 4087 } // namespace blink
4101 4088
4102 #endif // ComputedStyle_h 4089 #endif // ComputedStyle_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698