OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2006, 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2004, 2005, 2006, 2009 Apple 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 921 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
932 } | 932 } |
933 if (box->containsCaretOffset(m_offset)) { | 933 if (box->containsCaretOffset(m_offset)) { |
934 // Return false for offsets inside composed characters. | 934 // Return false for offsets inside composed characters. |
935 return m_offset == 0 || m_offset == textLayoutObject->nextOffset(tex
tLayoutObject->previousOffset(m_offset)); | 935 return m_offset == 0 || m_offset == textLayoutObject->nextOffset(tex
tLayoutObject->previousOffset(m_offset)); |
936 } | 936 } |
937 } | 937 } |
938 | 938 |
939 return false; | 939 return false; |
940 } | 940 } |
941 | 941 |
942 bool isRenderedCharacter(const Position& position) | |
943 { | |
944 if (position.isNull()) | |
945 return false; | |
946 ASSERT(position.isOffsetInAnchor()); | |
947 if (!position.anchorNode()->isTextNode()) | |
948 return false; | |
949 | |
950 LayoutObject* layoutObject = position.anchorNode()->layoutObject(); | |
951 if (!layoutObject) | |
952 return false; | |
953 | |
954 return toLayoutText(layoutObject)->isRenderedCharacter(position.offsetInCont
ainerNode()); | |
955 } | |
956 | |
957 template <typename Strategy> | 942 template <typename Strategy> |
958 InlineBoxPosition PositionAlgorithm<Strategy>::computeInlineBoxPosition(TextAffi
nity affinity) const | 943 InlineBoxPosition PositionAlgorithm<Strategy>::computeInlineBoxPosition(TextAffi
nity affinity) const |
959 { | 944 { |
960 return computeInlineBoxPosition(affinity, primaryDirectionOf(*anchorNode()))
; | 945 return computeInlineBoxPosition(affinity, primaryDirectionOf(*anchorNode()))
; |
961 } | 946 } |
962 | 947 |
963 static bool isNonTextLeafChild(LayoutObject* object) | 948 static bool isNonTextLeafChild(LayoutObject* object) |
964 { | 949 { |
965 if (object->slowFirstChild()) | 950 if (object->slowFirstChild()) |
966 return false; | 951 return false; |
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1360 | 1345 |
1361 void showTree(const blink::Position* pos) | 1346 void showTree(const blink::Position* pos) |
1362 { | 1347 { |
1363 if (pos) | 1348 if (pos) |
1364 pos->showTreeForThis(); | 1349 pos->showTreeForThis(); |
1365 else | 1350 else |
1366 fprintf(stderr, "Cannot showTree for (nil)\n"); | 1351 fprintf(stderr, "Cannot showTree for (nil)\n"); |
1367 } | 1352 } |
1368 | 1353 |
1369 #endif | 1354 #endif |
OLD | NEW |