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

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

Issue 2667493002: Changed EPosition to an enum class and renamed its members (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 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 m_inheritedData.m_hasSimpleUnderline = false; 298 m_inheritedData.m_hasSimpleUnderline = false;
299 m_inheritedData.m_cursorStyle = static_cast<unsigned>(initialCursor()); 299 m_inheritedData.m_cursorStyle = static_cast<unsigned>(initialCursor());
300 m_inheritedData.m_insideLink = 300 m_inheritedData.m_insideLink =
301 static_cast<unsigned>(EInsideLink::kNotInsideLink); 301 static_cast<unsigned>(EInsideLink::kNotInsideLink);
302 302
303 m_nonInheritedData.m_effectiveDisplay = 303 m_nonInheritedData.m_effectiveDisplay =
304 m_nonInheritedData.m_originalDisplay = 304 m_nonInheritedData.m_originalDisplay =
305 static_cast<unsigned>(initialDisplay()); 305 static_cast<unsigned>(initialDisplay());
306 m_nonInheritedData.m_verticalAlign = 306 m_nonInheritedData.m_verticalAlign =
307 static_cast<unsigned>(initialVerticalAlign()); 307 static_cast<unsigned>(initialVerticalAlign());
308 m_nonInheritedData.m_position = initialPosition(); 308 m_nonInheritedData.m_position = static_cast<unsigned>(initialPosition());
309 m_nonInheritedData.m_styleType = PseudoIdNone; 309 m_nonInheritedData.m_styleType = PseudoIdNone;
310 m_nonInheritedData.m_pseudoBits = 0; 310 m_nonInheritedData.m_pseudoBits = 0;
311 m_nonInheritedData.m_explicitInheritance = false; 311 m_nonInheritedData.m_explicitInheritance = false;
312 m_nonInheritedData.m_variableReference = false; 312 m_nonInheritedData.m_variableReference = false;
313 m_nonInheritedData.m_unique = false; 313 m_nonInheritedData.m_unique = false;
314 m_nonInheritedData.m_emptyState = false; 314 m_nonInheritedData.m_emptyState = false;
315 m_nonInheritedData.m_hasViewportUnits = false; 315 m_nonInheritedData.m_hasViewportUnits = false;
316 m_nonInheritedData.m_affectedByFocus = false; 316 m_nonInheritedData.m_affectedByFocus = false;
317 m_nonInheritedData.m_affectedByHover = false; 317 m_nonInheritedData.m_affectedByHover = false;
318 m_nonInheritedData.m_affectedByActive = false; 318 m_nonInheritedData.m_affectedByActive = false;
(...skipping 1157 matching lines...) Expand 10 before | Expand all | Expand 10 after
1476 } 1476 }
1477 1477
1478 // -webkit-perspective-origin-y 1478 // -webkit-perspective-origin-y
1479 static Length initialPerspectiveOriginY() { return Length(50.0, Percent); } 1479 static Length initialPerspectiveOriginY() { return Length(50.0, Percent); }
1480 const Length& perspectiveOriginY() const { return perspectiveOrigin().y(); } 1480 const Length& perspectiveOriginY() const { return perspectiveOrigin().y(); }
1481 void setPerspectiveOriginY(const Length& v) { 1481 void setPerspectiveOriginY(const Length& v) {
1482 setPerspectiveOrigin(LengthPoint(perspectiveOriginX(), v)); 1482 setPerspectiveOrigin(LengthPoint(perspectiveOriginX(), v));
1483 } 1483 }
1484 1484
1485 // position 1485 // position
1486 static EPosition initialPosition() { return StaticPosition; } 1486 static EPosition initialPosition() { return EPosition::kStatic; }
1487 EPosition position() const { 1487 EPosition position() const {
1488 return static_cast<EPosition>(m_nonInheritedData.m_position); 1488 return static_cast<EPosition>(m_nonInheritedData.m_position);
1489 } 1489 }
1490 void setPosition(EPosition v) { m_nonInheritedData.m_position = v; } 1490 void setPosition(EPosition v) {
1491 m_nonInheritedData.m_position = static_cast<unsigned>(v);
1492 }
1491 1493
1492 // resize 1494 // resize
1493 static EResize initialResize() { return RESIZE_NONE; } 1495 static EResize initialResize() { return RESIZE_NONE; }
1494 EResize resize() const { 1496 EResize resize() const {
1495 return static_cast<EResize>(m_rareNonInheritedData->m_resize); 1497 return static_cast<EResize>(m_rareNonInheritedData->m_resize);
1496 } 1498 }
1497 void setResize(EResize r) { SET_VAR(m_rareNonInheritedData, m_resize, r); } 1499 void setResize(EResize r) { SET_VAR(m_rareNonInheritedData, m_resize, r); }
1498 1500
1499 // Transform properties. 1501 // Transform properties.
1500 // transform (aka -webkit-transform) 1502 // transform (aka -webkit-transform)
(...skipping 1692 matching lines...) Expand 10 before | Expand all | Expand 10 after
3193 3195
3194 // Outline utility functions. 3196 // Outline utility functions.
3195 bool hasOutline() const { 3197 bool hasOutline() const {
3196 return outlineWidth() > 0 && outlineStyle() > BorderStyleHidden; 3198 return outlineWidth() > 0 && outlineStyle() > BorderStyleHidden;
3197 } 3199 }
3198 int outlineOutsetExtent() const; 3200 int outlineOutsetExtent() const;
3199 float getOutlineStrokeWidthForFocusRing() const; 3201 float getOutlineStrokeWidthForFocusRing() const;
3200 3202
3201 // Position utility functions. 3203 // Position utility functions.
3202 bool hasOutOfFlowPosition() const { 3204 bool hasOutOfFlowPosition() const {
3203 return position() == AbsolutePosition || position() == FixedPosition; 3205 return position() == EPosition::kAbsolute ||
3206 position() == EPosition::kFixed;
3204 } 3207 }
3205 bool hasInFlowPosition() const { 3208 bool hasInFlowPosition() const {
3206 return position() == RelativePosition || position() == StickyPosition; 3209 return position() == EPosition::kRelative ||
3210 position() == EPosition::kSticky;
3207 } 3211 }
3208 bool hasViewportConstrainedPosition() const { 3212 bool hasViewportConstrainedPosition() const {
3209 return position() == FixedPosition || position() == StickyPosition; 3213 return position() == EPosition::kFixed || position() == EPosition::kSticky;
3210 } 3214 }
3211 3215
3212 // Clip utility functions. 3216 // Clip utility functions.
3213 const Length& clipLeft() const { return m_visual->clip.left(); } 3217 const Length& clipLeft() const { return m_visual->clip.left(); }
3214 const Length& clipRight() const { return m_visual->clip.right(); } 3218 const Length& clipRight() const { return m_visual->clip.right(); }
3215 const Length& clipTop() const { return m_visual->clip.top(); } 3219 const Length& clipTop() const { return m_visual->clip.top(); }
3216 const Length& clipBottom() const { return m_visual->clip.bottom(); } 3220 const Length& clipBottom() const { return m_visual->clip.bottom(); }
3217 3221
3218 // Offset utility functions. 3222 // Offset utility functions.
3219 // Accessors for positioned object edges that take into account writing mode. 3223 // Accessors for positioned object edges that take into account writing mode.
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
3441 // [1] According to CSS2.1, Appendix E.2.8 3445 // [1] According to CSS2.1, Appendix E.2.8
3442 // (https://www.w3.org/TR/CSS21/zindex.html), 3446 // (https://www.w3.org/TR/CSS21/zindex.html),
3443 // positioned elements with 'z-index: auto' are "treated as if it created a 3447 // positioned elements with 'z-index: auto' are "treated as if it created a
3444 // new stacking context" and z-ordered together with other elements with 3448 // new stacking context" and z-ordered together with other elements with
3445 // 'z-index: 0'. The difference of them from normal stacking contexts is that 3449 // 'z-index: 0'. The difference of them from normal stacking contexts is that
3446 // they don't determine the stacking of the elements underneath them. (Note: 3450 // they don't determine the stacking of the elements underneath them. (Note:
3447 // There are also other elements treated as stacking context during painting, 3451 // There are also other elements treated as stacking context during painting,
3448 // but not managed in stacks. See ObjectPainter::paintAllPhasesAtomically().) 3452 // but not managed in stacks. See ObjectPainter::paintAllPhasesAtomically().)
3449 void updateIsStackingContext(bool isDocumentElement, bool isInTopLayer); 3453 void updateIsStackingContext(bool isDocumentElement, bool isInTopLayer);
3450 bool isStacked() const { 3454 bool isStacked() const {
3451 return isStackingContext() || position() != StaticPosition; 3455 return isStackingContext() || position() != EPosition::kStatic;
3452 } 3456 }
3453 3457
3454 // Pseudo-styles 3458 // Pseudo-styles
3455 bool hasAnyPublicPseudoStyles() const; 3459 bool hasAnyPublicPseudoStyles() const;
3456 bool hasPseudoStyle(PseudoId) const; 3460 bool hasPseudoStyle(PseudoId) const;
3457 void setHasPseudoStyle(PseudoId); 3461 void setHasPseudoStyle(PseudoId);
3458 bool hasUniquePseudoStyle() const; 3462 bool hasUniquePseudoStyle() const;
3459 bool hasPseudoElementStyle() const; 3463 bool hasPseudoElementStyle() const;
3460 3464
3461 // Note: canContainAbsolutePositionObjects should return true if 3465 // Note: canContainAbsolutePositionObjects should return true if
3462 // canContainFixedPositionObjects. We currently never use this value 3466 // canContainFixedPositionObjects. We currently never use this value
3463 // directly, always OR'ing it with canContainFixedPositionObjects. 3467 // directly, always OR'ing it with canContainFixedPositionObjects.
3464 bool canContainAbsolutePositionObjects() const { 3468 bool canContainAbsolutePositionObjects() const {
3465 return position() != StaticPosition; 3469 return position() != EPosition::kStatic;
3466 } 3470 }
3467 bool canContainFixedPositionObjects() const { 3471 bool canContainFixedPositionObjects() const {
3468 return hasTransformRelatedProperty() || containsPaint(); 3472 return hasTransformRelatedProperty() || containsPaint();
3469 } 3473 }
3470 3474
3471 // Whitespace utility functions. 3475 // Whitespace utility functions.
3472 static bool autoWrap(EWhiteSpace ws) { 3476 static bool autoWrap(EWhiteSpace ws) {
3473 // Nowrap and pre don't automatically wrap. 3477 // Nowrap and pre don't automatically wrap.
3474 return ws != EWhiteSpace::kNowrap && ws != EWhiteSpace::kPre; 3478 return ws != EWhiteSpace::kNowrap && ws != EWhiteSpace::kPre;
3475 } 3479 }
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after
3860 m_nonInheritedData.m_pseudoBits |= 1 << (pseudo - 1); 3864 m_nonInheritedData.m_pseudoBits |= 1 << (pseudo - 1);
3861 } 3865 }
3862 3866
3863 inline bool ComputedStyle::hasPseudoElementStyle() const { 3867 inline bool ComputedStyle::hasPseudoElementStyle() const {
3864 return m_nonInheritedData.m_pseudoBits & ElementPseudoIdMask; 3868 return m_nonInheritedData.m_pseudoBits & ElementPseudoIdMask;
3865 } 3869 }
3866 3870
3867 } // namespace blink 3871 } // namespace blink
3868 3872
3869 #endif // ComputedStyle_h 3873 #endif // ComputedStyle_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/paint/PrePaintTreeWalk.cpp ('k') | third_party/WebKit/Source/core/style/ComputedStyle.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698