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

Side by Side Diff: third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp

Issue 2845773002: Make TextDecoration 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) 2004 Zack Rusin <zack@kde.org> 2 * Copyright (C) 2004 Zack Rusin <zack@kde.org>
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc.
4 * All rights reserved. 4 * All rights reserved.
5 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 5 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
6 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> 6 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com>
7 * Copyright (C) 2011 Sencha, Inc. All rights reserved. 7 * Copyright (C) 2011 Sencha, Inc. All rights reserved.
8 * Copyright (C) 2015 Google Inc. All rights reserved. 8 * Copyright (C) 2015 Google Inc. All rights reserved.
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 1115 matching lines...) Expand 10 before | Expand all | Expand 10 after
1126 static LayoutRect SizingBox(const LayoutObject* layout_object) { 1126 static LayoutRect SizingBox(const LayoutObject* layout_object) {
1127 if (!layout_object->IsBox()) 1127 if (!layout_object->IsBox())
1128 return LayoutRect(); 1128 return LayoutRect();
1129 1129
1130 const LayoutBox* box = ToLayoutBox(layout_object); 1130 const LayoutBox* box = ToLayoutBox(layout_object);
1131 return box->Style()->BoxSizing() == EBoxSizing::kBorderBox 1131 return box->Style()->BoxSizing() == EBoxSizing::kBorderBox
1132 ? box->BorderBoxRect() 1132 ? box->BorderBoxRect()
1133 : box->ComputedCSSContentBoxRect(); 1133 : box->ComputedCSSContentBoxRect();
1134 } 1134 }
1135 1135
1136 static CSSValue* RenderTextDecorationFlagsToCSSValue(int text_decoration) { 1136 static CSSValue* RenderTextDecorationFlagsToCSSValue(
1137 TextDecoration text_decoration) {
1137 // Blink value is ignored. 1138 // Blink value is ignored.
1138 CSSValueList* list = CSSValueList::CreateSpaceSeparated(); 1139 CSSValueList* list = CSSValueList::CreateSpaceSeparated();
1139 if (text_decoration & kTextDecorationUnderline) 1140 if (EnumHasFlags(text_decoration, TextDecoration::kUnderline))
1140 list->Append(*CSSIdentifierValue::Create(CSSValueUnderline)); 1141 list->Append(*CSSIdentifierValue::Create(CSSValueUnderline));
1141 if (text_decoration & kTextDecorationOverline) 1142 if (EnumHasFlags(text_decoration, TextDecoration::kOverline))
1142 list->Append(*CSSIdentifierValue::Create(CSSValueOverline)); 1143 list->Append(*CSSIdentifierValue::Create(CSSValueOverline));
1143 if (text_decoration & kTextDecorationLineThrough) 1144 if (EnumHasFlags(text_decoration, TextDecoration::kLineThrough))
1144 list->Append(*CSSIdentifierValue::Create(CSSValueLineThrough)); 1145 list->Append(*CSSIdentifierValue::Create(CSSValueLineThrough));
1145 1146
1146 if (!list->length()) 1147 if (!list->length())
1147 return CSSIdentifierValue::Create(CSSValueNone); 1148 return CSSIdentifierValue::Create(CSSValueNone);
1148 return list; 1149 return list;
1149 } 1150 }
1150 1151
1151 static CSSValue* ValueForTextDecorationStyle( 1152 static CSSValue* ValueForTextDecorationStyle(
1152 TextDecorationStyle text_decoration_style) { 1153 TextDecorationStyle text_decoration_style) {
1153 switch (text_decoration_style) { 1154 switch (text_decoration_style) {
(...skipping 2594 matching lines...) Expand 10 before | Expand all | Expand 10 after
3748 case CSSPropertyAll: 3749 case CSSPropertyAll:
3749 return nullptr; 3750 return nullptr;
3750 default: 3751 default:
3751 break; 3752 break;
3752 } 3753 }
3753 NOTREACHED(); 3754 NOTREACHED();
3754 return nullptr; 3755 return nullptr;
3755 } 3756 }
3756 3757
3757 } // namespace blink 3758 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698