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

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

Issue 2506033003: Move list-style-position 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 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 208
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_listStylePosition == other.m_listStylePosition) &&
219 (m_textAlign == other.m_textAlign) && 218 (m_textAlign == other.m_textAlign) &&
220 (m_textTransform == other.m_textTransform) && 219 (m_textTransform == other.m_textTransform) &&
221 (m_hasSimpleUnderline == other.m_hasSimpleUnderline) && 220 (m_hasSimpleUnderline == other.m_hasSimpleUnderline) &&
222 (m_cursorStyle == other.m_cursorStyle) && 221 (m_cursorStyle == other.m_cursorStyle) &&
223 (m_direction == other.m_direction) && 222 (m_direction == other.m_direction) &&
224 (m_whiteSpace == other.m_whiteSpace) && 223 (m_whiteSpace == other.m_whiteSpace) &&
225 (m_borderCollapse == other.m_borderCollapse) && 224 (m_borderCollapse == other.m_borderCollapse) &&
226 (m_boxDirection == other.m_boxDirection) && 225 (m_boxDirection == other.m_boxDirection) &&
227 (m_rtlOrdering == other.m_rtlOrdering) && 226 (m_rtlOrdering == other.m_rtlOrdering) &&
228 (m_printColorAdjust == other.m_printColorAdjust) && 227 (m_printColorAdjust == other.m_printColorAdjust) &&
229 (m_insideLink == other.m_insideLink) && 228 (m_insideLink == other.m_insideLink) &&
230 (m_writingMode == other.m_writingMode); 229 (m_writingMode == other.m_writingMode);
231 } 230 }
232 231
233 unsigned m_listStyleType : 7; // EListStyleType 232 unsigned m_listStyleType : 7; // EListStyleType
234 unsigned m_listStylePosition : 1; // EListStylePosition
235 unsigned m_textAlign : 4; // ETextAlign 233 unsigned m_textAlign : 4; // ETextAlign
236 unsigned m_textTransform : 2; // ETextTransform 234 unsigned m_textTransform : 2; // ETextTransform
237 unsigned m_hasSimpleUnderline : 1; // True if 'underline solid' is the only 235 unsigned m_hasSimpleUnderline : 1; // True if 'underline solid' is the only
238 // text decoration on this element. 236 // text decoration on this element.
239 unsigned m_cursorStyle : 6; // ECursor 237 unsigned m_cursorStyle : 6; // ECursor
240 unsigned m_direction : 1; // TextDirection 238 unsigned m_direction : 1; // TextDirection
241 unsigned m_whiteSpace : 3; // EWhiteSpace 239 unsigned m_whiteSpace : 3; // EWhiteSpace
242 unsigned m_borderCollapse : 1; // EBorderCollapse 240 unsigned m_borderCollapse : 1; // EBorderCollapse
243 unsigned m_boxDirection : 1; // EBoxDirection (CSS3 box_direction property, 241 unsigned m_boxDirection : 1; // EBoxDirection (CSS3 box_direction property,
244 // flexible box layout module) 242 // flexible box layout module)
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
356 // If you add more style bits here, you will also need to update 354 // If you add more style bits here, you will also need to update
357 // ComputedStyle::copyNonInheritedFromCached() 68 bits 355 // ComputedStyle::copyNonInheritedFromCached() 68 bits
358 } m_nonInheritedData; 356 } m_nonInheritedData;
359 357
360 // !END SYNC! 358 // !END SYNC!
361 359
362 void setBitDefaults() { 360 void setBitDefaults() {
363 ComputedStyleBase::setBitDefaults(); 361 ComputedStyleBase::setBitDefaults();
364 m_inheritedData.m_listStyleType = 362 m_inheritedData.m_listStyleType =
365 static_cast<unsigned>(initialListStyleType()); 363 static_cast<unsigned>(initialListStyleType());
366 m_inheritedData.m_listStylePosition =
367 static_cast<unsigned>(initialListStylePosition());
368 m_inheritedData.m_textAlign = static_cast<unsigned>(initialTextAlign()); 364 m_inheritedData.m_textAlign = static_cast<unsigned>(initialTextAlign());
369 m_inheritedData.m_textTransform = 365 m_inheritedData.m_textTransform =
370 static_cast<unsigned>(initialTextTransform()); 366 static_cast<unsigned>(initialTextTransform());
371 m_inheritedData.m_hasSimpleUnderline = false; 367 m_inheritedData.m_hasSimpleUnderline = false;
372 m_inheritedData.m_cursorStyle = static_cast<unsigned>(initialCursor()); 368 m_inheritedData.m_cursorStyle = static_cast<unsigned>(initialCursor());
373 m_inheritedData.m_direction = initialDirection(); 369 m_inheritedData.m_direction = initialDirection();
374 m_inheritedData.m_whiteSpace = static_cast<unsigned>(initialWhiteSpace()); 370 m_inheritedData.m_whiteSpace = static_cast<unsigned>(initialWhiteSpace());
375 m_inheritedData.m_borderCollapse = initialBorderCollapse(); 371 m_inheritedData.m_borderCollapse = initialBorderCollapse();
376 m_inheritedData.m_rtlOrdering = initialRTLOrdering(); 372 m_inheritedData.m_rtlOrdering = initialRTLOrdering();
377 m_inheritedData.m_boxDirection = 373 m_inheritedData.m_boxDirection =
(...skipping 1744 matching lines...) Expand 10 before | Expand all | Expand 10 after
2122 // List style properties. 2118 // List style properties.
2123 // list-style-type 2119 // list-style-type
2124 static EListStyleType initialListStyleType() { return EListStyleType::Disc; } 2120 static EListStyleType initialListStyleType() { return EListStyleType::Disc; }
2125 EListStyleType listStyleType() const { 2121 EListStyleType listStyleType() const {
2126 return static_cast<EListStyleType>(m_inheritedData.m_listStyleType); 2122 return static_cast<EListStyleType>(m_inheritedData.m_listStyleType);
2127 } 2123 }
2128 void setListStyleType(EListStyleType v) { 2124 void setListStyleType(EListStyleType v) {
2129 m_inheritedData.m_listStyleType = static_cast<unsigned>(v); 2125 m_inheritedData.m_listStyleType = static_cast<unsigned>(v);
2130 } 2126 }
2131 2127
2132 // list-style-position
2133 static EListStylePosition initialListStylePosition() {
2134 return EListStylePosition::Outside;
2135 }
2136 EListStylePosition listStylePosition() const {
2137 return static_cast<EListStylePosition>(m_inheritedData.m_listStylePosition);
2138 }
2139 void setListStylePosition(EListStylePosition v) {
2140 m_inheritedData.m_listStylePosition = static_cast<unsigned>(v);
2141 }
2142
2143 // list-style-image 2128 // list-style-image
2144 static StyleImage* initialListStyleImage() { return 0; } 2129 static StyleImage* initialListStyleImage() { return 0; }
2145 StyleImage* listStyleImage() const; 2130 StyleImage* listStyleImage() const;
2146 void setListStyleImage(StyleImage*); 2131 void setListStyleImage(StyleImage*);
2147 2132
2148 // orphans 2133 // orphans
2149 static short initialOrphans() { return 2; } 2134 static short initialOrphans() { return 2; }
2150 short orphans() const { return m_rareInheritedData->orphans; } 2135 short orphans() const { return m_rareInheritedData->orphans; }
2151 void setOrphans(short o) { SET_VAR(m_rareInheritedData, orphans, o); } 2136 void setOrphans(short o) { SET_VAR(m_rareInheritedData, orphans, o); }
2152 2137
(...skipping 1954 matching lines...) Expand 10 before | Expand all | Expand 10 after
4107 m_nonInheritedData.m_pseudoBits |= 1 << (pseudo - 1); 4092 m_nonInheritedData.m_pseudoBits |= 1 << (pseudo - 1);
4108 } 4093 }
4109 4094
4110 inline bool ComputedStyle::hasPseudoElementStyle() const { 4095 inline bool ComputedStyle::hasPseudoElementStyle() const {
4111 return m_nonInheritedData.m_pseudoBits & ElementPseudoIdMask; 4096 return m_nonInheritedData.m_pseudoBits & ElementPseudoIdMask;
4112 } 4097 }
4113 4098
4114 } // namespace blink 4099 } // namespace blink
4115 4100
4116 #endif // ComputedStyle_h 4101 #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