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

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

Issue 2682573002: Split EBreak enum into EBreakBetween & EBreakInside (Closed)
Patch Set: Update references to EBreak in ComputedStyle.h comments 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 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 unsigned m_verticalAlign : 4; // EVerticalAlign 256 unsigned m_verticalAlign : 4; // EVerticalAlign
257 unsigned m_position : 3; // EPosition 257 unsigned m_position : 3; // EPosition
258 258
259 // This is set if we used viewport units when resolving a length. 259 // This is set if we used viewport units when resolving a length.
260 // It is mutable so we can pass around const ComputedStyles to resolve 260 // It is mutable so we can pass around const ComputedStyles to resolve
261 // lengths. 261 // lengths.
262 mutable unsigned m_hasViewportUnits : 1; 262 mutable unsigned m_hasViewportUnits : 1;
263 263
264 // 32 bits 264 // 32 bits
265 265
266 unsigned m_breakBefore : 4; // EBreak 266 unsigned m_breakBefore : 4; // EBreakBetween
267 unsigned m_breakAfter : 4; // EBreak 267 unsigned m_breakAfter : 4; // EBreakBetween
268 unsigned m_breakInside : 2; // EBreak 268 unsigned m_breakInside : 2; // EBreakInside
269 269
270 unsigned m_styleType : 6; // PseudoId 270 unsigned m_styleType : 6; // PseudoId
271 unsigned m_pseudoBits : 8; 271 unsigned m_pseudoBits : 8;
272 unsigned m_explicitInheritance : 1; // Explicitly inherits a non-inherited 272 unsigned m_explicitInheritance : 1; // Explicitly inherits a non-inherited
273 // property 273 // property
274 unsigned m_variableReference : 1; // A non-inherited property references a 274 unsigned m_variableReference : 1; // A non-inherited property references a
275 // variable or @apply is used. 275 // variable or @apply is used.
276 unsigned m_unique : 1; // Style can not be shared. 276 unsigned m_unique : 1; // Style can not be shared.
277 277
278 unsigned m_emptyState : 1; 278 unsigned m_emptyState : 1;
(...skipping 24 matching lines...) Expand all
303 static_cast<unsigned>(EInsideLink::kNotInsideLink); 303 static_cast<unsigned>(EInsideLink::kNotInsideLink);
304 304
305 m_nonInheritedData.m_effectiveDisplay = 305 m_nonInheritedData.m_effectiveDisplay =
306 m_nonInheritedData.m_originalDisplay = 306 m_nonInheritedData.m_originalDisplay =
307 static_cast<unsigned>(initialDisplay()); 307 static_cast<unsigned>(initialDisplay());
308 m_nonInheritedData.m_overflowX = static_cast<unsigned>(initialOverflowX()); 308 m_nonInheritedData.m_overflowX = static_cast<unsigned>(initialOverflowX());
309 m_nonInheritedData.m_overflowY = static_cast<unsigned>(initialOverflowY()); 309 m_nonInheritedData.m_overflowY = static_cast<unsigned>(initialOverflowY());
310 m_nonInheritedData.m_verticalAlign = 310 m_nonInheritedData.m_verticalAlign =
311 static_cast<unsigned>(initialVerticalAlign()); 311 static_cast<unsigned>(initialVerticalAlign());
312 m_nonInheritedData.m_position = initialPosition(); 312 m_nonInheritedData.m_position = initialPosition();
313 m_nonInheritedData.m_breakBefore = initialBreakBefore(); 313 m_nonInheritedData.m_breakBefore =
314 m_nonInheritedData.m_breakAfter = initialBreakAfter(); 314 static_cast<unsigned>(initialBreakBefore());
315 m_nonInheritedData.m_breakInside = initialBreakInside(); 315 m_nonInheritedData.m_breakAfter =
316 static_cast<unsigned>(initialBreakAfter());
317 m_nonInheritedData.m_breakInside =
318 static_cast<unsigned>(initialBreakInside());
316 m_nonInheritedData.m_styleType = PseudoIdNone; 319 m_nonInheritedData.m_styleType = PseudoIdNone;
317 m_nonInheritedData.m_pseudoBits = 0; 320 m_nonInheritedData.m_pseudoBits = 0;
318 m_nonInheritedData.m_explicitInheritance = false; 321 m_nonInheritedData.m_explicitInheritance = false;
319 m_nonInheritedData.m_variableReference = false; 322 m_nonInheritedData.m_variableReference = false;
320 m_nonInheritedData.m_unique = false; 323 m_nonInheritedData.m_unique = false;
321 m_nonInheritedData.m_emptyState = false; 324 m_nonInheritedData.m_emptyState = false;
322 m_nonInheritedData.m_hasViewportUnits = false; 325 m_nonInheritedData.m_hasViewportUnits = false;
323 m_nonInheritedData.m_affectedByFocus = false; 326 m_nonInheritedData.m_affectedByFocus = false;
324 m_nonInheritedData.m_affectedByHover = false; 327 m_nonInheritedData.m_affectedByHover = false;
325 m_nonInheritedData.m_affectedByActive = false; 328 m_nonInheritedData.m_affectedByActive = false;
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after
754 757
755 // box-sizing (aka -webkit-box-sizing) 758 // box-sizing (aka -webkit-box-sizing)
756 static EBoxSizing initialBoxSizing() { return EBoxSizing::kContentBox; } 759 static EBoxSizing initialBoxSizing() { return EBoxSizing::kContentBox; }
757 EBoxSizing boxSizing() const { return m_box->boxSizing(); } 760 EBoxSizing boxSizing() const { return m_box->boxSizing(); }
758 void setBoxSizing(EBoxSizing s) { 761 void setBoxSizing(EBoxSizing s) {
759 SET_VAR(m_box, m_boxSizing, static_cast<unsigned>(s)); 762 SET_VAR(m_box, m_boxSizing, static_cast<unsigned>(s));
760 } 763 }
761 764
762 // Page break properties. 765 // Page break properties.
763 // break-after (shorthand for page-break-after and -webkit-column-break-after) 766 // break-after (shorthand for page-break-after and -webkit-column-break-after)
764 static EBreak initialBreakAfter() { return BreakAuto; } 767 static EBreakBetween initialBreakAfter() { return EBreakBetween::kAuto; }
765 EBreak breakAfter() const { 768 EBreakBetween breakAfter() const {
766 return static_cast<EBreak>(m_nonInheritedData.m_breakAfter); 769 return static_cast<EBreakBetween>(m_nonInheritedData.m_breakAfter);
767 } 770 }
768 void setBreakAfter(EBreak b) { 771 void setBreakAfter(EBreakBetween b) {
769 m_nonInheritedData.m_breakAfter = b; 772 m_nonInheritedData.m_breakAfter = static_cast<unsigned>(b);
770 } 773 }
771 774
772 // break-before (shorthand for page-break-before and 775 // break-before (shorthand for page-break-before and
773 // -webkit-column-break-before) 776 // -webkit-column-break-before)
774 static EBreak initialBreakBefore() { return BreakAuto; } 777 static EBreakBetween initialBreakBefore() { return EBreakBetween::kAuto; }
775 EBreak breakBefore() const { 778 EBreakBetween breakBefore() const {
776 return static_cast<EBreak>(m_nonInheritedData.m_breakBefore); 779 return static_cast<EBreakBetween>(m_nonInheritedData.m_breakBefore);
777 } 780 }
778 void setBreakBefore(EBreak b) { 781 void setBreakBefore(EBreakBetween b) {
779 m_nonInheritedData.m_breakBefore = b; 782 m_nonInheritedData.m_breakBefore = static_cast<unsigned>(b);
780 } 783 }
781 784
782 // break-inside (shorthand for page-break-inside and 785 // break-inside (shorthand for page-break-inside and
783 // -webkit-column-break-inside) 786 // -webkit-column-break-inside)
784 static EBreak initialBreakInside() { return BreakAuto; } 787 static EBreakInside initialBreakInside() { return EBreakInside::kAuto; }
785 EBreak breakInside() const { 788 EBreakInside breakInside() const {
786 return static_cast<EBreak>(m_nonInheritedData.m_breakInside); 789 return static_cast<EBreakInside>(m_nonInheritedData.m_breakInside);
787 } 790 }
788 void setBreakInside(EBreak b) { 791 void setBreakInside(EBreakInside b) {
789 DCHECK_LE(b, BreakValueLastAllowedForBreakInside); 792 m_nonInheritedData.m_breakInside = static_cast<unsigned>(b);
790 m_nonInheritedData.m_breakInside = b;
791 } 793 }
792 794
793 // clip 795 // clip
794 static LengthBox initialClip() { return LengthBox(); } 796 static LengthBox initialClip() { return LengthBox(); }
795 const LengthBox& clip() const { return m_visual->clip; } 797 const LengthBox& clip() const { return m_visual->clip; }
796 void setClip(const LengthBox& box) { 798 void setClip(const LengthBox& box) {
797 SET_VAR(m_visual, hasAutoClip, false); 799 SET_VAR(m_visual, hasAutoClip, false);
798 SET_VAR(m_visual, clip, box); 800 SET_VAR(m_visual, clip, box);
799 } 801 }
800 bool hasAutoClip() const { return m_visual->hasAutoClip; } 802 bool hasAutoClip() const { return m_visual->hasAutoClip; }
(...skipping 3113 matching lines...) Expand 10 before | Expand all | Expand 10 after
3914 m_nonInheritedData.m_pseudoBits |= 1 << (pseudo - 1); 3916 m_nonInheritedData.m_pseudoBits |= 1 << (pseudo - 1);
3915 } 3917 }
3916 3918
3917 inline bool ComputedStyle::hasPseudoElementStyle() const { 3919 inline bool ComputedStyle::hasPseudoElementStyle() const {
3918 return m_nonInheritedData.m_pseudoBits & ElementPseudoIdMask; 3920 return m_nonInheritedData.m_pseudoBits & ElementPseudoIdMask;
3919 } 3921 }
3920 3922
3921 } // namespace blink 3923 } // namespace blink
3922 3924
3923 #endif // ComputedStyle_h 3925 #endif // ComputedStyle_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBox.cpp ('k') | third_party/WebKit/Source/core/style/ComputedStyleConstants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698