OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) | 2 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) |
3 * Copyright (C) 2010 Apple Inc. All rights reserved. | 3 * Copyright (C) 2010 Apple Inc. All rights reserved. |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
9 * | 9 * |
10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 // On Mac, selecting backwards by word/line from the middle of a word/line,
and then going | 72 // On Mac, selecting backwards by word/line from the middle of a word/line,
and then going |
73 // forward leaves the caret back in the middle with no selection, instead of
directly selecting | 73 // forward leaves the caret back in the middle with no selection, instead of
directly selecting |
74 // to the other end of the line/word (Unix/Windows behavior). | 74 // to the other end of the line/word (Unix/Windows behavior). |
75 bool shouldExtendSelectionByWordOrLineAcrossCaret() const { return m_type !=
EditingMacBehavior; } | 75 bool shouldExtendSelectionByWordOrLineAcrossCaret() const { return m_type !=
EditingMacBehavior; } |
76 | 76 |
77 // Based on native behavior, when using ctrl(alt)+arrow to move caret by wor
d, ctrl(alt)+left arrow moves caret to | 77 // Based on native behavior, when using ctrl(alt)+arrow to move caret by wor
d, ctrl(alt)+left arrow moves caret to |
78 // immediately before the word in all platforms, for example, the word break
positions are: "|abc |def |hij |opq". | 78 // immediately before the word in all platforms, for example, the word break
positions are: "|abc |def |hij |opq". |
79 // But ctrl+right arrow moves caret to "abc |def |hij |opq" on Windows and "
abc| def| hij| opq|" on Mac and Linux. | 79 // But ctrl+right arrow moves caret to "abc |def |hij |opq" on Windows and "
abc| def| hij| opq|" on Mac and Linux. |
80 bool shouldSkipSpaceWhenMovingRight() const { return m_type == EditingWindow
sBehavior; } | 80 bool shouldSkipSpaceWhenMovingRight() const { return m_type == EditingWindow
sBehavior; } |
81 | 81 |
| 82 // On Mac, undo of delete/forward-delete of text should select the deleted t
ext. On other platforms deleted text |
| 83 // should not be selected and the cursor should be placed where the deletion
started. |
| 84 bool shouldUndoOfDeleteSelectText() const { return m_type == EditingMacBehav
ior; } |
| 85 |
82 private: | 86 private: |
83 EditingBehaviorType m_type; | 87 EditingBehaviorType m_type; |
84 }; | 88 }; |
85 | 89 |
86 } // namespace WebCore | 90 } // namespace WebCore |
87 | 91 |
88 #endif // EditingBehavior_h | 92 #endif // EditingBehavior_h |
OLD | NEW |