| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |