OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. All rights reserved. | 2 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
354 // General case: Select the word the caret is positioned inside of, or at the start of (RightWordIfOnBoundary). | 354 // General case: Select the word the caret is positioned inside of, or at the start of (RightWordIfOnBoundary). |
355 // Edge case: If the caret is after the last word in a soft-wrapped line or the last word in | 355 // Edge case: If the caret is after the last word in a soft-wrapped line or the last word in |
356 // the document, select that last word (LeftWordIfOnBoundary). | 356 // the document, select that last word (LeftWordIfOnBoundary). |
357 // Edge case: If the caret is after the last word in a paragraph, se lect from the the end of the | 357 // Edge case: If the caret is after the last word in a paragraph, se lect from the the end of the |
358 // last word to the line break (also RightWordIfOnBoundary); | 358 // last word to the line break (also RightWordIfOnBoundary); |
359 VisiblePosition start = VisiblePosition(m_start, m_affinity); | 359 VisiblePosition start = VisiblePosition(m_start, m_affinity); |
360 VisiblePosition originalEnd(m_end, m_affinity); | 360 VisiblePosition originalEnd(m_end, m_affinity); |
361 EWordSide side = RightWordIfOnBoundary; | 361 EWordSide side = RightWordIfOnBoundary; |
362 if (isEndOfEditableOrNonEditableContent(start) || (isEndOfLine(start ) && !isStartOfLine(start) && !isEndOfParagraph(start))) | 362 if (isEndOfEditableOrNonEditableContent(start) || (isEndOfLine(start ) && !isStartOfLine(start) && !isEndOfParagraph(start))) |
363 side = LeftWordIfOnBoundary; | 363 side = LeftWordIfOnBoundary; |
364 if (isContentEditable() || (isEndOfLine(start) && !isStartOfLine(sta rt) && isEndOfParagraph(start))) | |
yosin_UTC9
2014/08/25 01:10:25
This function should select word rather than colla
| |
365 side = RightWordIfOnBoundary; | |
364 m_start = startOfWord(start, side).deepEquivalent(); | 366 m_start = startOfWord(start, side).deepEquivalent(); |
365 side = RightWordIfOnBoundary; | 367 side = RightWordIfOnBoundary; |
366 if (isEndOfEditableOrNonEditableContent(originalEnd) || (isEndOfLine (originalEnd) && !isStartOfLine(originalEnd) && !isEndOfParagraph(originalEnd))) | 368 if (isEndOfEditableOrNonEditableContent(originalEnd) || (isEndOfLine (originalEnd) && !isStartOfLine(originalEnd) && !isEndOfParagraph(originalEnd))) |
367 side = LeftWordIfOnBoundary; | 369 side = LeftWordIfOnBoundary; |
368 | 370 |
369 VisiblePosition wordEnd(endOfWord(originalEnd, side)); | 371 VisiblePosition wordEnd(endOfWord(originalEnd, side)); |
370 VisiblePosition end(wordEnd); | 372 VisiblePosition end(wordEnd); |
371 | 373 |
372 if (isEndOfParagraph(originalEnd) && !isEmptyTableCell(m_start.depre catedNode())) { | 374 if (isEndOfParagraph(originalEnd) && !isEmptyTableCell(m_start.depre catedNode())) { |
373 // Select the paragraph break (the space from the end of a parag raph to the start of | 375 // Select the paragraph break (the space from the end of a parag raph to the start of |
(...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
857 sel.showTreeForThis(); | 859 sel.showTreeForThis(); |
858 } | 860 } |
859 | 861 |
860 void showTree(const WebCore::VisibleSelection* sel) | 862 void showTree(const WebCore::VisibleSelection* sel) |
861 { | 863 { |
862 if (sel) | 864 if (sel) |
863 sel->showTreeForThis(); | 865 sel->showTreeForThis(); |
864 } | 866 } |
865 | 867 |
866 #endif | 868 #endif |
OLD | NEW |