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

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

Issue 2943983002: [LayoutNG] Implement CSS 'text-indent' property (Closed)
Patch Set: Cleanup 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
« no previous file with comments | « third_party/WebKit/Source/core/style/ComputedStyle.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org) 2 * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org)
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights
4 * reserved. 4 * reserved.
5 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. 5 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 1278 matching lines...) Expand 10 before | Expand all | Expand 10 after
1289 case ETextAlignLast::kAuto: 1289 case ETextAlignLast::kAuto:
1290 ETextAlign text_align = GetTextAlign(); 1290 ETextAlign text_align = GetTextAlign();
1291 if (text_align == ETextAlign::kJustify) 1291 if (text_align == ETextAlign::kJustify)
1292 return ETextAlign::kStart; 1292 return ETextAlign::kStart;
1293 return text_align; 1293 return text_align;
1294 } 1294 }
1295 NOTREACHED(); 1295 NOTREACHED();
1296 return GetTextAlign(); 1296 return GetTextAlign();
1297 } 1297 }
1298 1298
1299 bool ComputedStyle::ShouldUseTextIndent(bool is_first_line,
1300 bool is_after_forced_break) const {
1301 bool should_use =
1302 is_first_line || (is_after_forced_break &&
1303 GetTextIndentLine() != TextIndentLine::kFirstLine);
1304 return TextIndentType() == TextIndentType::kNormal ? should_use : !should_use;
Nico 2017/09/15 19:33:57 Is this meant to call GetTextIndentType()? As-is,
kojii 2017/09/16 05:25:21 Thanks, you're right, I'll send a fix.
1305 }
1306
1299 const AtomicString& ComputedStyle::TextEmphasisMarkString() const { 1307 const AtomicString& ComputedStyle::TextEmphasisMarkString() const {
1300 switch (GetTextEmphasisMark()) { 1308 switch (GetTextEmphasisMark()) {
1301 case TextEmphasisMark::kNone: 1309 case TextEmphasisMark::kNone:
1302 return g_null_atom; 1310 return g_null_atom;
1303 case TextEmphasisMark::kCustom: 1311 case TextEmphasisMark::kCustom:
1304 return TextEmphasisCustomMark(); 1312 return TextEmphasisCustomMark();
1305 case TextEmphasisMark::kDot: { 1313 case TextEmphasisMark::kDot: {
1306 DEFINE_STATIC_LOCAL(AtomicString, filled_dot_string, 1314 DEFINE_STATIC_LOCAL(AtomicString, filled_dot_string,
1307 (&kBulletCharacter, 1)); 1315 (&kBulletCharacter, 1));
1308 DEFINE_STATIC_LOCAL(AtomicString, open_dot_string, 1316 DEFINE_STATIC_LOCAL(AtomicString, open_dot_string,
(...skipping 900 matching lines...) Expand 10 before | Expand all | Expand 10 after
2209 if (value < 0) 2217 if (value < 0)
2210 fvalue -= 0.5f; 2218 fvalue -= 0.5f;
2211 else 2219 else
2212 fvalue += 0.5f; 2220 fvalue += 0.5f;
2213 } 2221 }
2214 2222
2215 return RoundForImpreciseConversion<int>(fvalue / zoom_factor); 2223 return RoundForImpreciseConversion<int>(fvalue / zoom_factor);
2216 } 2224 }
2217 2225
2218 } // namespace blink 2226 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/style/ComputedStyle.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698