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

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

Issue 2910123002: Make TextOrientation an enum class. (Closed)
Patch Set: 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 1739 matching lines...) Expand 10 before | Expand all | Expand 10 after
1750 static TextJustify InitialTextJustify() { return kTextJustifyAuto; } 1750 static TextJustify InitialTextJustify() { return kTextJustifyAuto; }
1751 TextJustify GetTextJustify() const { 1751 TextJustify GetTextJustify() const {
1752 return static_cast<TextJustify>(rare_inherited_data_->text_justify_); 1752 return static_cast<TextJustify>(rare_inherited_data_->text_justify_);
1753 } 1753 }
1754 void SetTextJustify(TextJustify v) { 1754 void SetTextJustify(TextJustify v) {
1755 SET_VAR(rare_inherited_data_, text_justify_, v); 1755 SET_VAR(rare_inherited_data_, text_justify_, v);
1756 } 1756 }
1757 1757
1758 // text-orientation (aka -webkit-text-orientation, -epub-text-orientation) 1758 // text-orientation (aka -webkit-text-orientation, -epub-text-orientation)
1759 static TextOrientation InitialTextOrientation() { 1759 static TextOrientation InitialTextOrientation() {
1760 return kTextOrientationMixed; 1760 return TextOrientation::kMixed;
1761 } 1761 }
1762 TextOrientation GetTextOrientation() const { 1762 TextOrientation GetTextOrientation() const {
1763 return static_cast<TextOrientation>( 1763 return static_cast<TextOrientation>(
1764 rare_inherited_data_->text_orientation_); 1764 rare_inherited_data_->text_orientation_);
1765 } 1765 }
1766 bool SetTextOrientation(TextOrientation); 1766 bool SetTextOrientation(TextOrientation);
1767 1767
1768 // text-shadow 1768 // text-shadow
1769 static ShadowList* InitialTextShadow() { return 0; } 1769 static ShadowList* InitialTextShadow() { return 0; }
1770 ShadowList* TextShadow() const { 1770 ShadowList* TextShadow() const {
(...skipping 2003 matching lines...) Expand 10 before | Expand all | Expand 10 after
3774 inline bool ComputedStyle::IsSharable() const { 3774 inline bool ComputedStyle::IsSharable() const {
3775 if (Unique()) 3775 if (Unique())
3776 return false; 3776 return false;
3777 if (HasUniquePseudoStyle()) 3777 if (HasUniquePseudoStyle())
3778 return false; 3778 return false;
3779 return true; 3779 return true;
3780 } 3780 }
3781 3781
3782 inline bool ComputedStyle::SetTextOrientation( 3782 inline bool ComputedStyle::SetTextOrientation(
3783 TextOrientation text_orientation) { 3783 TextOrientation text_orientation) {
3784 if (compareEqual(rare_inherited_data_->text_orientation_, text_orientation)) 3784 if (compareEqual(rare_inherited_data_->text_orientation_,
3785 static_cast<unsigned>(text_orientation)))
3785 return false; 3786 return false;
3786 3787
3787 rare_inherited_data_.Access()->text_orientation_ = text_orientation; 3788 rare_inherited_data_.Access()->text_orientation_ =
3789 static_cast<unsigned>(text_orientation);
3788 return true; 3790 return true;
3789 } 3791 }
3790 3792
3791 inline bool ComputedStyle::HasAnyPublicPseudoStyles() const { 3793 inline bool ComputedStyle::HasAnyPublicPseudoStyles() const {
3792 return PseudoBitsInternal() != kPseudoIdNone; 3794 return PseudoBitsInternal() != kPseudoIdNone;
3793 } 3795 }
3794 3796
3795 inline bool ComputedStyle::HasPseudoStyle(PseudoId pseudo) const { 3797 inline bool ComputedStyle::HasPseudoStyle(PseudoId pseudo) const {
3796 DCHECK(pseudo >= kFirstPublicPseudoId); 3798 DCHECK(pseudo >= kFirstPublicPseudoId);
3797 DCHECK(pseudo < kFirstInternalPseudoId); 3799 DCHECK(pseudo < kFirstInternalPseudoId);
3798 return (1 << (pseudo - kFirstPublicPseudoId)) & PseudoBitsInternal(); 3800 return (1 << (pseudo - kFirstPublicPseudoId)) & PseudoBitsInternal();
3799 } 3801 }
3800 3802
3801 inline void ComputedStyle::SetHasPseudoStyle(PseudoId pseudo) { 3803 inline void ComputedStyle::SetHasPseudoStyle(PseudoId pseudo) {
3802 DCHECK(pseudo >= kFirstPublicPseudoId); 3804 DCHECK(pseudo >= kFirstPublicPseudoId);
3803 DCHECK(pseudo < kFirstInternalPseudoId); 3805 DCHECK(pseudo < kFirstInternalPseudoId);
3804 // TODO: Fix up this code. It is hard to understand. 3806 // TODO: Fix up this code. It is hard to understand.
3805 SetPseudoBitsInternal(static_cast<PseudoId>( 3807 SetPseudoBitsInternal(static_cast<PseudoId>(
3806 PseudoBitsInternal() | 1 << (pseudo - kFirstPublicPseudoId))); 3808 PseudoBitsInternal() | 1 << (pseudo - kFirstPublicPseudoId)));
3807 } 3809 }
3808 3810
3809 inline bool ComputedStyle::HasPseudoElementStyle() const { 3811 inline bool ComputedStyle::HasPseudoElementStyle() const {
3810 return PseudoBitsInternal() & kElementPseudoIdMask; 3812 return PseudoBitsInternal() & kElementPseudoIdMask;
3811 } 3813 }
3812 3814
3813 } // namespace blink 3815 } // namespace blink
3814 3816
3815 #endif // ComputedStyle_h 3817 #endif // ComputedStyle_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698