Index: Source/core/accessibility/AccessibilityListBoxOption.h |
diff --git a/Source/core/accessibility/AccessibilityListBoxOption.h b/Source/core/accessibility/AccessibilityListBoxOption.h |
index 987b5bc7754e8fa5279bce11abb6c1e6f1762a6e..364273dc830d6091318ba06c361103a99b21dc58 100644 |
--- a/Source/core/accessibility/AccessibilityListBoxOption.h |
+++ b/Source/core/accessibility/AccessibilityListBoxOption.h |
@@ -66,6 +66,7 @@ public: |
private: |
HTMLElement* m_optionElement; |
+ virtual bool isListBoxOption() const OVERRIDE { return true; } |
virtual bool canHaveChildren() const OVERRIDE { return false; } |
virtual bool computeAccessibilityIsIgnored() const OVERRIDE; |
@@ -74,6 +75,21 @@ private: |
AccessibilityObject* listBoxOptionAccessibilityObject(HTMLElement*) const; |
}; |
+inline AccessibilityListBoxOption* toAccessibilityListBoxOption(AccessibilityObject* object) |
+{ |
+ ASSERT_WITH_SECURITY_IMPLICATION(!object || object->isListBoxOption()); |
+ return static_cast<AccessibilityListBoxOption*>(object); |
+} |
+ |
+inline const AccessibilityListBoxOption* toAccessibilityListBoxOption(const AccessibilityObject* object) |
+{ |
+ ASSERT_WITH_SECURITY_IMPLICATION(!object || object->isListBoxOption()); |
+ return static_cast<const AccessibilityListBoxOption*>(object); |
+} |
+ |
+// This will catch anyone doing an unnecessary cast. |
+void toAccessibilityListBoxOption(const AccessibilityListBoxOption*); |
+ |
} // namespace WebCore |
#endif // AccessibilityListBoxOption_h |