OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv
ed. | 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv
ed. |
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 878 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
889 bool isStartOfLine(const VisiblePosition &p) | 889 bool isStartOfLine(const VisiblePosition &p) |
890 { | 890 { |
891 return p.isNotNull() && p == startOfLine(p); | 891 return p.isNotNull() && p == startOfLine(p); |
892 } | 892 } |
893 | 893 |
894 bool isEndOfLine(const VisiblePosition &p) | 894 bool isEndOfLine(const VisiblePosition &p) |
895 { | 895 { |
896 return p.isNotNull() && p == endOfLine(p); | 896 return p.isNotNull() && p == endOfLine(p); |
897 } | 897 } |
898 | 898 |
| 899 bool isLogicalEndOfLine(const VisiblePosition &p) |
| 900 { |
| 901 return p.isNotNull() && p == logicalEndOfLine(p); |
| 902 } |
| 903 |
899 static inline IntPoint absoluteLineDirectionPointToLocalPointInBlock(RootInlineB
ox* root, int lineDirectionPoint) | 904 static inline IntPoint absoluteLineDirectionPointToLocalPointInBlock(RootInlineB
ox* root, int lineDirectionPoint) |
900 { | 905 { |
901 ASSERT(root); | 906 ASSERT(root); |
902 RenderBlockFlow& containingBlock = root->block(); | 907 RenderBlockFlow& containingBlock = root->block(); |
903 FloatPoint absoluteBlockPoint = containingBlock.localToAbsolute(FloatPoint()
); | 908 FloatPoint absoluteBlockPoint = containingBlock.localToAbsolute(FloatPoint()
); |
904 if (containingBlock.hasOverflowClip()) | 909 if (containingBlock.hasOverflowClip()) |
905 absoluteBlockPoint -= containingBlock.scrolledContentOffset(); | 910 absoluteBlockPoint -= containingBlock.scrolledContentOffset(); |
906 | 911 |
907 if (root->block().isHorizontalWritingMode()) | 912 if (root->block().isHorizontalWritingMode()) |
908 return IntPoint(lineDirectionPoint - absoluteBlockPoint.x(), root->block
DirectionPointInLine()); | 913 return IntPoint(lineDirectionPoint - absoluteBlockPoint.x(), root->block
DirectionPointInLine()); |
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1402 int caretOffset; | 1407 int caretOffset; |
1403 position.position().getInlineBoxAndOffset(position.affinity(), inlineBox, ca
retOffset); | 1408 position.position().getInlineBoxAndOffset(position.affinity(), inlineBox, ca
retOffset); |
1404 | 1409 |
1405 if (inlineBox) | 1410 if (inlineBox) |
1406 renderer = &inlineBox->renderer(); | 1411 renderer = &inlineBox->renderer(); |
1407 | 1412 |
1408 return renderer->localCaretRect(inlineBox, caretOffset); | 1413 return renderer->localCaretRect(inlineBox, caretOffset); |
1409 } | 1414 } |
1410 | 1415 |
1411 } | 1416 } |
OLD | NEW |