OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2008 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 * | 7 * |
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 2158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2169 return toLayoutTextControl(m_layoutObject)->textFormControlElement()->vi
siblePositionForIndex(index); | 2169 return toLayoutTextControl(m_layoutObject)->textFormControlElement()->vi
siblePositionForIndex(index); |
2170 | 2170 |
2171 if (!allowsTextRanges() && !m_layoutObject->isText()) | 2171 if (!allowsTextRanges() && !m_layoutObject->isText()) |
2172 return VisiblePosition(); | 2172 return VisiblePosition(); |
2173 | 2173 |
2174 Node* node = m_layoutObject->node(); | 2174 Node* node = m_layoutObject->node(); |
2175 if (!node) | 2175 if (!node) |
2176 return VisiblePosition(); | 2176 return VisiblePosition(); |
2177 | 2177 |
2178 if (index <= 0) | 2178 if (index <= 0) |
2179 return VisiblePosition(firstPositionInOrBeforeNode(node), DOWNSTREAM); | 2179 return VisiblePosition(firstPositionInOrBeforeNode(node)); |
2180 | 2180 |
2181 Position start, end; | 2181 Position start, end; |
2182 bool selected = Range::selectNodeContents(node, start, end); | 2182 bool selected = Range::selectNodeContents(node, start, end); |
2183 if (!selected) | 2183 if (!selected) |
2184 return VisiblePosition(); | 2184 return VisiblePosition(); |
2185 | 2185 |
2186 CharacterIterator it(start, end); | 2186 CharacterIterator it(start, end); |
2187 it.advance(index - 1); | 2187 it.advance(index - 1); |
2188 return VisiblePosition(Position(it.currentContainer(), it.endOffset()), UPST
REAM); | 2188 return VisiblePosition(Position(it.currentContainer(), it.endOffset()), UPST
REAM); |
2189 } | 2189 } |
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2644 if (label && label->layoutObject()) { | 2644 if (label && label->layoutObject()) { |
2645 LayoutRect labelRect = axObjectCache().getOrCreate(label)->elementRe
ct(); | 2645 LayoutRect labelRect = axObjectCache().getOrCreate(label)->elementRe
ct(); |
2646 result.unite(labelRect); | 2646 result.unite(labelRect); |
2647 } | 2647 } |
2648 } | 2648 } |
2649 | 2649 |
2650 return result; | 2650 return result; |
2651 } | 2651 } |
2652 | 2652 |
2653 } // namespace blink | 2653 } // namespace blink |
OLD | NEW |