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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 virtual Node* node() const OVERRIDE { return m_optionElement; } | 59 virtual Node* node() const OVERRIDE { return m_optionElement; } |
60 virtual void setSelected(bool) OVERRIDE; | 60 virtual void setSelected(bool) OVERRIDE; |
61 virtual bool canSetSelectedAttribute() const OVERRIDE; | 61 virtual bool canSetSelectedAttribute() const OVERRIDE; |
62 | 62 |
63 virtual LayoutRect elementRect() const OVERRIDE; | 63 virtual LayoutRect elementRect() const OVERRIDE; |
64 virtual AccessibilityObject* parentObject() const OVERRIDE; | 64 virtual AccessibilityObject* parentObject() const OVERRIDE; |
65 | 65 |
66 private: | 66 private: |
67 HTMLElement* m_optionElement; | 67 HTMLElement* m_optionElement; |
68 | 68 |
| 69 virtual bool isListBoxOption() const OVERRIDE { return true; } |
69 virtual bool canHaveChildren() const OVERRIDE { return false; } | 70 virtual bool canHaveChildren() const OVERRIDE { return false; } |
70 virtual bool computeAccessibilityIsIgnored() const OVERRIDE; | 71 virtual bool computeAccessibilityIsIgnored() const OVERRIDE; |
71 | 72 |
72 HTMLSelectElement* listBoxOptionParentNode() const; | 73 HTMLSelectElement* listBoxOptionParentNode() const; |
73 int listBoxOptionIndex() const; | 74 int listBoxOptionIndex() const; |
74 AccessibilityObject* listBoxOptionAccessibilityObject(HTMLElement*) const; | 75 AccessibilityObject* listBoxOptionAccessibilityObject(HTMLElement*) const; |
75 }; | 76 }; |
76 | 77 |
| 78 inline AccessibilityListBoxOption* toAccessibilityListBoxOption(AccessibilityObj
ect* object) |
| 79 { |
| 80 ASSERT_WITH_SECURITY_IMPLICATION(!object || object->isListBoxOption()); |
| 81 return static_cast<AccessibilityListBoxOption*>(object); |
| 82 } |
| 83 |
| 84 inline const AccessibilityListBoxOption* toAccessibilityListBoxOption(const Acce
ssibilityObject* object) |
| 85 { |
| 86 ASSERT_WITH_SECURITY_IMPLICATION(!object || object->isListBoxOption()); |
| 87 return static_cast<const AccessibilityListBoxOption*>(object); |
| 88 } |
| 89 |
| 90 // This will catch anyone doing an unnecessary cast. |
| 91 void toAccessibilityListBoxOption(const AccessibilityListBoxOption*); |
| 92 |
77 } // namespace WebCore | 93 } // namespace WebCore |
78 | 94 |
79 #endif // AccessibilityListBoxOption_h | 95 #endif // AccessibilityListBoxOption_h |
OLD | NEW |