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

Side by Side Diff: third_party/WebKit/Source/core/layout/line/InlineTextBox.cpp

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 * (C) 1999 Lars Knoll (knoll@kde.org) 2 * (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 2000 Dirk Mueller (mueller@kde.org) 3 * (C) 2000 Dirk Mueller (mueller@kde.org)
4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. 4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc.
5 * All rights reserved. 5 * 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 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 if (state == SelectionStart || state == SelectionEnd || 176 if (state == SelectionStart || state == SelectionEnd ||
177 state == SelectionBoth) { 177 state == SelectionBoth) {
178 int start_pos, end_pos; 178 int start_pos, end_pos;
179 std::tie(start_pos, end_pos) = GetLineLayoutItem().SelectionStartEnd(); 179 std::tie(start_pos, end_pos) = GetLineLayoutItem().SelectionStartEnd();
180 // The position after a hard line break is considered to be past its end. 180 // The position after a hard line break is considered to be past its end.
181 // See the corresponding code in InlineTextBox::isSelected. 181 // See the corresponding code in InlineTextBox::isSelected.
182 int last_selectable = Start() + Len() - (IsLineBreak() ? 1 : 0); 182 int last_selectable = Start() + Len() - (IsLineBreak() ? 1 : 0);
183 183
184 // FIXME: Remove -webkit-line-break: LineBreakAfterWhiteSpace. 184 // FIXME: Remove -webkit-line-break: LineBreakAfterWhiteSpace.
185 int end_of_line_adjustment_for_css_line_break = 185 int end_of_line_adjustment_for_css_line_break =
186 GetLineLayoutItem().Style()->GetLineBreak() == kLineBreakAfterWhiteSpace 186 GetLineLayoutItem().Style()->GetLineBreak() ==
187 LineBreak::kAfterWhiteSpace
187 ? -1 188 ? -1
188 : 0; 189 : 0;
189 bool start = (state != SelectionEnd && start_pos >= start_ && 190 bool start = (state != SelectionEnd && start_pos >= start_ &&
190 start_pos <= start_ + len_ + 191 start_pos <= start_ + len_ +
191 end_of_line_adjustment_for_css_line_break); 192 end_of_line_adjustment_for_css_line_break);
192 bool end = (state != SelectionStart && end_pos > start_ && 193 bool end = (state != SelectionStart && end_pos > start_ &&
193 end_pos <= last_selectable); 194 end_pos <= last_selectable);
194 if (start && end) 195 if (start && end)
195 state = SelectionBoth; 196 state = SelectionBoth;
196 else if (start) 197 else if (start)
(...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after
760 for (; printed_characters < kLayoutObjectCharacterOffset; 761 for (; printed_characters < kLayoutObjectCharacterOffset;
761 printed_characters++) 762 printed_characters++)
762 fputc(' ', stderr); 763 fputc(' ', stderr);
763 fprintf(stderr, "(%d,%d) \"%s\"\n", Start(), Start() + Len(), 764 fprintf(stderr, "(%d,%d) \"%s\"\n", Start(), Start() + Len(),
764 value.Utf8().data()); 765 value.Utf8().data());
765 } 766 }
766 767
767 #endif 768 #endif
768 769
769 } // namespace blink 770 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSPrimitiveValueMappings.h ('k') | third_party/WebKit/Source/core/style/ComputedStyle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698