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

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

Issue 2656733002: Moved clear property to be generated in ComputedStyleBase. (Closed)
Patch Set: Rebase Created 3 years, 10 months 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 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 struct NonInheritedData { 219 struct NonInheritedData {
220 // Compare computed styles, differences in inherited bits or other flags 220 // Compare computed styles, differences in inherited bits or other flags
221 // should not cause an inequality. 221 // should not cause an inequality.
222 bool operator==(const NonInheritedData& other) const { 222 bool operator==(const NonInheritedData& other) const {
223 return m_effectiveDisplay == other.m_effectiveDisplay && 223 return m_effectiveDisplay == other.m_effectiveDisplay &&
224 m_originalDisplay == other.m_originalDisplay && 224 m_originalDisplay == other.m_originalDisplay &&
225 m_overflowAnchor == other.m_overflowAnchor && 225 m_overflowAnchor == other.m_overflowAnchor &&
226 m_overflowX == other.m_overflowX && 226 m_overflowX == other.m_overflowX &&
227 m_overflowY == other.m_overflowY && 227 m_overflowY == other.m_overflowY &&
228 m_verticalAlign == other.m_verticalAlign && 228 m_verticalAlign == other.m_verticalAlign &&
229 m_clear == other.m_clear && m_position == other.m_position && 229 m_position == other.m_position &&
230 m_tableLayout == other.m_tableLayout && 230 m_tableLayout == other.m_tableLayout &&
231 // hasViewportUnits 231 // hasViewportUnits
232 m_breakBefore == other.m_breakBefore && 232 m_breakBefore == other.m_breakBefore &&
233 m_breakAfter == other.m_breakAfter && 233 m_breakAfter == other.m_breakAfter &&
234 m_breakInside == other.m_breakInside; 234 m_breakInside == other.m_breakInside;
235 // styleType 235 // styleType
236 // pseudoBits 236 // pseudoBits
237 // explicitInheritance 237 // explicitInheritance
238 // unique 238 // unique
239 // emptyState 239 // emptyState
240 // affectedByFocus 240 // affectedByFocus
241 // affectedByHover 241 // affectedByHover
242 // affectedByActive 242 // affectedByActive
243 // affectedByDrag 243 // affectedByDrag
244 // isLink 244 // isLink
245 // isInherited flags 245 // isInherited flags
246 } 246 }
247 247
248 bool operator!=(const NonInheritedData& other) const { 248 bool operator!=(const NonInheritedData& other) const {
249 return !(*this == other); 249 return !(*this == other);
250 } 250 }
251 251
252 unsigned m_effectiveDisplay : 5; // EDisplay 252 unsigned m_effectiveDisplay : 5; // EDisplay
253 unsigned m_originalDisplay : 5; // EDisplay 253 unsigned m_originalDisplay : 5; // EDisplay
254 unsigned m_overflowAnchor : 2; // EOverflowAnchor 254 unsigned m_overflowAnchor : 2; // EOverflowAnchor
255 unsigned m_overflowX : 3; // EOverflow 255 unsigned m_overflowX : 3; // EOverflow
256 unsigned m_overflowY : 3; // EOverflow 256 unsigned m_overflowY : 3; // EOverflow
257 unsigned m_verticalAlign : 4; // EVerticalAlign 257 unsigned m_verticalAlign : 4; // EVerticalAlign
258 unsigned m_clear : 2; // EClear
259 unsigned m_position : 3; // EPosition 258 unsigned m_position : 3; // EPosition
260 unsigned m_tableLayout : 1; // ETableLayout 259 unsigned m_tableLayout : 1; // ETableLayout
261 260
262 // This is set if we used viewport units when resolving a length. 261 // This is set if we used viewport units when resolving a length.
263 // It is mutable so we can pass around const ComputedStyles to resolve 262 // It is mutable so we can pass around const ComputedStyles to resolve
264 // lengths. 263 // lengths.
265 mutable unsigned m_hasViewportUnits : 1; 264 mutable unsigned m_hasViewportUnits : 1;
266 265
267 // 32 bits 266 // 32 bits
268 267
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 305
307 m_nonInheritedData.m_effectiveDisplay = 306 m_nonInheritedData.m_effectiveDisplay =
308 m_nonInheritedData.m_originalDisplay = 307 m_nonInheritedData.m_originalDisplay =
309 static_cast<unsigned>(initialDisplay()); 308 static_cast<unsigned>(initialDisplay());
310 m_nonInheritedData.m_overflowAnchor = 309 m_nonInheritedData.m_overflowAnchor =
311 static_cast<unsigned>(initialOverflowAnchor()); 310 static_cast<unsigned>(initialOverflowAnchor());
312 m_nonInheritedData.m_overflowX = static_cast<unsigned>(initialOverflowX()); 311 m_nonInheritedData.m_overflowX = static_cast<unsigned>(initialOverflowX());
313 m_nonInheritedData.m_overflowY = static_cast<unsigned>(initialOverflowY()); 312 m_nonInheritedData.m_overflowY = static_cast<unsigned>(initialOverflowY());
314 m_nonInheritedData.m_verticalAlign = 313 m_nonInheritedData.m_verticalAlign =
315 static_cast<unsigned>(initialVerticalAlign()); 314 static_cast<unsigned>(initialVerticalAlign());
316 m_nonInheritedData.m_clear = static_cast<unsigned>(initialClear());
317 m_nonInheritedData.m_position = initialPosition(); 315 m_nonInheritedData.m_position = initialPosition();
318 m_nonInheritedData.m_tableLayout = 316 m_nonInheritedData.m_tableLayout =
319 static_cast<unsigned>(initialTableLayout()); 317 static_cast<unsigned>(initialTableLayout());
320 m_nonInheritedData.m_breakBefore = initialBreakBefore(); 318 m_nonInheritedData.m_breakBefore = initialBreakBefore();
321 m_nonInheritedData.m_breakAfter = initialBreakAfter(); 319 m_nonInheritedData.m_breakAfter = initialBreakAfter();
322 m_nonInheritedData.m_breakInside = initialBreakInside(); 320 m_nonInheritedData.m_breakInside = initialBreakInside();
323 m_nonInheritedData.m_styleType = PseudoIdNone; 321 m_nonInheritedData.m_styleType = PseudoIdNone;
324 m_nonInheritedData.m_pseudoBits = 0; 322 m_nonInheritedData.m_pseudoBits = 0;
325 m_nonInheritedData.m_explicitInheritance = false; 323 m_nonInheritedData.m_explicitInheritance = false;
326 m_nonInheritedData.m_variableReference = false; 324 m_nonInheritedData.m_variableReference = false;
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after
759 } 757 }
760 void setBoxShadow(PassRefPtr<ShadowList>); 758 void setBoxShadow(PassRefPtr<ShadowList>);
761 759
762 // box-sizing (aka -webkit-box-sizing) 760 // box-sizing (aka -webkit-box-sizing)
763 static EBoxSizing initialBoxSizing() { return EBoxSizing::kContentBox; } 761 static EBoxSizing initialBoxSizing() { return EBoxSizing::kContentBox; }
764 EBoxSizing boxSizing() const { return m_box->boxSizing(); } 762 EBoxSizing boxSizing() const { return m_box->boxSizing(); }
765 void setBoxSizing(EBoxSizing s) { 763 void setBoxSizing(EBoxSizing s) {
766 SET_VAR(m_box, m_boxSizing, static_cast<unsigned>(s)); 764 SET_VAR(m_box, m_boxSizing, static_cast<unsigned>(s));
767 } 765 }
768 766
769 // clear
770 static EClear initialClear() { return EClear::kNone; }
771 EClear clear() const {
772 return static_cast<EClear>(m_nonInheritedData.m_clear);
773 }
774 void setClear(EClear v) {
775 m_nonInheritedData.m_clear = static_cast<unsigned>(v);
776 }
777
778 // Page break properties. 767 // Page break properties.
779 // break-after (shorthand for page-break-after and -webkit-column-break-after) 768 // break-after (shorthand for page-break-after and -webkit-column-break-after)
780 static EBreak initialBreakAfter() { return BreakAuto; } 769 static EBreak initialBreakAfter() { return BreakAuto; }
781 EBreak breakAfter() const { 770 EBreak breakAfter() const {
782 return static_cast<EBreak>(m_nonInheritedData.m_breakAfter); 771 return static_cast<EBreak>(m_nonInheritedData.m_breakAfter);
783 } 772 }
784 void setBreakAfter(EBreak b) { 773 void setBreakAfter(EBreak b) {
785 DCHECK_LE(b, BreakValueLastAllowedForBreakAfterAndBefore); 774 DCHECK_LE(b, BreakValueLastAllowedForBreakAfterAndBefore);
786 m_nonInheritedData.m_breakAfter = b; 775 m_nonInheritedData.m_breakAfter = b;
787 } 776 }
(...skipping 3161 matching lines...) Expand 10 before | Expand all | Expand 10 after
3949 m_nonInheritedData.m_pseudoBits |= 1 << (pseudo - 1); 3938 m_nonInheritedData.m_pseudoBits |= 1 << (pseudo - 1);
3950 } 3939 }
3951 3940
3952 inline bool ComputedStyle::hasPseudoElementStyle() const { 3941 inline bool ComputedStyle::hasPseudoElementStyle() const {
3953 return m_nonInheritedData.m_pseudoBits & ElementPseudoIdMask; 3942 return m_nonInheritedData.m_pseudoBits & ElementPseudoIdMask;
3954 } 3943 }
3955 3944
3956 } // namespace blink 3945 } // namespace blink
3957 3946
3958 #endif // ComputedStyle_h 3947 #endif // ComputedStyle_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSProperties.json5 ('k') | third_party/WebKit/Source/core/style/ComputedStyle.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698