OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 { | 77 { |
78 AXObjectCache::enableAccessibility(); | 78 AXObjectCache::enableAccessibility(); |
79 } | 79 } |
80 | 80 |
81 // static | 81 // static |
82 bool WebAXObject::accessibilityEnabled() | 82 bool WebAXObject::accessibilityEnabled() |
83 { | 83 { |
84 return AXObjectCache::accessibilityEnabled(); | 84 return AXObjectCache::accessibilityEnabled(); |
85 } | 85 } |
86 | 86 |
| 87 // static |
| 88 void WebAXObject::enableInlineTextBoxAccessibility() |
| 89 { |
| 90 AXObjectCache::setInlineTextBoxAccessibility(true); |
| 91 } |
| 92 |
87 void WebAXObject::startCachingComputedObjectAttributesUntilTreeMutates() | 93 void WebAXObject::startCachingComputedObjectAttributesUntilTreeMutates() |
88 { | 94 { |
89 m_private->axObjectCache()->startCachingComputedObjectAttributesUntilTreeMut
ates(); | 95 m_private->axObjectCache()->startCachingComputedObjectAttributesUntilTreeMut
ates(); |
90 } | 96 } |
91 | 97 |
92 void WebAXObject::stopCachingComputedObjectAttributes() | 98 void WebAXObject::stopCachingComputedObjectAttributes() |
93 { | 99 { |
94 m_private->axObjectCache()->stopCachingComputedObjectAttributes(); | 100 m_private->axObjectCache()->stopCachingComputedObjectAttributes(); |
95 } | 101 } |
96 | 102 |
(...skipping 888 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
985 return 0; | 991 return 0; |
986 | 992 |
987 if (!m_private->isTableCell()) | 993 if (!m_private->isTableCell()) |
988 return 0; | 994 return 0; |
989 | 995 |
990 pair<unsigned, unsigned> rowRange; | 996 pair<unsigned, unsigned> rowRange; |
991 WebCore::toAXTableCell(m_private.get())->rowIndexRange(rowRange); | 997 WebCore::toAXTableCell(m_private.get())->rowIndexRange(rowRange); |
992 return rowRange.second; | 998 return rowRange.second; |
993 } | 999 } |
994 | 1000 |
| 1001 WebAXTextDirection WebAXObject::textDirection() const |
| 1002 { |
| 1003 if (isDetached()) |
| 1004 return WebAXTextDirectionLR; |
| 1005 |
| 1006 return static_cast<WebAXTextDirection>(m_private->textDirection()); |
| 1007 } |
| 1008 |
| 1009 void WebAXObject::characterOffsets(WebVector<int>& offsets) const |
| 1010 { |
| 1011 if (isDetached()) |
| 1012 return; |
| 1013 |
| 1014 Vector<int> offsetsVector; |
| 1015 m_private->textCharacterOffsets(offsetsVector); |
| 1016 |
| 1017 size_t vectorSize = offsetsVector.size(); |
| 1018 WebVector<int> offsetsWebVector(vectorSize); |
| 1019 for (size_t i = 0; i < vectorSize; i++) |
| 1020 offsetsWebVector[i] = offsetsVector[i]; |
| 1021 offsets.swap(offsetsWebVector); |
| 1022 } |
| 1023 |
| 1024 void WebAXObject::wordBoundaries(WebVector<int>& starts, WebVector<int>& ends) c
onst |
| 1025 { |
| 1026 if (isDetached()) |
| 1027 return; |
| 1028 |
| 1029 Vector<PlainTextRange> words; |
| 1030 m_private->wordBoundaries(words); |
| 1031 |
| 1032 WebVector<int> startsWebVector(words.size()); |
| 1033 WebVector<int> endsWebVector(words.size()); |
| 1034 for (size_t i = 0; i < words.size(); i++) { |
| 1035 startsWebVector[i] = words[i].start; |
| 1036 endsWebVector[i] = words[i].start + words[i].length; |
| 1037 } |
| 1038 starts.swap(startsWebVector); |
| 1039 ends.swap(endsWebVector); |
| 1040 } |
| 1041 |
995 void WebAXObject::scrollToMakeVisible() const | 1042 void WebAXObject::scrollToMakeVisible() const |
996 { | 1043 { |
997 if (!isDetached()) | 1044 if (!isDetached()) |
998 m_private->scrollToMakeVisible(); | 1045 m_private->scrollToMakeVisible(); |
999 } | 1046 } |
1000 | 1047 |
1001 void WebAXObject::scrollToMakeVisibleWithSubFocus(const WebRect& subfocus) const | 1048 void WebAXObject::scrollToMakeVisibleWithSubFocus(const WebRect& subfocus) const |
1002 { | 1049 { |
1003 if (!isDetached()) | 1050 if (!isDetached()) |
1004 m_private->scrollToMakeVisibleWithSubFocus(subfocus); | 1051 m_private->scrollToMakeVisibleWithSubFocus(subfocus); |
(...skipping 15 matching lines...) Expand all Loading... |
1020 m_private = object; | 1067 m_private = object; |
1021 return *this; | 1068 return *this; |
1022 } | 1069 } |
1023 | 1070 |
1024 WebAXObject::operator WTF::PassRefPtr<WebCore::AXObject>() const | 1071 WebAXObject::operator WTF::PassRefPtr<WebCore::AXObject>() const |
1025 { | 1072 { |
1026 return m_private.get(); | 1073 return m_private.get(); |
1027 } | 1074 } |
1028 | 1075 |
1029 } // namespace WebKit | 1076 } // namespace WebKit |
OLD | NEW |