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

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

Issue 2877333002: Make EWordBreak an enum class. (Closed)
Patch Set: Release Created 3 years, 7 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 1751 matching lines...) Expand 10 before | Expand all | Expand 10 after
1762 return TextSizeAdjust::AdjustAuto(); 1762 return TextSizeAdjust::AdjustAuto();
1763 } 1763 }
1764 TextSizeAdjust GetTextSizeAdjust() const { 1764 TextSizeAdjust GetTextSizeAdjust() const {
1765 return rare_inherited_data_->text_size_adjust_; 1765 return rare_inherited_data_->text_size_adjust_;
1766 } 1766 }
1767 void SetTextSizeAdjust(TextSizeAdjust size_adjust) { 1767 void SetTextSizeAdjust(TextSizeAdjust size_adjust) {
1768 SET_VAR(rare_inherited_data_, text_size_adjust_, size_adjust); 1768 SET_VAR(rare_inherited_data_, text_size_adjust_, size_adjust);
1769 } 1769 }
1770 1770
1771 // word-break inherited (aka -epub-word-break) 1771 // word-break inherited (aka -epub-word-break)
1772 static EWordBreak InitialWordBreak() { return kNormalWordBreak; } 1772 static EWordBreak InitialWordBreak() { return EWordBreak::kNormal; }
1773 EWordBreak WordBreak() const { 1773 EWordBreak WordBreak() const {
1774 return static_cast<EWordBreak>(rare_inherited_data_->word_break_); 1774 return static_cast<EWordBreak>(rare_inherited_data_->word_break_);
1775 } 1775 }
1776 void SetWordBreak(EWordBreak b) { 1776 void SetWordBreak(EWordBreak b) {
1777 SET_VAR(rare_inherited_data_, word_break_, b); 1777 SET_VAR(rare_inherited_data_, word_break_, static_cast<unsigned>(b));
1778 } 1778 }
1779 1779
1780 // -webkit-line-break 1780 // -webkit-line-break
1781 static LineBreak InitialLineBreak() { return LineBreak::kAuto; } 1781 static LineBreak InitialLineBreak() { return LineBreak::kAuto; }
1782 LineBreak GetLineBreak() const { 1782 LineBreak GetLineBreak() const {
1783 return static_cast<LineBreak>(rare_inherited_data_->line_break_); 1783 return static_cast<LineBreak>(rare_inherited_data_->line_break_);
1784 } 1784 }
1785 void SetLineBreak(LineBreak b) { 1785 void SetLineBreak(LineBreak b) {
1786 SET_VAR(rare_inherited_data_, line_break_, static_cast<unsigned>(b)); 1786 SET_VAR(rare_inherited_data_, line_break_, static_cast<unsigned>(b));
1787 } 1787 }
(...skipping 1573 matching lines...) Expand 10 before | Expand all | Expand 10 after
3361 return !PreserveNewline(); 3361 return !PreserveNewline();
3362 } 3362 }
3363 return false; 3363 return false;
3364 } 3364 }
3365 bool BreakOnlyAfterWhiteSpace() const { 3365 bool BreakOnlyAfterWhiteSpace() const {
3366 return WhiteSpace() == EWhiteSpace::kPreWrap || 3366 return WhiteSpace() == EWhiteSpace::kPreWrap ||
3367 GetLineBreak() == LineBreak::kAfterWhiteSpace; 3367 GetLineBreak() == LineBreak::kAfterWhiteSpace;
3368 } 3368 }
3369 3369
3370 bool BreakWords() const { 3370 bool BreakWords() const {
3371 return (WordBreak() == kBreakWordBreak || 3371 return (WordBreak() == EWordBreak::kBreakWord ||
3372 OverflowWrap() == EOverflowWrap::kBreakWord) && 3372 OverflowWrap() == EOverflowWrap::kBreakWord) &&
3373 WhiteSpace() != EWhiteSpace::kPre && 3373 WhiteSpace() != EWhiteSpace::kPre &&
3374 WhiteSpace() != EWhiteSpace::kNowrap; 3374 WhiteSpace() != EWhiteSpace::kNowrap;
3375 } 3375 }
3376 3376
3377 // Text direction utility functions. 3377 // Text direction utility functions.
3378 bool ShouldPlaceBlockDirectionScrollbarOnLogicalLeft() const { 3378 bool ShouldPlaceBlockDirectionScrollbarOnLogicalLeft() const {
3379 return !IsLeftToRightDirection() && IsHorizontalWritingMode(); 3379 return !IsLeftToRightDirection() && IsHorizontalWritingMode();
3380 } 3380 }
3381 bool HasInlinePaginationAxis() const { 3381 bool HasInlinePaginationAxis() const {
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after
3780 PseudoBitsInternal() | 1 << (pseudo - kFirstPublicPseudoId))); 3780 PseudoBitsInternal() | 1 << (pseudo - kFirstPublicPseudoId)));
3781 } 3781 }
3782 3782
3783 inline bool ComputedStyle::HasPseudoElementStyle() const { 3783 inline bool ComputedStyle::HasPseudoElementStyle() const {
3784 return PseudoBitsInternal() & kElementPseudoIdMask; 3784 return PseudoBitsInternal() & kElementPseudoIdMask;
3785 } 3785 }
3786 3786
3787 } // namespace blink 3787 } // namespace blink
3788 3788
3789 #endif // ComputedStyle_h 3789 #endif // ComputedStyle_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698