| 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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 | 85 |
| 86 bool AccessibilityListBoxOption::isSelectedOptionActive() const | 86 bool AccessibilityListBoxOption::isSelectedOptionActive() const |
| 87 { | 87 { |
| 88 HTMLSelectElement* listBoxParentNode = listBoxOptionParentNode(); | 88 HTMLSelectElement* listBoxParentNode = listBoxOptionParentNode(); |
| 89 if (!listBoxParentNode) | 89 if (!listBoxParentNode) |
| 90 return false; | 90 return false; |
| 91 | 91 |
| 92 return listBoxParentNode->activeSelectionEndListIndex() == listBoxOptionInde
x(); | 92 return listBoxParentNode->activeSelectionEndListIndex() == listBoxOptionInde
x(); |
| 93 } | 93 } |
| 94 | 94 |
| 95 LayoutRect AccessibilityListBoxOption::elementRect() const | 95 LayoutRect AccessibilityListBoxOption::elementRect() |
| 96 { | 96 { |
| 97 LayoutRect rect; | 97 LayoutRect rect; |
| 98 if (!m_optionElement) | 98 if (!m_optionElement) |
| 99 return rect; | 99 return rect; |
| 100 | 100 |
| 101 HTMLSelectElement* listBoxParentNode = listBoxOptionParentNode(); | 101 HTMLSelectElement* listBoxParentNode = listBoxOptionParentNode(); |
| 102 if (!listBoxParentNode) | 102 if (!listBoxParentNode) |
| 103 return rect; | 103 return rect; |
| 104 | 104 |
| 105 RenderObject* listBoxRenderer = listBoxParentNode->renderer(); | 105 RenderObject* listBoxRenderer = listBoxParentNode->renderer(); |
| 106 if (!listBoxRenderer) | 106 if (!listBoxRenderer) |
| 107 return rect; | 107 return rect; |
| 108 | 108 |
| 109 LayoutRect parentRect = listBoxRenderer->document()->axObjectCache()->getOrC
reate(listBoxRenderer)->boundingBoxRect(); | 109 LayoutRect parentRect = listBoxRenderer->document()->axObjectCache()->getOrC
reate(listBoxRenderer)->elementRect(); |
| 110 int index = listBoxOptionIndex(); | 110 int index = listBoxOptionIndex(); |
| 111 if (index != -1) | 111 if (index != -1) |
| 112 rect = toRenderListBox(listBoxRenderer)->itemBoundingBoxRect(parentRect.
location(), index); | 112 rect = toRenderListBox(listBoxRenderer)->itemBoundingBoxRect(parentRect.
location(), index); |
| 113 | 113 |
| 114 return rect; | 114 return rect; |
| 115 } | 115 } |
| 116 | 116 |
| 117 bool AccessibilityListBoxOption::computeAccessibilityIsIgnored() const | 117 bool AccessibilityListBoxOption::computeAccessibilityIsIgnored() const |
| 118 { | 118 { |
| 119 if (!m_optionElement) | 119 if (!m_optionElement) |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 const Vector<HTMLElement*>& listItems = selectElement->listItems(); | 219 const Vector<HTMLElement*>& listItems = selectElement->listItems(); |
| 220 unsigned length = listItems.size(); | 220 unsigned length = listItems.size(); |
| 221 for (unsigned i = 0; i < length; i++) | 221 for (unsigned i = 0; i < length; i++) |
| 222 if (listItems[i] == m_optionElement) | 222 if (listItems[i] == m_optionElement) |
| 223 return i; | 223 return i; |
| 224 | 224 |
| 225 return -1; | 225 return -1; |
| 226 } | 226 } |
| 227 | 227 |
| 228 } // namespace WebCore | 228 } // namespace WebCore |
| OLD | NEW |