| 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 2481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2492 RefPtr<Range> range = Range::create(m_renderer->document()); | 2492 RefPtr<Range> range = Range::create(m_renderer->document()); |
| 2493 range->selectNodeContents(node, ec); | 2493 range->selectNodeContents(node, ec); |
| 2494 CharacterIterator it(range.get()); | 2494 CharacterIterator it(range.get()); |
| 2495 it.advance(index - 1); | 2495 it.advance(index - 1); |
| 2496 return VisiblePosition(Position(it.range()->endContainer(ec), it.range()->en
dOffset(ec), Position::PositionIsOffsetInAnchor), UPSTREAM); | 2496 return VisiblePosition(Position(it.range()->endContainer(ec), it.range()->en
dOffset(ec), Position::PositionIsOffsetInAnchor), UPSTREAM); |
| 2497 } | 2497 } |
| 2498 | 2498 |
| 2499 int AccessibilityRenderObject::indexForVisiblePosition(const VisiblePosition& po
s) const | 2499 int AccessibilityRenderObject::indexForVisiblePosition(const VisiblePosition& po
s) const |
| 2500 { | 2500 { |
| 2501 if (isNativeTextControl()) | 2501 if (isNativeTextControl()) |
| 2502 return toRenderTextControl(m_renderer)->indexForVisiblePosition(pos); | 2502 return RenderTextControl::indexForVisiblePosition(toRenderTextControl(m_
renderer)->innerTextElement(), pos); |
| 2503 | 2503 |
| 2504 if (!isTextControl()) | 2504 if (!isTextControl()) |
| 2505 return 0; | 2505 return 0; |
| 2506 | 2506 |
| 2507 Node* node = m_renderer->node(); | 2507 Node* node = m_renderer->node(); |
| 2508 if (!node) | 2508 if (!node) |
| 2509 return 0; | 2509 return 0; |
| 2510 | 2510 |
| 2511 Position indexPosition = pos.deepEquivalent(); | 2511 Position indexPosition = pos.deepEquivalent(); |
| 2512 if (!indexPosition.anchorNode() || indexPosition.anchorNode()->rootEditableE
lement() != node) | 2512 if (!indexPosition.anchorNode() || indexPosition.anchorNode()->rootEditableE
lement() != node) |
| (...skipping 1235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3748 | 3748 |
| 3749 m_roleForMSAA = msaaRoleForRenderer(m_renderer); | 3749 m_roleForMSAA = msaaRoleForRenderer(m_renderer); |
| 3750 | 3750 |
| 3751 if (m_roleForMSAA == UnknownRole) | 3751 if (m_roleForMSAA == UnknownRole) |
| 3752 m_roleForMSAA = roleValue(); | 3752 m_roleForMSAA = roleValue(); |
| 3753 | 3753 |
| 3754 return m_roleForMSAA; | 3754 return m_roleForMSAA; |
| 3755 } | 3755 } |
| 3756 | 3756 |
| 3757 } // namespace WebCore | 3757 } // namespace WebCore |
| OLD | NEW |