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 2472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2483 RefPtr<Range> range = Range::create(m_renderer->document()); | 2483 RefPtr<Range> range = Range::create(m_renderer->document()); |
2484 range->selectNodeContents(node, ec); | 2484 range->selectNodeContents(node, ec); |
2485 CharacterIterator it(range.get()); | 2485 CharacterIterator it(range.get()); |
2486 it.advance(index - 1); | 2486 it.advance(index - 1); |
2487 return VisiblePosition(Position(it.range()->endContainer(ec), it.range()->en
dOffset(ec), Position::PositionIsOffsetInAnchor), UPSTREAM); | 2487 return VisiblePosition(Position(it.range()->endContainer(ec), it.range()->en
dOffset(ec), Position::PositionIsOffsetInAnchor), UPSTREAM); |
2488 } | 2488 } |
2489 | 2489 |
2490 int AccessibilityRenderObject::indexForVisiblePosition(const VisiblePosition& po
s) const | 2490 int AccessibilityRenderObject::indexForVisiblePosition(const VisiblePosition& po
s) const |
2491 { | 2491 { |
2492 if (isNativeTextControl()) | 2492 if (isNativeTextControl()) |
2493 return toRenderTextControl(m_renderer)->indexForVisiblePosition(pos); | 2493 return RenderTextControl::indexForVisiblePosition(toRenderTextControl(m_
renderer)->innerTextElement(), pos); |
2494 | 2494 |
2495 if (!isTextControl()) | 2495 if (!isTextControl()) |
2496 return 0; | 2496 return 0; |
2497 | 2497 |
2498 Node* node = m_renderer->node(); | 2498 Node* node = m_renderer->node(); |
2499 if (!node) | 2499 if (!node) |
2500 return 0; | 2500 return 0; |
2501 | 2501 |
2502 Position indexPosition = pos.deepEquivalent(); | 2502 Position indexPosition = pos.deepEquivalent(); |
2503 if (!indexPosition.anchorNode() || indexPosition.anchorNode()->rootEditableE
lement() != node) | 2503 if (!indexPosition.anchorNode() || indexPosition.anchorNode()->rootEditableE
lement() != node) |
(...skipping 1234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3738 | 3738 |
3739 m_roleForMSAA = msaaRoleForRenderer(m_renderer); | 3739 m_roleForMSAA = msaaRoleForRenderer(m_renderer); |
3740 | 3740 |
3741 if (m_roleForMSAA == UnknownRole) | 3741 if (m_roleForMSAA == UnknownRole) |
3742 m_roleForMSAA = roleValue(); | 3742 m_roleForMSAA = roleValue(); |
3743 | 3743 |
3744 return m_roleForMSAA; | 3744 return m_roleForMSAA; |
3745 } | 3745 } |
3746 | 3746 |
3747 } // namespace WebCore | 3747 } // namespace WebCore |
OLD | NEW |