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

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

Issue 2949453002: Make EFlexDirection an enum class. (Closed)
Patch Set: Fix Created 3 years, 6 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 722 matching lines...) Expand 10 before | Expand all | Expand 10 after
733 static Length InitialFlexBasis() { return Length(kAuto); } 733 static Length InitialFlexBasis() { return Length(kAuto); }
734 const Length& FlexBasis() const { 734 const Length& FlexBasis() const {
735 return rare_non_inherited_data_->flexible_box_data_->flex_basis_; 735 return rare_non_inherited_data_->flexible_box_data_->flex_basis_;
736 } 736 }
737 void SetFlexBasis(const Length& length) { 737 void SetFlexBasis(const Length& length) {
738 SET_NESTED_VAR(rare_non_inherited_data_, flexible_box_data_, flex_basis_, 738 SET_NESTED_VAR(rare_non_inherited_data_, flexible_box_data_, flex_basis_,
739 length); 739 length);
740 } 740 }
741 741
742 // flex-direction (aka -webkit-flex-direction) 742 // flex-direction (aka -webkit-flex-direction)
743 static EFlexDirection InitialFlexDirection() { return kFlowRow; } 743 static EFlexDirection InitialFlexDirection() { return EFlexDirection::kRow; }
744 EFlexDirection FlexDirection() const { 744 EFlexDirection FlexDirection() const {
745 return static_cast<EFlexDirection>( 745 return static_cast<EFlexDirection>(
746 rare_non_inherited_data_->flexible_box_data_->flex_direction_); 746 rare_non_inherited_data_->flexible_box_data_->flex_direction_);
747 } 747 }
748 void SetFlexDirection(EFlexDirection direction) { 748 void SetFlexDirection(EFlexDirection direction) {
749 SET_NESTED_VAR(rare_non_inherited_data_, flexible_box_data_, 749 SET_NESTED_VAR(rare_non_inherited_data_, flexible_box_data_,
750 flex_direction_, direction); 750 flex_direction_, static_cast<unsigned>(direction));
751 } 751 }
752 752
753 // flex-grow (aka -webkit-flex-grow) 753 // flex-grow (aka -webkit-flex-grow)
754 static float InitialFlexGrow() { return 0; } 754 static float InitialFlexGrow() { return 0; }
755 float FlexGrow() const { 755 float FlexGrow() const {
756 return rare_non_inherited_data_->flexible_box_data_->flex_grow_; 756 return rare_non_inherited_data_->flexible_box_data_->flex_grow_;
757 } 757 }
758 void SetFlexGrow(float f) { 758 void SetFlexGrow(float f) {
759 SET_NESTED_VAR(rare_non_inherited_data_, flexible_box_data_, flex_grow_, f); 759 SET_NESTED_VAR(rare_non_inherited_data_, flexible_box_data_, flex_grow_, f);
760 } 760 }
(...skipping 1281 matching lines...) Expand 10 before | Expand all | Expand 10 after
2042 .IsTransparent(); 2042 .IsTransparent();
2043 } 2043 }
2044 bool ColumnRuleEquivalent(const ComputedStyle* other_style) const; 2044 bool ColumnRuleEquivalent(const ComputedStyle* other_style) const;
2045 void InheritColumnPropertiesFrom(const ComputedStyle& parent) { 2045 void InheritColumnPropertiesFrom(const ComputedStyle& parent) {
2046 rare_non_inherited_data_.Access()->multi_col_data_ = 2046 rare_non_inherited_data_.Access()->multi_col_data_ =
2047 parent.rare_non_inherited_data_->multi_col_data_; 2047 parent.rare_non_inherited_data_->multi_col_data_;
2048 } 2048 }
2049 2049
2050 // Flex utility functions. 2050 // Flex utility functions.
2051 bool IsColumnFlexDirection() const { 2051 bool IsColumnFlexDirection() const {
2052 return FlexDirection() == kFlowColumn || 2052 return FlexDirection() == EFlexDirection::kColumn ||
2053 FlexDirection() == kFlowColumnReverse; 2053 FlexDirection() == EFlexDirection::kColumnReverse;
2054 } 2054 }
2055 bool IsReverseFlexDirection() const { 2055 bool IsReverseFlexDirection() const {
2056 return FlexDirection() == kFlowRowReverse || 2056 return FlexDirection() == EFlexDirection::kRowReverse ||
2057 FlexDirection() == kFlowColumnReverse; 2057 FlexDirection() == EFlexDirection::kColumnReverse;
2058 } 2058 }
2059 bool HasBoxReflect() const { return BoxReflect(); } 2059 bool HasBoxReflect() const { return BoxReflect(); }
2060 bool ReflectionDataEquivalent(const ComputedStyle& other) const { 2060 bool ReflectionDataEquivalent(const ComputedStyle& other) const {
2061 return DataEquivalent(BoxReflect(), other.BoxReflect()); 2061 return DataEquivalent(BoxReflect(), other.BoxReflect());
2062 } 2062 }
2063 2063
2064 // Mask utility functions. 2064 // Mask utility functions.
2065 bool HasMask() const { 2065 bool HasMask() const {
2066 return rare_non_inherited_data_->mask_.HasImage() || 2066 return rare_non_inherited_data_->mask_.HasImage() ||
2067 rare_non_inherited_data_->mask_box_image_.HasImage(); 2067 rare_non_inherited_data_->mask_box_image_.HasImage();
(...skipping 1496 matching lines...) Expand 10 before | Expand all | Expand 10 after
3564 PseudoBitsInternal() | 1 << (pseudo - kFirstPublicPseudoId))); 3564 PseudoBitsInternal() | 1 << (pseudo - kFirstPublicPseudoId)));
3565 } 3565 }
3566 3566
3567 inline bool ComputedStyle::HasPseudoElementStyle() const { 3567 inline bool ComputedStyle::HasPseudoElementStyle() const {
3568 return PseudoBitsInternal() & kElementPseudoIdMask; 3568 return PseudoBitsInternal() & kElementPseudoIdMask;
3569 } 3569 }
3570 3570
3571 } // namespace blink 3571 } // namespace blink
3572 3572
3573 #endif // ComputedStyle_h 3573 #endif // ComputedStyle_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698