| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights | 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights |
| 3 * reserved. | 3 * reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 m_selection.setBase(start); | 123 m_selection.setBase(start); |
| 124 m_selection.setExtent(end); | 124 m_selection.setExtent(end); |
| 125 } else { | 125 } else { |
| 126 m_selection.setBase(end); | 126 m_selection.setBase(end); |
| 127 m_selection.setExtent(start); | 127 m_selection.setExtent(start); |
| 128 } | 128 } |
| 129 } | 129 } |
| 130 | 130 |
| 131 VisiblePosition SelectionModifier::positionForPlatform(bool isGetStart) const { | 131 VisiblePosition SelectionModifier::positionForPlatform(bool isGetStart) const { |
| 132 Settings* settings = frame() ? frame()->settings() : nullptr; | 132 Settings* settings = frame() ? frame()->settings() : nullptr; |
| 133 if (settings && settings->editingBehaviorType() == EditingMacBehavior) | 133 if (settings && settings->getEditingBehaviorType() == EditingMacBehavior) |
| 134 return isGetStart ? m_selection.visibleStart() : m_selection.visibleEnd(); | 134 return isGetStart ? m_selection.visibleStart() : m_selection.visibleEnd(); |
| 135 // Linux and Windows always extend selections from the extent endpoint. | 135 // Linux and Windows always extend selections from the extent endpoint. |
| 136 // FIXME: VisibleSelection should be fixed to ensure as an invariant that | 136 // FIXME: VisibleSelection should be fixed to ensure as an invariant that |
| 137 // base/extent always point to the same nodes as start/end, but which points | 137 // base/extent always point to the same nodes as start/end, but which points |
| 138 // to which depends on the value of isBaseFirst. Then this can be changed | 138 // to which depends on the value of isBaseFirst. Then this can be changed |
| 139 // to just return m_sel.extent(). | 139 // to just return m_sel.extent(). |
| 140 return m_selection.isBaseFirst() ? m_selection.visibleEnd() | 140 return m_selection.isBaseFirst() ? m_selection.visibleEnd() |
| 141 : m_selection.visibleStart(); | 141 : m_selection.visibleStart(); |
| 142 } | 142 } |
| 143 | 143 |
| (...skipping 723 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 867 | 867 |
| 868 return x; | 868 return x; |
| 869 } | 869 } |
| 870 | 870 |
| 871 DEFINE_TRACE(SelectionModifier) { | 871 DEFINE_TRACE(SelectionModifier) { |
| 872 visitor->trace(m_frame); | 872 visitor->trace(m_frame); |
| 873 visitor->trace(m_selection); | 873 visitor->trace(m_selection); |
| 874 } | 874 } |
| 875 | 875 |
| 876 } // namespace blink | 876 } // namespace blink |
| OLD | NEW |