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

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

Issue 2882103002: Make ELineBreak an enum class. (Closed)
Patch Set: Rebase 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 1843 matching lines...) Expand 10 before | Expand all | Expand 10 after
1854 // word-break inherited (aka -epub-word-break) 1854 // word-break inherited (aka -epub-word-break)
1855 static EWordBreak InitialWordBreak() { return kNormalWordBreak; } 1855 static EWordBreak InitialWordBreak() { return kNormalWordBreak; }
1856 EWordBreak WordBreak() const { 1856 EWordBreak WordBreak() const {
1857 return static_cast<EWordBreak>(rare_inherited_data_->word_break_); 1857 return static_cast<EWordBreak>(rare_inherited_data_->word_break_);
1858 } 1858 }
1859 void SetWordBreak(EWordBreak b) { 1859 void SetWordBreak(EWordBreak b) {
1860 SET_VAR(rare_inherited_data_, word_break_, b); 1860 SET_VAR(rare_inherited_data_, word_break_, b);
1861 } 1861 }
1862 1862
1863 // -webkit-line-break 1863 // -webkit-line-break
1864 static LineBreak InitialLineBreak() { return kLineBreakAuto; } 1864 static LineBreak InitialLineBreak() { return LineBreak::kAuto; }
1865 LineBreak GetLineBreak() const { 1865 LineBreak GetLineBreak() const {
1866 return static_cast<LineBreak>(rare_inherited_data_->line_break_); 1866 return static_cast<LineBreak>(rare_inherited_data_->line_break_);
1867 } 1867 }
1868 void SetLineBreak(LineBreak b) { 1868 void SetLineBreak(LineBreak b) {
1869 SET_VAR(rare_inherited_data_, line_break_, b); 1869 SET_VAR(rare_inherited_data_, line_break_, static_cast<unsigned>(b));
1870 } 1870 }
1871 1871
1872 // Text emphasis properties. 1872 // Text emphasis properties.
1873 static TextEmphasisFill InitialTextEmphasisFill() { 1873 static TextEmphasisFill InitialTextEmphasisFill() {
1874 return kTextEmphasisFillFilled; 1874 return kTextEmphasisFillFilled;
1875 } 1875 }
1876 static TextEmphasisMark InitialTextEmphasisMark() { 1876 static TextEmphasisMark InitialTextEmphasisMark() {
1877 return kTextEmphasisMarkNone; 1877 return kTextEmphasisMarkNone;
1878 } 1878 }
1879 static const AtomicString& InitialTextEmphasisCustomMark() { 1879 static const AtomicString& InitialTextEmphasisCustomMark() {
(...skipping 1510 matching lines...) Expand 10 before | Expand all | Expand 10 after
3390 case ' ': 3390 case ' ':
3391 case '\t': 3391 case '\t':
3392 return CollapseWhiteSpace(); 3392 return CollapseWhiteSpace();
3393 case '\n': 3393 case '\n':
3394 return !PreserveNewline(); 3394 return !PreserveNewline();
3395 } 3395 }
3396 return false; 3396 return false;
3397 } 3397 }
3398 bool BreakOnlyAfterWhiteSpace() const { 3398 bool BreakOnlyAfterWhiteSpace() const {
3399 return WhiteSpace() == EWhiteSpace::kPreWrap || 3399 return WhiteSpace() == EWhiteSpace::kPreWrap ||
3400 GetLineBreak() == kLineBreakAfterWhiteSpace; 3400 GetLineBreak() == LineBreak::kAfterWhiteSpace;
3401 } 3401 }
3402 3402
3403 bool BreakWords() const { 3403 bool BreakWords() const {
3404 return (WordBreak() == kBreakWordBreak || 3404 return (WordBreak() == kBreakWordBreak ||
3405 OverflowWrap() == kBreakOverflowWrap) && 3405 OverflowWrap() == kBreakOverflowWrap) &&
3406 WhiteSpace() != EWhiteSpace::kPre && 3406 WhiteSpace() != EWhiteSpace::kPre &&
3407 WhiteSpace() != EWhiteSpace::kNowrap; 3407 WhiteSpace() != EWhiteSpace::kNowrap;
3408 } 3408 }
3409 3409
3410 // Text direction utility functions. 3410 // Text direction utility functions.
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after
3821 PseudoBitsInternal() | 1 << (pseudo - kFirstPublicPseudoId))); 3821 PseudoBitsInternal() | 1 << (pseudo - kFirstPublicPseudoId)));
3822 } 3822 }
3823 3823
3824 inline bool ComputedStyle::HasPseudoElementStyle() const { 3824 inline bool ComputedStyle::HasPseudoElementStyle() const {
3825 return PseudoBitsInternal() & kElementPseudoIdMask; 3825 return PseudoBitsInternal() & kElementPseudoIdMask;
3826 } 3826 }
3827 3827
3828 } // namespace blink 3828 } // namespace blink
3829 3829
3830 #endif // ComputedStyle_h 3830 #endif // ComputedStyle_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/line/InlineTextBox.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