1 | /* |
2 | * Copyright (C) 2011 Apple Inc. All rights reserved. |
3 | * |
4 | * Redistribution and use in source and binary forms, with or without |
5 | * modification, are permitted provided that the following conditions |
6 | * are met: |
7 | * 1. Redistributions of source code must retain the above copyright |
8 | * notice, this list of conditions and the following disclaimer. |
9 | * 2. Redistributions in binary form must reproduce the above copyright |
10 | * notice, this list of conditions and the following disclaimer in the |
11 | * documentation and/or other materials provided with the distribution. |
12 | * |
13 | * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' |
14 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, |
15 | * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
16 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS |
17 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
18 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
19 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
20 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
21 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
22 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF |
23 | * THE POSSIBILITY OF SUCH DAMAGE. |
24 | */ |
25 | #include "config.h" |
26 | #include "AccessibilityTextMarker.h" |
27 | #include "AccessibilityTextMarkerRange.h" |
28 | #include "AccessibilityUIElement.h" |
29 | #include "JSAccessibilityTextMarker.h" |
30 | #include "JSAccessibilityTextMarkerRange.h" |
31 | #include "JSAccessibilityUIElement.h" |
32 | #include <JavaScriptCore/JSRetainPtr.h> |
33 | #include <wtf/GetPtr.h> |
34 | |
35 | namespace WTR { |
36 | |
37 | AccessibilityUIElement* toAccessibilityUIElement(JSContextRef context, JSValueRef value) |
38 | { |
39 | if (!context || !value || !JSAccessibilityUIElement::accessibilityUIElementClass() || !JSValueIsObjectOfClass(context, value, JSAccessibilityUIElement::accessibilityUIElementClass())) |
40 | return 0; |
41 | return static_cast<AccessibilityUIElement*>(JSWrapper::unwrap(context, value)); |
42 | } |
43 | |
44 | JSClassRef JSAccessibilityUIElement::accessibilityUIElementClass() |
45 | { |
46 | static JSClassRef jsClass; |
47 | if (!jsClass) { |
48 | JSClassDefinition definition = kJSClassDefinitionEmpty; |
49 | definition.className = "AccessibilityUIElement" ; |
50 | definition.parentClass = 0; |
51 | definition.staticValues = staticValues(); |
52 | definition.staticFunctions = staticFunctions(); |
53 | definition.initialize = initialize; |
54 | definition.finalize = finalize; |
55 | jsClass = JSClassCreate(&definition); |
56 | } |
57 | return jsClass; |
58 | } |
59 | |
60 | const JSStaticFunction* JSAccessibilityUIElement::staticFunctions() |
61 | { |
62 | static const JSStaticFunction functions[] = { |
63 | { "isEqual" , isEqual, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
64 | { "elementAtPoint" , elementAtPoint, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
65 | { "childAtIndex" , childAtIndex, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
66 | { "indexOfChild" , indexOfChild, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
67 | { "linkedUIElementAtIndex" , linkedUIElementAtIndex, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
68 | { "selectedChildAtIndex" , selectedChildAtIndex, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
69 | { "setSelectedChild" , setSelectedChild, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
70 | { "setSelectedChildAtIndex" , setSelectedChildAtIndex, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
71 | { "removeSelectionAtIndex" , removeSelectionAtIndex, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
72 | { "clearSelectedChildren" , clearSelectedChildren, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
73 | { "titleUIElement" , titleUIElement, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
74 | { "parentElement" , parentElement, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
75 | { "stringDescriptionOfAttributeValue" , stringDescriptionOfAttributeValue, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
76 | { "stringAttributeValue" , stringAttributeValue, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
77 | { "numberAttributeValue" , numberAttributeValue, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
78 | { "uiElementArrayAttributeValue" , uiElementArrayAttributeValue, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
79 | { "uiElementAttributeValue" , uiElementAttributeValue, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
80 | { "boolAttributeValue" , boolAttributeValue, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
81 | { "setBoolAttributeValue" , setBoolAttributeValue, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
82 | { "isAttributeSupported" , isAttributeSupported, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
83 | { "isAttributeSettable" , isAttributeSettable, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
84 | { "isPressActionSupported" , isPressActionSupported, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
85 | { "isIncrementActionSupported" , isIncrementActionSupported, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
86 | { "isDecrementActionSupported" , isDecrementActionSupported, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
87 | { "setValue" , setValue, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
88 | { "increment" , increment, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
89 | { "decrement" , decrement, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
90 | { "asyncIncrement" , asyncIncrement, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
91 | { "asyncDecrement" , asyncDecrement, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
92 | { "press" , press, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
93 | { "syncPress" , syncPress, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
94 | { "showMenu" , showMenu, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
95 | { "dismiss" , dismiss, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
96 | { "allAttributes" , allAttributes, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
97 | { "attributesOfChildren" , attributesOfChildren, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
98 | { "attributesOfLinkedUIElements" , attributesOfLinkedUIElements, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
99 | { "attributesOfDocumentLinks" , attributesOfDocumentLinks, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
100 | { "characterAtOffset" , characterAtOffset, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
101 | { "wordAtOffset" , wordAtOffset, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
102 | { "lineAtOffset" , lineAtOffset, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
103 | { "sentenceAtOffset" , sentenceAtOffset, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
104 | { "attributesOfColumnHeaders" , attributesOfColumnHeaders, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
105 | { "attributesOfRowHeaders" , attributesOfRowHeaders, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
106 | { "attributesOfColumns" , attributesOfColumns, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
107 | { "attributesOfRows" , attributesOfRows, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
108 | { "attributesOfVisibleCells" , attributesOfVisibleCells, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
109 | { "attributesOfHeader" , attributesOfHeader, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
110 | { "cellForColumnAndRow" , cellForColumnAndRow, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
111 | { "selectedRowAtIndex" , selectedRowAtIndex, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
112 | { "disclosedByRow" , disclosedByRow, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
113 | { "disclosedRowAtIndex" , disclosedRowAtIndex, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
114 | { "rowAtIndex" , rowAtIndex, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
115 | { "indexInTable" , indexInTable, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
116 | { "rowIndexRange" , rowIndexRange, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
117 | { "columnIndexRange" , columnIndexRange, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
118 | { "rowCount" , rowCount, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
119 | { "columnCount" , columnCount, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
120 | { "columnHeaders" , columnHeaders, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
121 | { "rowHeaders" , rowHeaders, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
122 | { "ariaOwnsElementAtIndex" , ariaOwnsElementAtIndex, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
123 | { "ariaOwnsReferencingElementAtIndex" , ariaOwnsReferencingElementAtIndex, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
124 | { "ariaFlowToElementAtIndex" , ariaFlowToElementAtIndex, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
125 | { "ariaFlowToReferencingElementAtIndex" , ariaFlowToReferencingElementAtIndex, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
126 | { "ariaControlsElementAtIndex" , ariaControlsElementAtIndex, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
127 | { "ariaControlsReferencingElementAtIndex" , ariaControlsReferencingElementAtIndex, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
128 | { "ariaLabelledByElementAtIndex" , ariaLabelledByElementAtIndex, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
129 | { "ariaLabelledByReferencingElementAtIndex" , ariaLabelledByReferencingElementAtIndex, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
130 | { "ariaDescribedByElementAtIndex" , ariaDescribedByElementAtIndex, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
131 | { "ariaDescribedByReferencingElementAtIndex" , ariaDescribedByReferencingElementAtIndex, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
132 | { "ariaDetailsElementAtIndex" , ariaDetailsElementAtIndex, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
133 | { "ariaDetailsReferencingElementAtIndex" , ariaDetailsReferencingElementAtIndex, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
134 | { "ariaErrorMessageElementAtIndex" , ariaErrorMessageElementAtIndex, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
135 | { "ariaErrorMessageReferencingElementAtIndex" , ariaErrorMessageReferencingElementAtIndex, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
136 | { "parameterizedAttributeNames" , parameterizedAttributeNames, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
137 | { "lineForIndex" , lineForIndex, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
138 | { "rangeForLine" , rangeForLine, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
139 | { "rangeForPosition" , rangeForPosition, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
140 | { "boundsForRange" , boundsForRange, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
141 | { "stringForRange" , stringForRange, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
142 | { "attributedStringForRange" , attributedStringForRange, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
143 | { "attributedStringForElement" , attributedStringForElement, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
144 | { "attributedStringRangeIsMisspelled" , attributedStringRangeIsMisspelled, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
145 | { "uiElementCountForSearchPredicate" , uiElementCountForSearchPredicate, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
146 | { "uiElementForSearchPredicate" , uiElementForSearchPredicate, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
147 | { "selectTextWithCriteria" , selectTextWithCriteria, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
148 | { "searchTextWithCriteria" , searchTextWithCriteria, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
149 | { "setSelectedTextRange" , setSelectedTextRange, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
150 | { "scrollToMakeVisible" , scrollToMakeVisible, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
151 | { "scrollToGlobalPoint" , scrollToGlobalPoint, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
152 | { "scrollToMakeVisibleWithSubFocus" , scrollToMakeVisibleWithSubFocus, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
153 | { "takeFocus" , takeFocus, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
154 | { "scrollPageDown" , scrollPageDown, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
155 | { "scrollPageUp" , scrollPageUp, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
156 | { "scrollPageLeft" , scrollPageLeft, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
157 | { "scrollPageRight" , scrollPageRight, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
158 | { "lineTextMarkerRangeForTextMarker" , lineTextMarkerRangeForTextMarker, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
159 | { "textMarkerRangeForElement" , textMarkerRangeForElement, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
160 | { "textMarkerRangeForMarkers" , textMarkerRangeForMarkers, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
161 | { "selectedTextMarkerRange" , selectedTextMarkerRange, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
162 | { "resetSelectedTextMarkerRange" , resetSelectedTextMarkerRange, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
163 | { "replaceTextInRange" , replaceTextInRange, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
164 | { "startTextMarkerForTextMarkerRange" , startTextMarkerForTextMarkerRange, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
165 | { "endTextMarkerForTextMarkerRange" , endTextMarkerForTextMarkerRange, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
166 | { "endTextMarkerForBounds" , endTextMarkerForBounds, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
167 | { "startTextMarkerForBounds" , startTextMarkerForBounds, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
168 | { "textMarkerForPoint" , textMarkerForPoint, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
169 | { "previousTextMarker" , previousTextMarker, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
170 | { "nextTextMarker" , nextTextMarker, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
171 | { "accessibilityElementForTextMarker" , accessibilityElementForTextMarker, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
172 | { "stringForTextMarkerRange" , stringForTextMarkerRange, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
173 | { "attributedStringForTextMarkerRange" , attributedStringForTextMarkerRange, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
174 | { "attributedStringForTextMarkerRangeWithOptions" , attributedStringForTextMarkerRangeWithOptions, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
175 | { "textMarkerRangeLength" , textMarkerRangeLength, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
176 | { "attributedStringForTextMarkerRangeContainsAttribute" , attributedStringForTextMarkerRangeContainsAttribute, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
177 | { "indexForTextMarker" , indexForTextMarker, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
178 | { "isTextMarkerValid" , isTextMarkerValid, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
179 | { "textMarkerForIndex" , textMarkerForIndex, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
180 | { "setSelectedVisibleTextRange" , setSelectedVisibleTextRange, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
181 | { "leftWordTextMarkerRangeForTextMarker" , leftWordTextMarkerRangeForTextMarker, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
182 | { "rightWordTextMarkerRangeForTextMarker" , rightWordTextMarkerRangeForTextMarker, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
183 | { "previousWordStartTextMarkerForTextMarker" , previousWordStartTextMarkerForTextMarker, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
184 | { "nextWordEndTextMarkerForTextMarker" , nextWordEndTextMarkerForTextMarker, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
185 | { "paragraphTextMarkerRangeForTextMarker" , paragraphTextMarkerRangeForTextMarker, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
186 | { "previousParagraphStartTextMarkerForTextMarker" , previousParagraphStartTextMarkerForTextMarker, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
187 | { "nextParagraphEndTextMarkerForTextMarker" , nextParagraphEndTextMarkerForTextMarker, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
188 | { "sentenceTextMarkerRangeForTextMarker" , sentenceTextMarkerRangeForTextMarker, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
189 | { "previousSentenceStartTextMarkerForTextMarker" , previousSentenceStartTextMarkerForTextMarker, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
190 | { "nextSentenceEndTextMarkerForTextMarker" , nextSentenceEndTextMarkerForTextMarker, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
191 | { "textMarkerRangeMatchesTextNearMarkers" , textMarkerRangeMatchesTextNearMarkers, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
192 | { "elementsForRange" , elementsForRange, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
193 | { "increaseTextSelection" , increaseTextSelection, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
194 | { "decreaseTextSelection" , decreaseTextSelection, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
195 | { "linkedElement" , linkedElement, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
196 | { "headerElementAtIndex" , headerElementAtIndex, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
197 | { "assistiveTechnologySimulatedFocus" , assistiveTechnologySimulatedFocus, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
198 | { "fieldsetAncestorElement" , fieldsetAncestorElement, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
199 | { "addNotificationListener" , addNotificationListener, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
200 | { "removeNotificationListener" , removeNotificationListener, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
201 | { 0, 0, 0 } |
202 | }; |
203 | return functions; |
204 | } |
205 | |
206 | const JSStaticValue* JSAccessibilityUIElement::staticValues() |
207 | { |
208 | static const JSStaticValue values[] = { |
209 | { "documentEncoding" , documentEncoding, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
210 | { "documentURI" , documentURI, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
211 | { "role" , role, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
212 | { "subrole" , subrole, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
213 | { "roleDescription" , roleDescription, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
214 | { "computedRoleString" , computedRoleString, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
215 | { "title" , title, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
216 | { "description" , description, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
217 | { "language" , language, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
218 | { "helpText" , helpText, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
219 | { "valueDescription" , valueDescription, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
220 | { "url" , url, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
221 | { "speakAs" , speakAs, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
222 | { "orientation" , orientation, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
223 | { "insertionPointLineNumber" , insertionPointLineNumber, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
224 | { "selectedTextRange" , selectedTextRange, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
225 | { "stringValue" , stringValue, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
226 | { "intValue" , intValue, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
227 | { "minValue" , minValue, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
228 | { "maxValue" , maxValue, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
229 | { "isEnabled" , isEnabled, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
230 | { "isRequired" , isRequired, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
231 | { "isFocused" , isFocused, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
232 | { "isFocusable" , isFocusable, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
233 | { "isSelectable" , isSelectable, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
234 | { "isSelected" , isSelected, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
235 | { "isSelectedOptionActive" , isSelectedOptionActive, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
236 | { "isMultiSelectable" , isMultiSelectable, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
237 | { "isExpanded" , isExpanded, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
238 | { "isChecked" , isChecked, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
239 | { "isIndeterminate" , isIndeterminate, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
240 | { "isVisible" , isVisible, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
241 | { "isCollapsed" , isCollapsed, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
242 | { "hasPopup" , hasPopup, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
243 | { "isIgnored" , isIgnored, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
244 | { "isSingleLine" , isSingleLine, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
245 | { "isMultiLine" , isMultiLine, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
246 | { "isOffScreen" , isOffScreen, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
247 | { "isValid" , isValid, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
248 | { "hierarchicalLevel" , hierarchicalLevel, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
249 | { "ariaIsGrabbed" , ariaIsGrabbed, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
250 | { "ariaDropEffects" , ariaDropEffects, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
251 | { "classList" , classList, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
252 | { "x" , x, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
253 | { "y" , y, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
254 | { "width" , width, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
255 | { "height" , height, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
256 | { "clickPointX" , clickPointX, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
257 | { "clickPointY" , clickPointY, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
258 | { "childrenCount" , childrenCount, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
259 | { "selectedChildrenCount" , selectedChildrenCount, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
260 | { "rowCount" , rowCount, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
261 | { "columnCount" , columnCount, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
262 | { "horizontalScrollbar" , horizontalScrollbar, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
263 | { "verticalScrollbar" , verticalScrollbar, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
264 | { "startTextMarker" , startTextMarker, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
265 | { "endTextMarker" , endTextMarker, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
266 | { "supportedActions" , supportedActions, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
267 | { "mathPostscriptsDescription" , mathPostscriptsDescription, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
268 | { "mathPrescriptsDescription" , mathPrescriptsDescription, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
269 | { "pathDescription" , pathDescription, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
270 | { "identifier" , identifier, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
271 | { "traits" , traits, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
272 | { "elementTextPosition" , elementTextPosition, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
273 | { "elementTextLength" , elementTextLength, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
274 | { "stringForSelection" , stringForSelection, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
275 | { "isSearchField" , isSearchField, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
276 | { "isTextArea" , isTextArea, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
277 | { "hasContainedByFieldsetTrait" , hasContainedByFieldsetTrait, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, |
278 | { 0, 0, 0, 0 } |
279 | }; |
280 | return values; |
281 | } |
282 | |
283 | // Functions |
284 | |
285 | JSValueRef JSAccessibilityUIElement::isEqual(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
286 | { |
287 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
288 | if (!impl) |
289 | return JSValueMakeUndefined(context); |
290 | |
291 | AccessibilityUIElement* otherElement = argumentCount > 0 ? toAccessibilityUIElement(context, arguments[0]) : 0; |
292 | return JSValueMakeBoolean(context, impl->isEqual(otherElement)); |
293 | } |
294 | |
295 | JSValueRef JSAccessibilityUIElement::elementAtPoint(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
296 | { |
297 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
298 | if (!impl) |
299 | return JSValueMakeUndefined(context); |
300 | |
301 | double x = argumentCount > 0 ? JSValueToNumber(context, arguments[0], nullptr) : 0; |
302 | double y = argumentCount > 1 ? JSValueToNumber(context, arguments[1], nullptr) : 0; |
303 | return toJS(context, WTF::getPtr(impl->elementAtPoint(x, y))); |
304 | } |
305 | |
306 | JSValueRef JSAccessibilityUIElement::childAtIndex(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
307 | { |
308 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
309 | if (!impl) |
310 | return JSValueMakeUndefined(context); |
311 | |
312 | double index = argumentCount > 0 ? JSValueToNumber(context, arguments[0], nullptr) : 0; |
313 | return toJS(context, WTF::getPtr(impl->childAtIndex(index))); |
314 | } |
315 | |
316 | JSValueRef JSAccessibilityUIElement::indexOfChild(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
317 | { |
318 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
319 | if (!impl) |
320 | return JSValueMakeUndefined(context); |
321 | |
322 | AccessibilityUIElement* child = argumentCount > 0 ? toAccessibilityUIElement(context, arguments[0]) : 0; |
323 | return JSValueMakeNumber(context, impl->indexOfChild(child)); |
324 | } |
325 | |
326 | JSValueRef JSAccessibilityUIElement::linkedUIElementAtIndex(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
327 | { |
328 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
329 | if (!impl) |
330 | return JSValueMakeUndefined(context); |
331 | |
332 | double index = argumentCount > 0 ? JSValueToNumber(context, arguments[0], nullptr) : 0; |
333 | return toJS(context, WTF::getPtr(impl->linkedUIElementAtIndex(index))); |
334 | } |
335 | |
336 | JSValueRef JSAccessibilityUIElement::selectedChildAtIndex(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
337 | { |
338 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
339 | if (!impl) |
340 | return JSValueMakeUndefined(context); |
341 | |
342 | double index = argumentCount > 0 ? JSValueToNumber(context, arguments[0], nullptr) : 0; |
343 | return toJS(context, WTF::getPtr(impl->selectedChildAtIndex(index))); |
344 | } |
345 | |
346 | JSValueRef JSAccessibilityUIElement::setSelectedChild(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
347 | { |
348 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
349 | if (!impl) |
350 | return JSValueMakeUndefined(context); |
351 | |
352 | AccessibilityUIElement* element = argumentCount > 0 ? toAccessibilityUIElement(context, arguments[0]) : 0; |
353 | impl->setSelectedChild(element); |
354 | |
355 | return JSValueMakeUndefined(context); |
356 | } |
357 | |
358 | JSValueRef JSAccessibilityUIElement::setSelectedChildAtIndex(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
359 | { |
360 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
361 | if (!impl) |
362 | return JSValueMakeUndefined(context); |
363 | |
364 | double index = argumentCount > 0 ? JSValueToNumber(context, arguments[0], nullptr) : 0; |
365 | impl->setSelectedChildAtIndex(index); |
366 | |
367 | return JSValueMakeUndefined(context); |
368 | } |
369 | |
370 | JSValueRef JSAccessibilityUIElement::removeSelectionAtIndex(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
371 | { |
372 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
373 | if (!impl) |
374 | return JSValueMakeUndefined(context); |
375 | |
376 | double index = argumentCount > 0 ? JSValueToNumber(context, arguments[0], nullptr) : 0; |
377 | impl->removeSelectionAtIndex(index); |
378 | |
379 | return JSValueMakeUndefined(context); |
380 | } |
381 | |
382 | JSValueRef JSAccessibilityUIElement::clearSelectedChildren(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
383 | { |
384 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
385 | if (!impl) |
386 | return JSValueMakeUndefined(context); |
387 | |
388 | impl->clearSelectedChildren(); |
389 | |
390 | return JSValueMakeUndefined(context); |
391 | } |
392 | |
393 | JSValueRef JSAccessibilityUIElement::titleUIElement(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
394 | { |
395 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
396 | if (!impl) |
397 | return JSValueMakeUndefined(context); |
398 | |
399 | return toJS(context, WTF::getPtr(impl->titleUIElement())); |
400 | } |
401 | |
402 | JSValueRef JSAccessibilityUIElement::parentElement(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
403 | { |
404 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
405 | if (!impl) |
406 | return JSValueMakeUndefined(context); |
407 | |
408 | return toJS(context, WTF::getPtr(impl->parentElement())); |
409 | } |
410 | |
411 | JSValueRef JSAccessibilityUIElement::stringDescriptionOfAttributeValue(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
412 | { |
413 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
414 | if (!impl) |
415 | return JSValueMakeUndefined(context); |
416 | |
417 | JSRetainPtr<JSStringRef> attr = argumentCount > 0 ? adopt(JSValueToStringCopy(context, arguments[0], nullptr)) : JSRetainPtr<JSStringRef>(); |
418 | return JSValueMakeStringOrNull(context, impl->stringDescriptionOfAttributeValue(attr.get()).get()); |
419 | } |
420 | |
421 | JSValueRef JSAccessibilityUIElement::stringAttributeValue(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
422 | { |
423 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
424 | if (!impl) |
425 | return JSValueMakeUndefined(context); |
426 | |
427 | JSRetainPtr<JSStringRef> attr = argumentCount > 0 ? adopt(JSValueToStringCopy(context, arguments[0], nullptr)) : JSRetainPtr<JSStringRef>(); |
428 | return JSValueMakeStringOrNull(context, impl->stringAttributeValue(attr.get()).get()); |
429 | } |
430 | |
431 | JSValueRef JSAccessibilityUIElement::numberAttributeValue(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
432 | { |
433 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
434 | if (!impl) |
435 | return JSValueMakeUndefined(context); |
436 | |
437 | JSRetainPtr<JSStringRef> attr = argumentCount > 0 ? adopt(JSValueToStringCopy(context, arguments[0], nullptr)) : JSRetainPtr<JSStringRef>(); |
438 | return JSValueMakeNumber(context, impl->numberAttributeValue(attr.get())); |
439 | } |
440 | |
441 | JSValueRef JSAccessibilityUIElement::uiElementArrayAttributeValue(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
442 | { |
443 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
444 | if (!impl) |
445 | return JSValueMakeUndefined(context); |
446 | |
447 | JSRetainPtr<JSStringRef> attr = argumentCount > 0 ? adopt(JSValueToStringCopy(context, arguments[0], nullptr)) : JSRetainPtr<JSStringRef>(); |
448 | return impl->uiElementArrayAttributeValue(attr.get()); |
449 | } |
450 | |
451 | JSValueRef JSAccessibilityUIElement::uiElementAttributeValue(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
452 | { |
453 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
454 | if (!impl) |
455 | return JSValueMakeUndefined(context); |
456 | |
457 | JSRetainPtr<JSStringRef> attr = argumentCount > 0 ? adopt(JSValueToStringCopy(context, arguments[0], nullptr)) : JSRetainPtr<JSStringRef>(); |
458 | return toJS(context, WTF::getPtr(impl->uiElementAttributeValue(attr.get()))); |
459 | } |
460 | |
461 | JSValueRef JSAccessibilityUIElement::boolAttributeValue(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
462 | { |
463 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
464 | if (!impl) |
465 | return JSValueMakeUndefined(context); |
466 | |
467 | JSRetainPtr<JSStringRef> attr = argumentCount > 0 ? adopt(JSValueToStringCopy(context, arguments[0], nullptr)) : JSRetainPtr<JSStringRef>(); |
468 | return JSValueMakeBoolean(context, impl->boolAttributeValue(attr.get())); |
469 | } |
470 | |
471 | JSValueRef JSAccessibilityUIElement::setBoolAttributeValue(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
472 | { |
473 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
474 | if (!impl) |
475 | return JSValueMakeUndefined(context); |
476 | |
477 | JSRetainPtr<JSStringRef> attr = argumentCount > 0 ? adopt(JSValueToStringCopy(context, arguments[0], nullptr)) : JSRetainPtr<JSStringRef>(); |
478 | bool value = argumentCount > 1 && JSValueToBoolean(context, arguments[1]); |
479 | impl->setBoolAttributeValue(attr.get(), value); |
480 | |
481 | return JSValueMakeUndefined(context); |
482 | } |
483 | |
484 | JSValueRef JSAccessibilityUIElement::isAttributeSupported(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
485 | { |
486 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
487 | if (!impl) |
488 | return JSValueMakeUndefined(context); |
489 | |
490 | JSRetainPtr<JSStringRef> attr = argumentCount > 0 ? adopt(JSValueToStringCopy(context, arguments[0], nullptr)) : JSRetainPtr<JSStringRef>(); |
491 | return JSValueMakeBoolean(context, impl->isAttributeSupported(attr.get())); |
492 | } |
493 | |
494 | JSValueRef JSAccessibilityUIElement::isAttributeSettable(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
495 | { |
496 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
497 | if (!impl) |
498 | return JSValueMakeUndefined(context); |
499 | |
500 | JSRetainPtr<JSStringRef> attr = argumentCount > 0 ? adopt(JSValueToStringCopy(context, arguments[0], nullptr)) : JSRetainPtr<JSStringRef>(); |
501 | return JSValueMakeBoolean(context, impl->isAttributeSettable(attr.get())); |
502 | } |
503 | |
504 | JSValueRef JSAccessibilityUIElement::isPressActionSupported(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
505 | { |
506 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
507 | if (!impl) |
508 | return JSValueMakeUndefined(context); |
509 | |
510 | return JSValueMakeBoolean(context, impl->isPressActionSupported()); |
511 | } |
512 | |
513 | JSValueRef JSAccessibilityUIElement::isIncrementActionSupported(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
514 | { |
515 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
516 | if (!impl) |
517 | return JSValueMakeUndefined(context); |
518 | |
519 | return JSValueMakeBoolean(context, impl->isIncrementActionSupported()); |
520 | } |
521 | |
522 | JSValueRef JSAccessibilityUIElement::isDecrementActionSupported(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
523 | { |
524 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
525 | if (!impl) |
526 | return JSValueMakeUndefined(context); |
527 | |
528 | return JSValueMakeBoolean(context, impl->isDecrementActionSupported()); |
529 | } |
530 | |
531 | JSValueRef JSAccessibilityUIElement::setValue(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
532 | { |
533 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
534 | if (!impl) |
535 | return JSValueMakeUndefined(context); |
536 | |
537 | JSRetainPtr<JSStringRef> value = argumentCount > 0 ? adopt(JSValueToStringCopy(context, arguments[0], nullptr)) : JSRetainPtr<JSStringRef>(); |
538 | impl->setValue(value.get()); |
539 | |
540 | return JSValueMakeUndefined(context); |
541 | } |
542 | |
543 | JSValueRef JSAccessibilityUIElement::increment(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
544 | { |
545 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
546 | if (!impl) |
547 | return JSValueMakeUndefined(context); |
548 | |
549 | impl->increment(); |
550 | |
551 | return JSValueMakeUndefined(context); |
552 | } |
553 | |
554 | JSValueRef JSAccessibilityUIElement::decrement(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
555 | { |
556 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
557 | if (!impl) |
558 | return JSValueMakeUndefined(context); |
559 | |
560 | impl->decrement(); |
561 | |
562 | return JSValueMakeUndefined(context); |
563 | } |
564 | |
565 | JSValueRef JSAccessibilityUIElement::asyncIncrement(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
566 | { |
567 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
568 | if (!impl) |
569 | return JSValueMakeUndefined(context); |
570 | |
571 | impl->asyncIncrement(); |
572 | |
573 | return JSValueMakeUndefined(context); |
574 | } |
575 | |
576 | JSValueRef JSAccessibilityUIElement::asyncDecrement(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
577 | { |
578 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
579 | if (!impl) |
580 | return JSValueMakeUndefined(context); |
581 | |
582 | impl->asyncDecrement(); |
583 | |
584 | return JSValueMakeUndefined(context); |
585 | } |
586 | |
587 | JSValueRef JSAccessibilityUIElement::press(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
588 | { |
589 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
590 | if (!impl) |
591 | return JSValueMakeUndefined(context); |
592 | |
593 | impl->press(); |
594 | |
595 | return JSValueMakeUndefined(context); |
596 | } |
597 | |
598 | JSValueRef JSAccessibilityUIElement::syncPress(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
599 | { |
600 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
601 | if (!impl) |
602 | return JSValueMakeUndefined(context); |
603 | |
604 | impl->syncPress(); |
605 | |
606 | return JSValueMakeUndefined(context); |
607 | } |
608 | |
609 | JSValueRef JSAccessibilityUIElement::(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
610 | { |
611 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
612 | if (!impl) |
613 | return JSValueMakeUndefined(context); |
614 | |
615 | impl->showMenu(); |
616 | |
617 | return JSValueMakeUndefined(context); |
618 | } |
619 | |
620 | JSValueRef JSAccessibilityUIElement::dismiss(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
621 | { |
622 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
623 | if (!impl) |
624 | return JSValueMakeUndefined(context); |
625 | |
626 | return JSValueMakeBoolean(context, impl->dismiss()); |
627 | } |
628 | |
629 | JSValueRef JSAccessibilityUIElement::allAttributes(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
630 | { |
631 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
632 | if (!impl) |
633 | return JSValueMakeUndefined(context); |
634 | |
635 | return JSValueMakeStringOrNull(context, impl->allAttributes().get()); |
636 | } |
637 | |
638 | JSValueRef JSAccessibilityUIElement::attributesOfChildren(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
639 | { |
640 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
641 | if (!impl) |
642 | return JSValueMakeUndefined(context); |
643 | |
644 | return JSValueMakeStringOrNull(context, impl->attributesOfChildren().get()); |
645 | } |
646 | |
647 | JSValueRef JSAccessibilityUIElement::attributesOfLinkedUIElements(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
648 | { |
649 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
650 | if (!impl) |
651 | return JSValueMakeUndefined(context); |
652 | |
653 | return JSValueMakeStringOrNull(context, impl->attributesOfLinkedUIElements().get()); |
654 | } |
655 | |
656 | JSValueRef JSAccessibilityUIElement::attributesOfDocumentLinks(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
657 | { |
658 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
659 | if (!impl) |
660 | return JSValueMakeUndefined(context); |
661 | |
662 | return JSValueMakeStringOrNull(context, impl->attributesOfDocumentLinks().get()); |
663 | } |
664 | |
665 | JSValueRef JSAccessibilityUIElement::characterAtOffset(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
666 | { |
667 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
668 | if (!impl) |
669 | return JSValueMakeUndefined(context); |
670 | |
671 | double offset = argumentCount > 0 ? JSValueToNumber(context, arguments[0], nullptr) : 0; |
672 | return JSValueMakeStringOrNull(context, impl->characterAtOffset(offset).get()); |
673 | } |
674 | |
675 | JSValueRef JSAccessibilityUIElement::wordAtOffset(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
676 | { |
677 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
678 | if (!impl) |
679 | return JSValueMakeUndefined(context); |
680 | |
681 | double offset = argumentCount > 0 ? JSValueToNumber(context, arguments[0], nullptr) : 0; |
682 | return JSValueMakeStringOrNull(context, impl->wordAtOffset(offset).get()); |
683 | } |
684 | |
685 | JSValueRef JSAccessibilityUIElement::lineAtOffset(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
686 | { |
687 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
688 | if (!impl) |
689 | return JSValueMakeUndefined(context); |
690 | |
691 | double offset = argumentCount > 0 ? JSValueToNumber(context, arguments[0], nullptr) : 0; |
692 | return JSValueMakeStringOrNull(context, impl->lineAtOffset(offset).get()); |
693 | } |
694 | |
695 | JSValueRef JSAccessibilityUIElement::sentenceAtOffset(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
696 | { |
697 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
698 | if (!impl) |
699 | return JSValueMakeUndefined(context); |
700 | |
701 | double offset = argumentCount > 0 ? JSValueToNumber(context, arguments[0], nullptr) : 0; |
702 | return JSValueMakeStringOrNull(context, impl->sentenceAtOffset(offset).get()); |
703 | } |
704 | |
705 | JSValueRef JSAccessibilityUIElement::attributesOfColumnHeaders(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
706 | { |
707 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
708 | if (!impl) |
709 | return JSValueMakeUndefined(context); |
710 | |
711 | return JSValueMakeStringOrNull(context, impl->attributesOfColumnHeaders().get()); |
712 | } |
713 | |
714 | JSValueRef JSAccessibilityUIElement::(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
715 | { |
716 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
717 | if (!impl) |
718 | return JSValueMakeUndefined(context); |
719 | |
720 | return JSValueMakeStringOrNull(context, impl->attributesOfRowHeaders().get()); |
721 | } |
722 | |
723 | JSValueRef JSAccessibilityUIElement::attributesOfColumns(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
724 | { |
725 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
726 | if (!impl) |
727 | return JSValueMakeUndefined(context); |
728 | |
729 | return JSValueMakeStringOrNull(context, impl->attributesOfColumns().get()); |
730 | } |
731 | |
732 | JSValueRef JSAccessibilityUIElement::attributesOfRows(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
733 | { |
734 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
735 | if (!impl) |
736 | return JSValueMakeUndefined(context); |
737 | |
738 | return JSValueMakeStringOrNull(context, impl->attributesOfRows().get()); |
739 | } |
740 | |
741 | JSValueRef JSAccessibilityUIElement::attributesOfVisibleCells(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
742 | { |
743 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
744 | if (!impl) |
745 | return JSValueMakeUndefined(context); |
746 | |
747 | return JSValueMakeStringOrNull(context, impl->attributesOfVisibleCells().get()); |
748 | } |
749 | |
750 | JSValueRef JSAccessibilityUIElement::(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
751 | { |
752 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
753 | if (!impl) |
754 | return JSValueMakeUndefined(context); |
755 | |
756 | return JSValueMakeStringOrNull(context, impl->attributesOfHeader().get()); |
757 | } |
758 | |
759 | JSValueRef JSAccessibilityUIElement::cellForColumnAndRow(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
760 | { |
761 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
762 | if (!impl) |
763 | return JSValueMakeUndefined(context); |
764 | |
765 | double column = argumentCount > 0 ? JSValueToNumber(context, arguments[0], nullptr) : 0; |
766 | double row = argumentCount > 1 ? JSValueToNumber(context, arguments[1], nullptr) : 0; |
767 | return toJS(context, WTF::getPtr(impl->cellForColumnAndRow(column, row))); |
768 | } |
769 | |
770 | JSValueRef JSAccessibilityUIElement::selectedRowAtIndex(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
771 | { |
772 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
773 | if (!impl) |
774 | return JSValueMakeUndefined(context); |
775 | |
776 | double index = argumentCount > 0 ? JSValueToNumber(context, arguments[0], nullptr) : 0; |
777 | return toJS(context, WTF::getPtr(impl->selectedRowAtIndex(index))); |
778 | } |
779 | |
780 | JSValueRef JSAccessibilityUIElement::disclosedByRow(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
781 | { |
782 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
783 | if (!impl) |
784 | return JSValueMakeUndefined(context); |
785 | |
786 | return toJS(context, WTF::getPtr(impl->disclosedByRow())); |
787 | } |
788 | |
789 | JSValueRef JSAccessibilityUIElement::disclosedRowAtIndex(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
790 | { |
791 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
792 | if (!impl) |
793 | return JSValueMakeUndefined(context); |
794 | |
795 | double index = argumentCount > 0 ? JSValueToNumber(context, arguments[0], nullptr) : 0; |
796 | return toJS(context, WTF::getPtr(impl->disclosedRowAtIndex(index))); |
797 | } |
798 | |
799 | JSValueRef JSAccessibilityUIElement::rowAtIndex(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
800 | { |
801 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
802 | if (!impl) |
803 | return JSValueMakeUndefined(context); |
804 | |
805 | double index = argumentCount > 0 ? JSValueToNumber(context, arguments[0], nullptr) : 0; |
806 | return toJS(context, WTF::getPtr(impl->rowAtIndex(index))); |
807 | } |
808 | |
809 | JSValueRef JSAccessibilityUIElement::indexInTable(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
810 | { |
811 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
812 | if (!impl) |
813 | return JSValueMakeUndefined(context); |
814 | |
815 | return JSValueMakeNumber(context, impl->indexInTable()); |
816 | } |
817 | |
818 | JSValueRef JSAccessibilityUIElement::rowIndexRange(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
819 | { |
820 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
821 | if (!impl) |
822 | return JSValueMakeUndefined(context); |
823 | |
824 | return JSValueMakeStringOrNull(context, impl->rowIndexRange().get()); |
825 | } |
826 | |
827 | JSValueRef JSAccessibilityUIElement::columnIndexRange(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
828 | { |
829 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
830 | if (!impl) |
831 | return JSValueMakeUndefined(context); |
832 | |
833 | return JSValueMakeStringOrNull(context, impl->columnIndexRange().get()); |
834 | } |
835 | |
836 | JSValueRef JSAccessibilityUIElement::rowCount(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
837 | { |
838 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
839 | if (!impl) |
840 | return JSValueMakeUndefined(context); |
841 | |
842 | return JSValueMakeNumber(context, impl->rowCount()); |
843 | } |
844 | |
845 | JSValueRef JSAccessibilityUIElement::columnCount(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
846 | { |
847 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
848 | if (!impl) |
849 | return JSValueMakeUndefined(context); |
850 | |
851 | return JSValueMakeNumber(context, impl->columnCount()); |
852 | } |
853 | |
854 | JSValueRef JSAccessibilityUIElement::columnHeaders(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
855 | { |
856 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
857 | if (!impl) |
858 | return JSValueMakeUndefined(context); |
859 | |
860 | return impl->columnHeaders(); |
861 | } |
862 | |
863 | JSValueRef JSAccessibilityUIElement::(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
864 | { |
865 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
866 | if (!impl) |
867 | return JSValueMakeUndefined(context); |
868 | |
869 | return impl->rowHeaders(); |
870 | } |
871 | |
872 | JSValueRef JSAccessibilityUIElement::ariaOwnsElementAtIndex(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
873 | { |
874 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
875 | if (!impl) |
876 | return JSValueMakeUndefined(context); |
877 | |
878 | double index = argumentCount > 0 ? JSValueToNumber(context, arguments[0], nullptr) : 0; |
879 | return toJS(context, WTF::getPtr(impl->ariaOwnsElementAtIndex(index))); |
880 | } |
881 | |
882 | JSValueRef JSAccessibilityUIElement::ariaOwnsReferencingElementAtIndex(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
883 | { |
884 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
885 | if (!impl) |
886 | return JSValueMakeUndefined(context); |
887 | |
888 | double index = argumentCount > 0 ? JSValueToNumber(context, arguments[0], nullptr) : 0; |
889 | return toJS(context, WTF::getPtr(impl->ariaOwnsReferencingElementAtIndex(index))); |
890 | } |
891 | |
892 | JSValueRef JSAccessibilityUIElement::ariaFlowToElementAtIndex(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
893 | { |
894 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
895 | if (!impl) |
896 | return JSValueMakeUndefined(context); |
897 | |
898 | double index = argumentCount > 0 ? JSValueToNumber(context, arguments[0], nullptr) : 0; |
899 | return toJS(context, WTF::getPtr(impl->ariaFlowToElementAtIndex(index))); |
900 | } |
901 | |
902 | JSValueRef JSAccessibilityUIElement::ariaFlowToReferencingElementAtIndex(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
903 | { |
904 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
905 | if (!impl) |
906 | return JSValueMakeUndefined(context); |
907 | |
908 | double index = argumentCount > 0 ? JSValueToNumber(context, arguments[0], nullptr) : 0; |
909 | return toJS(context, WTF::getPtr(impl->ariaFlowToReferencingElementAtIndex(index))); |
910 | } |
911 | |
912 | JSValueRef JSAccessibilityUIElement::ariaControlsElementAtIndex(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
913 | { |
914 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
915 | if (!impl) |
916 | return JSValueMakeUndefined(context); |
917 | |
918 | double index = argumentCount > 0 ? JSValueToNumber(context, arguments[0], nullptr) : 0; |
919 | return toJS(context, WTF::getPtr(impl->ariaControlsElementAtIndex(index))); |
920 | } |
921 | |
922 | JSValueRef JSAccessibilityUIElement::ariaControlsReferencingElementAtIndex(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
923 | { |
924 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
925 | if (!impl) |
926 | return JSValueMakeUndefined(context); |
927 | |
928 | double index = argumentCount > 0 ? JSValueToNumber(context, arguments[0], nullptr) : 0; |
929 | return toJS(context, WTF::getPtr(impl->ariaControlsReferencingElementAtIndex(index))); |
930 | } |
931 | |
932 | JSValueRef JSAccessibilityUIElement::ariaLabelledByElementAtIndex(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
933 | { |
934 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
935 | if (!impl) |
936 | return JSValueMakeUndefined(context); |
937 | |
938 | double index = argumentCount > 0 ? JSValueToNumber(context, arguments[0], nullptr) : 0; |
939 | return toJS(context, WTF::getPtr(impl->ariaLabelledByElementAtIndex(index))); |
940 | } |
941 | |
942 | JSValueRef JSAccessibilityUIElement::ariaLabelledByReferencingElementAtIndex(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
943 | { |
944 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
945 | if (!impl) |
946 | return JSValueMakeUndefined(context); |
947 | |
948 | double index = argumentCount > 0 ? JSValueToNumber(context, arguments[0], nullptr) : 0; |
949 | return toJS(context, WTF::getPtr(impl->ariaLabelledByReferencingElementAtIndex(index))); |
950 | } |
951 | |
952 | JSValueRef JSAccessibilityUIElement::ariaDescribedByElementAtIndex(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
953 | { |
954 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
955 | if (!impl) |
956 | return JSValueMakeUndefined(context); |
957 | |
958 | double index = argumentCount > 0 ? JSValueToNumber(context, arguments[0], nullptr) : 0; |
959 | return toJS(context, WTF::getPtr(impl->ariaDescribedByElementAtIndex(index))); |
960 | } |
961 | |
962 | JSValueRef JSAccessibilityUIElement::ariaDescribedByReferencingElementAtIndex(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
963 | { |
964 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
965 | if (!impl) |
966 | return JSValueMakeUndefined(context); |
967 | |
968 | double index = argumentCount > 0 ? JSValueToNumber(context, arguments[0], nullptr) : 0; |
969 | return toJS(context, WTF::getPtr(impl->ariaDescribedByReferencingElementAtIndex(index))); |
970 | } |
971 | |
972 | JSValueRef JSAccessibilityUIElement::ariaDetailsElementAtIndex(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
973 | { |
974 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
975 | if (!impl) |
976 | return JSValueMakeUndefined(context); |
977 | |
978 | double index = argumentCount > 0 ? JSValueToNumber(context, arguments[0], nullptr) : 0; |
979 | return toJS(context, WTF::getPtr(impl->ariaDetailsElementAtIndex(index))); |
980 | } |
981 | |
982 | JSValueRef JSAccessibilityUIElement::ariaDetailsReferencingElementAtIndex(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
983 | { |
984 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
985 | if (!impl) |
986 | return JSValueMakeUndefined(context); |
987 | |
988 | double index = argumentCount > 0 ? JSValueToNumber(context, arguments[0], nullptr) : 0; |
989 | return toJS(context, WTF::getPtr(impl->ariaDetailsReferencingElementAtIndex(index))); |
990 | } |
991 | |
992 | JSValueRef JSAccessibilityUIElement::ariaErrorMessageElementAtIndex(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
993 | { |
994 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
995 | if (!impl) |
996 | return JSValueMakeUndefined(context); |
997 | |
998 | double index = argumentCount > 0 ? JSValueToNumber(context, arguments[0], nullptr) : 0; |
999 | return toJS(context, WTF::getPtr(impl->ariaErrorMessageElementAtIndex(index))); |
1000 | } |
1001 | |
1002 | JSValueRef JSAccessibilityUIElement::ariaErrorMessageReferencingElementAtIndex(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
1003 | { |
1004 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
1005 | if (!impl) |
1006 | return JSValueMakeUndefined(context); |
1007 | |
1008 | double index = argumentCount > 0 ? JSValueToNumber(context, arguments[0], nullptr) : 0; |
1009 | return toJS(context, WTF::getPtr(impl->ariaErrorMessageReferencingElementAtIndex(index))); |
1010 | } |
1011 | |
1012 | JSValueRef JSAccessibilityUIElement::parameterizedAttributeNames(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
1013 | { |
1014 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
1015 | if (!impl) |
1016 | return JSValueMakeUndefined(context); |
1017 | |
1018 | return JSValueMakeStringOrNull(context, impl->parameterizedAttributeNames().get()); |
1019 | } |
1020 | |
1021 | JSValueRef JSAccessibilityUIElement::lineForIndex(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
1022 | { |
1023 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
1024 | if (!impl) |
1025 | return JSValueMakeUndefined(context); |
1026 | |
1027 | double index = argumentCount > 0 ? JSValueToNumber(context, arguments[0], nullptr) : 0; |
1028 | return JSValueMakeNumber(context, impl->lineForIndex(index)); |
1029 | } |
1030 | |
1031 | JSValueRef JSAccessibilityUIElement::rangeForLine(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
1032 | { |
1033 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
1034 | if (!impl) |
1035 | return JSValueMakeUndefined(context); |
1036 | |
1037 | double index = argumentCount > 0 ? JSValueToNumber(context, arguments[0], nullptr) : 0; |
1038 | return JSValueMakeStringOrNull(context, impl->rangeForLine(index).get()); |
1039 | } |
1040 | |
1041 | JSValueRef JSAccessibilityUIElement::rangeForPosition(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
1042 | { |
1043 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
1044 | if (!impl) |
1045 | return JSValueMakeUndefined(context); |
1046 | |
1047 | double x = argumentCount > 0 ? JSValueToNumber(context, arguments[0], nullptr) : 0; |
1048 | double y = argumentCount > 1 ? JSValueToNumber(context, arguments[1], nullptr) : 0; |
1049 | return JSValueMakeStringOrNull(context, impl->rangeForPosition(x, y).get()); |
1050 | } |
1051 | |
1052 | JSValueRef JSAccessibilityUIElement::boundsForRange(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
1053 | { |
1054 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
1055 | if (!impl) |
1056 | return JSValueMakeUndefined(context); |
1057 | |
1058 | double location = argumentCount > 0 ? JSValueToNumber(context, arguments[0], nullptr) : 0; |
1059 | double length = argumentCount > 1 ? JSValueToNumber(context, arguments[1], nullptr) : 0; |
1060 | return JSValueMakeStringOrNull(context, impl->boundsForRange(location, length).get()); |
1061 | } |
1062 | |
1063 | JSValueRef JSAccessibilityUIElement::stringForRange(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
1064 | { |
1065 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
1066 | if (!impl) |
1067 | return JSValueMakeUndefined(context); |
1068 | |
1069 | double location = argumentCount > 0 ? JSValueToNumber(context, arguments[0], nullptr) : 0; |
1070 | double length = argumentCount > 1 ? JSValueToNumber(context, arguments[1], nullptr) : 0; |
1071 | return JSValueMakeStringOrNull(context, impl->stringForRange(location, length).get()); |
1072 | } |
1073 | |
1074 | JSValueRef JSAccessibilityUIElement::attributedStringForRange(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
1075 | { |
1076 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
1077 | if (!impl) |
1078 | return JSValueMakeUndefined(context); |
1079 | |
1080 | double location = argumentCount > 0 ? JSValueToNumber(context, arguments[0], nullptr) : 0; |
1081 | double length = argumentCount > 1 ? JSValueToNumber(context, arguments[1], nullptr) : 0; |
1082 | return JSValueMakeStringOrNull(context, impl->attributedStringForRange(location, length).get()); |
1083 | } |
1084 | |
1085 | JSValueRef JSAccessibilityUIElement::attributedStringForElement(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
1086 | { |
1087 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
1088 | if (!impl) |
1089 | return JSValueMakeUndefined(context); |
1090 | |
1091 | return JSValueMakeStringOrNull(context, impl->attributedStringForElement().get()); |
1092 | } |
1093 | |
1094 | JSValueRef JSAccessibilityUIElement::attributedStringRangeIsMisspelled(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
1095 | { |
1096 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
1097 | if (!impl) |
1098 | return JSValueMakeUndefined(context); |
1099 | |
1100 | double location = argumentCount > 0 ? JSValueToNumber(context, arguments[0], nullptr) : 0; |
1101 | double length = argumentCount > 1 ? JSValueToNumber(context, arguments[1], nullptr) : 0; |
1102 | return JSValueMakeBoolean(context, impl->attributedStringRangeIsMisspelled(location, length)); |
1103 | } |
1104 | |
1105 | JSValueRef JSAccessibilityUIElement::uiElementCountForSearchPredicate(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
1106 | { |
1107 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
1108 | if (!impl) |
1109 | return JSValueMakeUndefined(context); |
1110 | |
1111 | AccessibilityUIElement* startElement = argumentCount > 0 ? toAccessibilityUIElement(context, arguments[0]) : 0; |
1112 | bool isDirectionNext = argumentCount > 1 && JSValueToBoolean(context, arguments[1]); |
1113 | JSValueRef searchKey = argumentCount > 2 ? arguments[2] : JSValueMakeUndefined(context); |
1114 | JSRetainPtr<JSStringRef> searchText = argumentCount > 3 ? adopt(JSValueToStringCopy(context, arguments[3], nullptr)) : JSRetainPtr<JSStringRef>(); |
1115 | bool visibleOnly = argumentCount > 4 && JSValueToBoolean(context, arguments[4]); |
1116 | bool immediateDescendantsOnly = argumentCount > 5 && JSValueToBoolean(context, arguments[5]); |
1117 | return JSValueMakeNumber(context, impl->uiElementCountForSearchPredicate(context, startElement, isDirectionNext, searchKey, searchText.get(), visibleOnly, immediateDescendantsOnly)); |
1118 | } |
1119 | |
1120 | JSValueRef JSAccessibilityUIElement::uiElementForSearchPredicate(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
1121 | { |
1122 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
1123 | if (!impl) |
1124 | return JSValueMakeUndefined(context); |
1125 | |
1126 | AccessibilityUIElement* startElement = argumentCount > 0 ? toAccessibilityUIElement(context, arguments[0]) : 0; |
1127 | bool isDirectionNext = argumentCount > 1 && JSValueToBoolean(context, arguments[1]); |
1128 | JSValueRef searchKey = argumentCount > 2 ? arguments[2] : JSValueMakeUndefined(context); |
1129 | JSRetainPtr<JSStringRef> searchText = argumentCount > 3 ? adopt(JSValueToStringCopy(context, arguments[3], nullptr)) : JSRetainPtr<JSStringRef>(); |
1130 | bool visibleOnly = argumentCount > 4 && JSValueToBoolean(context, arguments[4]); |
1131 | bool immediateDescendantsOnly = argumentCount > 5 && JSValueToBoolean(context, arguments[5]); |
1132 | return toJS(context, WTF::getPtr(impl->uiElementForSearchPredicate(context, startElement, isDirectionNext, searchKey, searchText.get(), visibleOnly, immediateDescendantsOnly))); |
1133 | } |
1134 | |
1135 | JSValueRef JSAccessibilityUIElement::selectTextWithCriteria(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
1136 | { |
1137 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
1138 | if (!impl) |
1139 | return JSValueMakeUndefined(context); |
1140 | |
1141 | JSRetainPtr<JSStringRef> ambiguityResolution = argumentCount > 0 ? adopt(JSValueToStringCopy(context, arguments[0], nullptr)) : JSRetainPtr<JSStringRef>(); |
1142 | JSValueRef searchStrings = argumentCount > 1 ? arguments[1] : JSValueMakeUndefined(context); |
1143 | JSRetainPtr<JSStringRef> replacementString = argumentCount > 2 ? adopt(JSValueToStringCopy(context, arguments[2], nullptr)) : JSRetainPtr<JSStringRef>(); |
1144 | JSRetainPtr<JSStringRef> activity = argumentCount > 3 ? adopt(JSValueToStringCopy(context, arguments[3], nullptr)) : JSRetainPtr<JSStringRef>(); |
1145 | return JSValueMakeStringOrNull(context, impl->selectTextWithCriteria(context, ambiguityResolution.get(), searchStrings, replacementString.get(), activity.get()).get()); |
1146 | } |
1147 | |
1148 | JSValueRef JSAccessibilityUIElement::searchTextWithCriteria(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
1149 | { |
1150 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
1151 | if (!impl) |
1152 | return JSValueMakeUndefined(context); |
1153 | |
1154 | JSValueRef searchStrings = argumentCount > 0 ? arguments[0] : JSValueMakeUndefined(context); |
1155 | JSRetainPtr<JSStringRef> startFrom = argumentCount > 1 ? adopt(JSValueToStringCopy(context, arguments[1], nullptr)) : JSRetainPtr<JSStringRef>(); |
1156 | JSRetainPtr<JSStringRef> direction = argumentCount > 2 ? adopt(JSValueToStringCopy(context, arguments[2], nullptr)) : JSRetainPtr<JSStringRef>(); |
1157 | return impl->searchTextWithCriteria(context, searchStrings, startFrom.get(), direction.get()); |
1158 | } |
1159 | |
1160 | JSValueRef JSAccessibilityUIElement::(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
1161 | { |
1162 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
1163 | if (!impl) |
1164 | return JSValueMakeUndefined(context); |
1165 | |
1166 | double location = argumentCount > 0 ? JSValueToNumber(context, arguments[0], nullptr) : 0; |
1167 | double length = argumentCount > 1 ? JSValueToNumber(context, arguments[1], nullptr) : 0; |
1168 | return JSValueMakeBoolean(context, impl->setSelectedTextRange(location, length)); |
1169 | } |
1170 | |
1171 | JSValueRef JSAccessibilityUIElement::scrollToMakeVisible(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
1172 | { |
1173 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
1174 | if (!impl) |
1175 | return JSValueMakeUndefined(context); |
1176 | |
1177 | impl->scrollToMakeVisible(); |
1178 | |
1179 | return JSValueMakeUndefined(context); |
1180 | } |
1181 | |
1182 | JSValueRef JSAccessibilityUIElement::scrollToGlobalPoint(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
1183 | { |
1184 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
1185 | if (!impl) |
1186 | return JSValueMakeUndefined(context); |
1187 | |
1188 | double x = argumentCount > 0 ? JSValueToNumber(context, arguments[0], nullptr) : 0; |
1189 | double y = argumentCount > 1 ? JSValueToNumber(context, arguments[1], nullptr) : 0; |
1190 | impl->scrollToGlobalPoint(x, y); |
1191 | |
1192 | return JSValueMakeUndefined(context); |
1193 | } |
1194 | |
1195 | JSValueRef JSAccessibilityUIElement::scrollToMakeVisibleWithSubFocus(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
1196 | { |
1197 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
1198 | if (!impl) |
1199 | return JSValueMakeUndefined(context); |
1200 | |
1201 | double x = argumentCount > 0 ? JSValueToNumber(context, arguments[0], nullptr) : 0; |
1202 | double y = argumentCount > 1 ? JSValueToNumber(context, arguments[1], nullptr) : 0; |
1203 | double width = argumentCount > 2 ? JSValueToNumber(context, arguments[2], nullptr) : 0; |
1204 | double height = argumentCount > 3 ? JSValueToNumber(context, arguments[3], nullptr) : 0; |
1205 | impl->scrollToMakeVisibleWithSubFocus(x, y, width, height); |
1206 | |
1207 | return JSValueMakeUndefined(context); |
1208 | } |
1209 | |
1210 | JSValueRef JSAccessibilityUIElement::takeFocus(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
1211 | { |
1212 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
1213 | if (!impl) |
1214 | return JSValueMakeUndefined(context); |
1215 | |
1216 | impl->takeFocus(); |
1217 | |
1218 | return JSValueMakeUndefined(context); |
1219 | } |
1220 | |
1221 | JSValueRef JSAccessibilityUIElement::scrollPageDown(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
1222 | { |
1223 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
1224 | if (!impl) |
1225 | return JSValueMakeUndefined(context); |
1226 | |
1227 | return JSValueMakeBoolean(context, impl->scrollPageDown()); |
1228 | } |
1229 | |
1230 | JSValueRef JSAccessibilityUIElement::scrollPageUp(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
1231 | { |
1232 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
1233 | if (!impl) |
1234 | return JSValueMakeUndefined(context); |
1235 | |
1236 | return JSValueMakeBoolean(context, impl->scrollPageUp()); |
1237 | } |
1238 | |
1239 | JSValueRef JSAccessibilityUIElement::scrollPageLeft(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
1240 | { |
1241 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
1242 | if (!impl) |
1243 | return JSValueMakeUndefined(context); |
1244 | |
1245 | return JSValueMakeBoolean(context, impl->scrollPageLeft()); |
1246 | } |
1247 | |
1248 | JSValueRef JSAccessibilityUIElement::(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
1249 | { |
1250 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
1251 | if (!impl) |
1252 | return JSValueMakeUndefined(context); |
1253 | |
1254 | return JSValueMakeBoolean(context, impl->scrollPageRight()); |
1255 | } |
1256 | |
1257 | JSValueRef JSAccessibilityUIElement::lineTextMarkerRangeForTextMarker(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
1258 | { |
1259 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
1260 | if (!impl) |
1261 | return JSValueMakeUndefined(context); |
1262 | |
1263 | AccessibilityTextMarker* textMarker = argumentCount > 0 ? toAccessibilityTextMarker(context, arguments[0]) : 0; |
1264 | return toJS(context, WTF::getPtr(impl->lineTextMarkerRangeForTextMarker(textMarker))); |
1265 | } |
1266 | |
1267 | JSValueRef JSAccessibilityUIElement::textMarkerRangeForElement(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
1268 | { |
1269 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
1270 | if (!impl) |
1271 | return JSValueMakeUndefined(context); |
1272 | |
1273 | AccessibilityUIElement* element = argumentCount > 0 ? toAccessibilityUIElement(context, arguments[0]) : 0; |
1274 | return toJS(context, WTF::getPtr(impl->textMarkerRangeForElement(element))); |
1275 | } |
1276 | |
1277 | JSValueRef JSAccessibilityUIElement::textMarkerRangeForMarkers(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
1278 | { |
1279 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
1280 | if (!impl) |
1281 | return JSValueMakeUndefined(context); |
1282 | |
1283 | AccessibilityTextMarker* startMarker = argumentCount > 0 ? toAccessibilityTextMarker(context, arguments[0]) : 0; |
1284 | AccessibilityTextMarker* endMarker = argumentCount > 1 ? toAccessibilityTextMarker(context, arguments[1]) : 0; |
1285 | return toJS(context, WTF::getPtr(impl->textMarkerRangeForMarkers(startMarker, endMarker))); |
1286 | } |
1287 | |
1288 | JSValueRef JSAccessibilityUIElement::selectedTextMarkerRange(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
1289 | { |
1290 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
1291 | if (!impl) |
1292 | return JSValueMakeUndefined(context); |
1293 | |
1294 | return toJS(context, WTF::getPtr(impl->selectedTextMarkerRange())); |
1295 | } |
1296 | |
1297 | JSValueRef JSAccessibilityUIElement::resetSelectedTextMarkerRange(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
1298 | { |
1299 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
1300 | if (!impl) |
1301 | return JSValueMakeUndefined(context); |
1302 | |
1303 | impl->resetSelectedTextMarkerRange(); |
1304 | |
1305 | return JSValueMakeUndefined(context); |
1306 | } |
1307 | |
1308 | JSValueRef JSAccessibilityUIElement::replaceTextInRange(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
1309 | { |
1310 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
1311 | if (!impl) |
1312 | return JSValueMakeUndefined(context); |
1313 | |
1314 | JSRetainPtr<JSStringRef> string = argumentCount > 0 ? adopt(JSValueToStringCopy(context, arguments[0], nullptr)) : JSRetainPtr<JSStringRef>(); |
1315 | double position = argumentCount > 1 ? JSValueToNumber(context, arguments[1], nullptr) : 0; |
1316 | double length = argumentCount > 2 ? JSValueToNumber(context, arguments[2], nullptr) : 0; |
1317 | return JSValueMakeBoolean(context, impl->replaceTextInRange(string.get(), position, length)); |
1318 | } |
1319 | |
1320 | JSValueRef JSAccessibilityUIElement::startTextMarkerForTextMarkerRange(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
1321 | { |
1322 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
1323 | if (!impl) |
1324 | return JSValueMakeUndefined(context); |
1325 | |
1326 | AccessibilityTextMarkerRange* range = argumentCount > 0 ? toAccessibilityTextMarkerRange(context, arguments[0]) : 0; |
1327 | return toJS(context, WTF::getPtr(impl->startTextMarkerForTextMarkerRange(range))); |
1328 | } |
1329 | |
1330 | JSValueRef JSAccessibilityUIElement::endTextMarkerForTextMarkerRange(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
1331 | { |
1332 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
1333 | if (!impl) |
1334 | return JSValueMakeUndefined(context); |
1335 | |
1336 | AccessibilityTextMarkerRange* range = argumentCount > 0 ? toAccessibilityTextMarkerRange(context, arguments[0]) : 0; |
1337 | return toJS(context, WTF::getPtr(impl->endTextMarkerForTextMarkerRange(range))); |
1338 | } |
1339 | |
1340 | JSValueRef JSAccessibilityUIElement::endTextMarkerForBounds(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
1341 | { |
1342 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
1343 | if (!impl) |
1344 | return JSValueMakeUndefined(context); |
1345 | |
1346 | double x = argumentCount > 0 ? JSValueToNumber(context, arguments[0], nullptr) : 0; |
1347 | double y = argumentCount > 1 ? JSValueToNumber(context, arguments[1], nullptr) : 0; |
1348 | double width = argumentCount > 2 ? JSValueToNumber(context, arguments[2], nullptr) : 0; |
1349 | double height = argumentCount > 3 ? JSValueToNumber(context, arguments[3], nullptr) : 0; |
1350 | return toJS(context, WTF::getPtr(impl->endTextMarkerForBounds(x, y, width, height))); |
1351 | } |
1352 | |
1353 | JSValueRef JSAccessibilityUIElement::startTextMarkerForBounds(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
1354 | { |
1355 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
1356 | if (!impl) |
1357 | return JSValueMakeUndefined(context); |
1358 | |
1359 | double x = argumentCount > 0 ? JSValueToNumber(context, arguments[0], nullptr) : 0; |
1360 | double y = argumentCount > 1 ? JSValueToNumber(context, arguments[1], nullptr) : 0; |
1361 | double width = argumentCount > 2 ? JSValueToNumber(context, arguments[2], nullptr) : 0; |
1362 | double height = argumentCount > 3 ? JSValueToNumber(context, arguments[3], nullptr) : 0; |
1363 | return toJS(context, WTF::getPtr(impl->startTextMarkerForBounds(x, y, width, height))); |
1364 | } |
1365 | |
1366 | JSValueRef JSAccessibilityUIElement::textMarkerForPoint(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
1367 | { |
1368 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
1369 | if (!impl) |
1370 | return JSValueMakeUndefined(context); |
1371 | |
1372 | double x = argumentCount > 0 ? JSValueToNumber(context, arguments[0], nullptr) : 0; |
1373 | double y = argumentCount > 1 ? JSValueToNumber(context, arguments[1], nullptr) : 0; |
1374 | return toJS(context, WTF::getPtr(impl->textMarkerForPoint(x, y))); |
1375 | } |
1376 | |
1377 | JSValueRef JSAccessibilityUIElement::previousTextMarker(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
1378 | { |
1379 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
1380 | if (!impl) |
1381 | return JSValueMakeUndefined(context); |
1382 | |
1383 | AccessibilityTextMarker* marker = argumentCount > 0 ? toAccessibilityTextMarker(context, arguments[0]) : 0; |
1384 | return toJS(context, WTF::getPtr(impl->previousTextMarker(marker))); |
1385 | } |
1386 | |
1387 | JSValueRef JSAccessibilityUIElement::nextTextMarker(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
1388 | { |
1389 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
1390 | if (!impl) |
1391 | return JSValueMakeUndefined(context); |
1392 | |
1393 | AccessibilityTextMarker* marker = argumentCount > 0 ? toAccessibilityTextMarker(context, arguments[0]) : 0; |
1394 | return toJS(context, WTF::getPtr(impl->nextTextMarker(marker))); |
1395 | } |
1396 | |
1397 | JSValueRef JSAccessibilityUIElement::accessibilityElementForTextMarker(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
1398 | { |
1399 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
1400 | if (!impl) |
1401 | return JSValueMakeUndefined(context); |
1402 | |
1403 | AccessibilityTextMarker* marker = argumentCount > 0 ? toAccessibilityTextMarker(context, arguments[0]) : 0; |
1404 | return toJS(context, WTF::getPtr(impl->accessibilityElementForTextMarker(marker))); |
1405 | } |
1406 | |
1407 | JSValueRef JSAccessibilityUIElement::stringForTextMarkerRange(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
1408 | { |
1409 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
1410 | if (!impl) |
1411 | return JSValueMakeUndefined(context); |
1412 | |
1413 | AccessibilityTextMarkerRange* range = argumentCount > 0 ? toAccessibilityTextMarkerRange(context, arguments[0]) : 0; |
1414 | return JSValueMakeStringOrNull(context, impl->stringForTextMarkerRange(range).get()); |
1415 | } |
1416 | |
1417 | JSValueRef JSAccessibilityUIElement::attributedStringForTextMarkerRange(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
1418 | { |
1419 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
1420 | if (!impl) |
1421 | return JSValueMakeUndefined(context); |
1422 | |
1423 | AccessibilityTextMarkerRange* range = argumentCount > 0 ? toAccessibilityTextMarkerRange(context, arguments[0]) : 0; |
1424 | return JSValueMakeStringOrNull(context, impl->attributedStringForTextMarkerRange(range).get()); |
1425 | } |
1426 | |
1427 | JSValueRef JSAccessibilityUIElement::attributedStringForTextMarkerRangeWithOptions(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
1428 | { |
1429 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
1430 | if (!impl) |
1431 | return JSValueMakeUndefined(context); |
1432 | |
1433 | AccessibilityTextMarkerRange* range = argumentCount > 0 ? toAccessibilityTextMarkerRange(context, arguments[0]) : 0; |
1434 | bool includeSpellCheck = argumentCount > 1 && JSValueToBoolean(context, arguments[1]); |
1435 | return JSValueMakeStringOrNull(context, impl->attributedStringForTextMarkerRangeWithOptions(range, includeSpellCheck).get()); |
1436 | } |
1437 | |
1438 | JSValueRef JSAccessibilityUIElement::textMarkerRangeLength(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
1439 | { |
1440 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
1441 | if (!impl) |
1442 | return JSValueMakeUndefined(context); |
1443 | |
1444 | AccessibilityTextMarkerRange* range = argumentCount > 0 ? toAccessibilityTextMarkerRange(context, arguments[0]) : 0; |
1445 | return JSValueMakeNumber(context, impl->textMarkerRangeLength(range)); |
1446 | } |
1447 | |
1448 | JSValueRef JSAccessibilityUIElement::attributedStringForTextMarkerRangeContainsAttribute(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
1449 | { |
1450 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
1451 | if (!impl) |
1452 | return JSValueMakeUndefined(context); |
1453 | |
1454 | JSRetainPtr<JSStringRef> attr = argumentCount > 0 ? adopt(JSValueToStringCopy(context, arguments[0], nullptr)) : JSRetainPtr<JSStringRef>(); |
1455 | AccessibilityTextMarkerRange* range = argumentCount > 1 ? toAccessibilityTextMarkerRange(context, arguments[1]) : 0; |
1456 | return JSValueMakeBoolean(context, impl->attributedStringForTextMarkerRangeContainsAttribute(attr.get(), range)); |
1457 | } |
1458 | |
1459 | JSValueRef JSAccessibilityUIElement::indexForTextMarker(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
1460 | { |
1461 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
1462 | if (!impl) |
1463 | return JSValueMakeUndefined(context); |
1464 | |
1465 | AccessibilityTextMarker* marker = argumentCount > 0 ? toAccessibilityTextMarker(context, arguments[0]) : 0; |
1466 | return JSValueMakeNumber(context, impl->indexForTextMarker(marker)); |
1467 | } |
1468 | |
1469 | JSValueRef JSAccessibilityUIElement::isTextMarkerValid(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
1470 | { |
1471 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
1472 | if (!impl) |
1473 | return JSValueMakeUndefined(context); |
1474 | |
1475 | AccessibilityTextMarker* marker = argumentCount > 0 ? toAccessibilityTextMarker(context, arguments[0]) : 0; |
1476 | return JSValueMakeBoolean(context, impl->isTextMarkerValid(marker)); |
1477 | } |
1478 | |
1479 | JSValueRef JSAccessibilityUIElement::textMarkerForIndex(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
1480 | { |
1481 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
1482 | if (!impl) |
1483 | return JSValueMakeUndefined(context); |
1484 | |
1485 | double textIndex = argumentCount > 0 ? JSValueToNumber(context, arguments[0], nullptr) : 0; |
1486 | return toJS(context, WTF::getPtr(impl->textMarkerForIndex(textIndex))); |
1487 | } |
1488 | |
1489 | JSValueRef JSAccessibilityUIElement::(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
1490 | { |
1491 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
1492 | if (!impl) |
1493 | return JSValueMakeUndefined(context); |
1494 | |
1495 | AccessibilityTextMarkerRange* range = argumentCount > 0 ? toAccessibilityTextMarkerRange(context, arguments[0]) : 0; |
1496 | return JSValueMakeBoolean(context, impl->setSelectedVisibleTextRange(range)); |
1497 | } |
1498 | |
1499 | JSValueRef JSAccessibilityUIElement::leftWordTextMarkerRangeForTextMarker(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
1500 | { |
1501 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
1502 | if (!impl) |
1503 | return JSValueMakeUndefined(context); |
1504 | |
1505 | AccessibilityTextMarker* textMarker = argumentCount > 0 ? toAccessibilityTextMarker(context, arguments[0]) : 0; |
1506 | return toJS(context, WTF::getPtr(impl->leftWordTextMarkerRangeForTextMarker(textMarker))); |
1507 | } |
1508 | |
1509 | JSValueRef JSAccessibilityUIElement::rightWordTextMarkerRangeForTextMarker(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
1510 | { |
1511 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
1512 | if (!impl) |
1513 | return JSValueMakeUndefined(context); |
1514 | |
1515 | AccessibilityTextMarker* textMarker = argumentCount > 0 ? toAccessibilityTextMarker(context, arguments[0]) : 0; |
1516 | return toJS(context, WTF::getPtr(impl->rightWordTextMarkerRangeForTextMarker(textMarker))); |
1517 | } |
1518 | |
1519 | JSValueRef JSAccessibilityUIElement::previousWordStartTextMarkerForTextMarker(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
1520 | { |
1521 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
1522 | if (!impl) |
1523 | return JSValueMakeUndefined(context); |
1524 | |
1525 | AccessibilityTextMarker* textMarker = argumentCount > 0 ? toAccessibilityTextMarker(context, arguments[0]) : 0; |
1526 | return toJS(context, WTF::getPtr(impl->previousWordStartTextMarkerForTextMarker(textMarker))); |
1527 | } |
1528 | |
1529 | JSValueRef JSAccessibilityUIElement::nextWordEndTextMarkerForTextMarker(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
1530 | { |
1531 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
1532 | if (!impl) |
1533 | return JSValueMakeUndefined(context); |
1534 | |
1535 | AccessibilityTextMarker* textMarker = argumentCount > 0 ? toAccessibilityTextMarker(context, arguments[0]) : 0; |
1536 | return toJS(context, WTF::getPtr(impl->nextWordEndTextMarkerForTextMarker(textMarker))); |
1537 | } |
1538 | |
1539 | JSValueRef JSAccessibilityUIElement::paragraphTextMarkerRangeForTextMarker(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
1540 | { |
1541 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
1542 | if (!impl) |
1543 | return JSValueMakeUndefined(context); |
1544 | |
1545 | AccessibilityTextMarker* textMarker = argumentCount > 0 ? toAccessibilityTextMarker(context, arguments[0]) : 0; |
1546 | return toJS(context, WTF::getPtr(impl->paragraphTextMarkerRangeForTextMarker(textMarker))); |
1547 | } |
1548 | |
1549 | JSValueRef JSAccessibilityUIElement::previousParagraphStartTextMarkerForTextMarker(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
1550 | { |
1551 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
1552 | if (!impl) |
1553 | return JSValueMakeUndefined(context); |
1554 | |
1555 | AccessibilityTextMarker* textMarker = argumentCount > 0 ? toAccessibilityTextMarker(context, arguments[0]) : 0; |
1556 | return toJS(context, WTF::getPtr(impl->previousParagraphStartTextMarkerForTextMarker(textMarker))); |
1557 | } |
1558 | |
1559 | JSValueRef JSAccessibilityUIElement::nextParagraphEndTextMarkerForTextMarker(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
1560 | { |
1561 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
1562 | if (!impl) |
1563 | return JSValueMakeUndefined(context); |
1564 | |
1565 | AccessibilityTextMarker* textMarker = argumentCount > 0 ? toAccessibilityTextMarker(context, arguments[0]) : 0; |
1566 | return toJS(context, WTF::getPtr(impl->nextParagraphEndTextMarkerForTextMarker(textMarker))); |
1567 | } |
1568 | |
1569 | JSValueRef JSAccessibilityUIElement::sentenceTextMarkerRangeForTextMarker(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
1570 | { |
1571 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
1572 | if (!impl) |
1573 | return JSValueMakeUndefined(context); |
1574 | |
1575 | AccessibilityTextMarker* textMarker = argumentCount > 0 ? toAccessibilityTextMarker(context, arguments[0]) : 0; |
1576 | return toJS(context, WTF::getPtr(impl->sentenceTextMarkerRangeForTextMarker(textMarker))); |
1577 | } |
1578 | |
1579 | JSValueRef JSAccessibilityUIElement::previousSentenceStartTextMarkerForTextMarker(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
1580 | { |
1581 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
1582 | if (!impl) |
1583 | return JSValueMakeUndefined(context); |
1584 | |
1585 | AccessibilityTextMarker* textMarker = argumentCount > 0 ? toAccessibilityTextMarker(context, arguments[0]) : 0; |
1586 | return toJS(context, WTF::getPtr(impl->previousSentenceStartTextMarkerForTextMarker(textMarker))); |
1587 | } |
1588 | |
1589 | JSValueRef JSAccessibilityUIElement::nextSentenceEndTextMarkerForTextMarker(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
1590 | { |
1591 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
1592 | if (!impl) |
1593 | return JSValueMakeUndefined(context); |
1594 | |
1595 | AccessibilityTextMarker* textMarker = argumentCount > 0 ? toAccessibilityTextMarker(context, arguments[0]) : 0; |
1596 | return toJS(context, WTF::getPtr(impl->nextSentenceEndTextMarkerForTextMarker(textMarker))); |
1597 | } |
1598 | |
1599 | JSValueRef JSAccessibilityUIElement::textMarkerRangeMatchesTextNearMarkers(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
1600 | { |
1601 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
1602 | if (!impl) |
1603 | return JSValueMakeUndefined(context); |
1604 | |
1605 | JSRetainPtr<JSStringRef> text = argumentCount > 0 ? adopt(JSValueToStringCopy(context, arguments[0], nullptr)) : JSRetainPtr<JSStringRef>(); |
1606 | AccessibilityTextMarker* startMarker = argumentCount > 1 ? toAccessibilityTextMarker(context, arguments[1]) : 0; |
1607 | AccessibilityTextMarker* endMarker = argumentCount > 2 ? toAccessibilityTextMarker(context, arguments[2]) : 0; |
1608 | return toJS(context, WTF::getPtr(impl->textMarkerRangeMatchesTextNearMarkers(text.get(), startMarker, endMarker))); |
1609 | } |
1610 | |
1611 | JSValueRef JSAccessibilityUIElement::elementsForRange(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
1612 | { |
1613 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
1614 | if (!impl) |
1615 | return JSValueMakeUndefined(context); |
1616 | |
1617 | double location = argumentCount > 0 ? JSValueToNumber(context, arguments[0], nullptr) : 0; |
1618 | double length = argumentCount > 1 ? JSValueToNumber(context, arguments[1], nullptr) : 0; |
1619 | return impl->elementsForRange(location, length); |
1620 | } |
1621 | |
1622 | JSValueRef JSAccessibilityUIElement::increaseTextSelection(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
1623 | { |
1624 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
1625 | if (!impl) |
1626 | return JSValueMakeUndefined(context); |
1627 | |
1628 | impl->increaseTextSelection(); |
1629 | |
1630 | return JSValueMakeUndefined(context); |
1631 | } |
1632 | |
1633 | JSValueRef JSAccessibilityUIElement::decreaseTextSelection(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
1634 | { |
1635 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
1636 | if (!impl) |
1637 | return JSValueMakeUndefined(context); |
1638 | |
1639 | impl->decreaseTextSelection(); |
1640 | |
1641 | return JSValueMakeUndefined(context); |
1642 | } |
1643 | |
1644 | JSValueRef JSAccessibilityUIElement::linkedElement(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
1645 | { |
1646 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
1647 | if (!impl) |
1648 | return JSValueMakeUndefined(context); |
1649 | |
1650 | return toJS(context, WTF::getPtr(impl->linkedElement())); |
1651 | } |
1652 | |
1653 | JSValueRef JSAccessibilityUIElement::(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
1654 | { |
1655 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
1656 | if (!impl) |
1657 | return JSValueMakeUndefined(context); |
1658 | |
1659 | double index = argumentCount > 0 ? JSValueToNumber(context, arguments[0], nullptr) : 0; |
1660 | return toJS(context, WTF::getPtr(impl->headerElementAtIndex(index))); |
1661 | } |
1662 | |
1663 | JSValueRef JSAccessibilityUIElement::assistiveTechnologySimulatedFocus(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
1664 | { |
1665 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
1666 | if (!impl) |
1667 | return JSValueMakeUndefined(context); |
1668 | |
1669 | impl->assistiveTechnologySimulatedFocus(); |
1670 | |
1671 | return JSValueMakeUndefined(context); |
1672 | } |
1673 | |
1674 | JSValueRef JSAccessibilityUIElement::fieldsetAncestorElement(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
1675 | { |
1676 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
1677 | if (!impl) |
1678 | return JSValueMakeUndefined(context); |
1679 | |
1680 | return toJS(context, WTF::getPtr(impl->fieldsetAncestorElement())); |
1681 | } |
1682 | |
1683 | JSValueRef JSAccessibilityUIElement::addNotificationListener(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
1684 | { |
1685 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
1686 | if (!impl) |
1687 | return JSValueMakeUndefined(context); |
1688 | |
1689 | JSValueRef callbackFunction = argumentCount > 0 ? arguments[0] : JSValueMakeUndefined(context); |
1690 | return JSValueMakeBoolean(context, impl->addNotificationListener(callbackFunction)); |
1691 | } |
1692 | |
1693 | JSValueRef JSAccessibilityUIElement::removeNotificationListener(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) |
1694 | { |
1695 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, thisObject); |
1696 | if (!impl) |
1697 | return JSValueMakeUndefined(context); |
1698 | |
1699 | return JSValueMakeBoolean(context, impl->removeNotificationListener()); |
1700 | } |
1701 | |
1702 | // Attributes |
1703 | |
1704 | JSValueRef JSAccessibilityUIElement::documentEncoding(JSContextRef context, JSObjectRef object, JSStringRef, JSValueRef* exception) |
1705 | { |
1706 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, object); |
1707 | if (!impl) |
1708 | return JSValueMakeUndefined(context); |
1709 | |
1710 | return JSValueMakeStringOrNull(context, impl->documentEncoding().get()); |
1711 | } |
1712 | |
1713 | JSValueRef JSAccessibilityUIElement::documentURI(JSContextRef context, JSObjectRef object, JSStringRef, JSValueRef* exception) |
1714 | { |
1715 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, object); |
1716 | if (!impl) |
1717 | return JSValueMakeUndefined(context); |
1718 | |
1719 | return JSValueMakeStringOrNull(context, impl->documentURI().get()); |
1720 | } |
1721 | |
1722 | JSValueRef JSAccessibilityUIElement::role(JSContextRef context, JSObjectRef object, JSStringRef, JSValueRef* exception) |
1723 | { |
1724 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, object); |
1725 | if (!impl) |
1726 | return JSValueMakeUndefined(context); |
1727 | |
1728 | return JSValueMakeStringOrNull(context, impl->role().get()); |
1729 | } |
1730 | |
1731 | JSValueRef JSAccessibilityUIElement::subrole(JSContextRef context, JSObjectRef object, JSStringRef, JSValueRef* exception) |
1732 | { |
1733 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, object); |
1734 | if (!impl) |
1735 | return JSValueMakeUndefined(context); |
1736 | |
1737 | return JSValueMakeStringOrNull(context, impl->subrole().get()); |
1738 | } |
1739 | |
1740 | JSValueRef JSAccessibilityUIElement::roleDescription(JSContextRef context, JSObjectRef object, JSStringRef, JSValueRef* exception) |
1741 | { |
1742 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, object); |
1743 | if (!impl) |
1744 | return JSValueMakeUndefined(context); |
1745 | |
1746 | return JSValueMakeStringOrNull(context, impl->roleDescription().get()); |
1747 | } |
1748 | |
1749 | JSValueRef JSAccessibilityUIElement::computedRoleString(JSContextRef context, JSObjectRef object, JSStringRef, JSValueRef* exception) |
1750 | { |
1751 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, object); |
1752 | if (!impl) |
1753 | return JSValueMakeUndefined(context); |
1754 | |
1755 | return JSValueMakeStringOrNull(context, impl->computedRoleString().get()); |
1756 | } |
1757 | |
1758 | JSValueRef JSAccessibilityUIElement::title(JSContextRef context, JSObjectRef object, JSStringRef, JSValueRef* exception) |
1759 | { |
1760 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, object); |
1761 | if (!impl) |
1762 | return JSValueMakeUndefined(context); |
1763 | |
1764 | return JSValueMakeStringOrNull(context, impl->title().get()); |
1765 | } |
1766 | |
1767 | JSValueRef JSAccessibilityUIElement::description(JSContextRef context, JSObjectRef object, JSStringRef, JSValueRef* exception) |
1768 | { |
1769 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, object); |
1770 | if (!impl) |
1771 | return JSValueMakeUndefined(context); |
1772 | |
1773 | return JSValueMakeStringOrNull(context, impl->description().get()); |
1774 | } |
1775 | |
1776 | JSValueRef JSAccessibilityUIElement::language(JSContextRef context, JSObjectRef object, JSStringRef, JSValueRef* exception) |
1777 | { |
1778 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, object); |
1779 | if (!impl) |
1780 | return JSValueMakeUndefined(context); |
1781 | |
1782 | return JSValueMakeStringOrNull(context, impl->language().get()); |
1783 | } |
1784 | |
1785 | JSValueRef JSAccessibilityUIElement::helpText(JSContextRef context, JSObjectRef object, JSStringRef, JSValueRef* exception) |
1786 | { |
1787 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, object); |
1788 | if (!impl) |
1789 | return JSValueMakeUndefined(context); |
1790 | |
1791 | return JSValueMakeStringOrNull(context, impl->helpText().get()); |
1792 | } |
1793 | |
1794 | JSValueRef JSAccessibilityUIElement::valueDescription(JSContextRef context, JSObjectRef object, JSStringRef, JSValueRef* exception) |
1795 | { |
1796 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, object); |
1797 | if (!impl) |
1798 | return JSValueMakeUndefined(context); |
1799 | |
1800 | return JSValueMakeStringOrNull(context, impl->valueDescription().get()); |
1801 | } |
1802 | |
1803 | JSValueRef JSAccessibilityUIElement::url(JSContextRef context, JSObjectRef object, JSStringRef, JSValueRef* exception) |
1804 | { |
1805 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, object); |
1806 | if (!impl) |
1807 | return JSValueMakeUndefined(context); |
1808 | |
1809 | return JSValueMakeStringOrNull(context, impl->url().get()); |
1810 | } |
1811 | |
1812 | JSValueRef JSAccessibilityUIElement::speakAs(JSContextRef context, JSObjectRef object, JSStringRef, JSValueRef* exception) |
1813 | { |
1814 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, object); |
1815 | if (!impl) |
1816 | return JSValueMakeUndefined(context); |
1817 | |
1818 | return JSValueMakeStringOrNull(context, impl->speakAs().get()); |
1819 | } |
1820 | |
1821 | JSValueRef JSAccessibilityUIElement::orientation(JSContextRef context, JSObjectRef object, JSStringRef, JSValueRef* exception) |
1822 | { |
1823 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, object); |
1824 | if (!impl) |
1825 | return JSValueMakeUndefined(context); |
1826 | |
1827 | return JSValueMakeStringOrNull(context, impl->orientation().get()); |
1828 | } |
1829 | |
1830 | JSValueRef JSAccessibilityUIElement::insertionPointLineNumber(JSContextRef context, JSObjectRef object, JSStringRef, JSValueRef* exception) |
1831 | { |
1832 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, object); |
1833 | if (!impl) |
1834 | return JSValueMakeUndefined(context); |
1835 | |
1836 | return JSValueMakeNumber(context, impl->insertionPointLineNumber()); |
1837 | } |
1838 | |
1839 | JSValueRef JSAccessibilityUIElement::(JSContextRef context, JSObjectRef object, JSStringRef, JSValueRef* exception) |
1840 | { |
1841 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, object); |
1842 | if (!impl) |
1843 | return JSValueMakeUndefined(context); |
1844 | |
1845 | return JSValueMakeStringOrNull(context, impl->selectedTextRange().get()); |
1846 | } |
1847 | |
1848 | JSValueRef JSAccessibilityUIElement::stringValue(JSContextRef context, JSObjectRef object, JSStringRef, JSValueRef* exception) |
1849 | { |
1850 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, object); |
1851 | if (!impl) |
1852 | return JSValueMakeUndefined(context); |
1853 | |
1854 | return JSValueMakeStringOrNull(context, impl->stringValue().get()); |
1855 | } |
1856 | |
1857 | JSValueRef JSAccessibilityUIElement::intValue(JSContextRef context, JSObjectRef object, JSStringRef, JSValueRef* exception) |
1858 | { |
1859 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, object); |
1860 | if (!impl) |
1861 | return JSValueMakeUndefined(context); |
1862 | |
1863 | return JSValueMakeNumber(context, impl->intValue()); |
1864 | } |
1865 | |
1866 | JSValueRef JSAccessibilityUIElement::minValue(JSContextRef context, JSObjectRef object, JSStringRef, JSValueRef* exception) |
1867 | { |
1868 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, object); |
1869 | if (!impl) |
1870 | return JSValueMakeUndefined(context); |
1871 | |
1872 | return JSValueMakeNumber(context, impl->minValue()); |
1873 | } |
1874 | |
1875 | JSValueRef JSAccessibilityUIElement::maxValue(JSContextRef context, JSObjectRef object, JSStringRef, JSValueRef* exception) |
1876 | { |
1877 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, object); |
1878 | if (!impl) |
1879 | return JSValueMakeUndefined(context); |
1880 | |
1881 | return JSValueMakeNumber(context, impl->maxValue()); |
1882 | } |
1883 | |
1884 | JSValueRef JSAccessibilityUIElement::isEnabled(JSContextRef context, JSObjectRef object, JSStringRef, JSValueRef* exception) |
1885 | { |
1886 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, object); |
1887 | if (!impl) |
1888 | return JSValueMakeUndefined(context); |
1889 | |
1890 | return JSValueMakeBoolean(context, impl->isEnabled()); |
1891 | } |
1892 | |
1893 | JSValueRef JSAccessibilityUIElement::isRequired(JSContextRef context, JSObjectRef object, JSStringRef, JSValueRef* exception) |
1894 | { |
1895 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, object); |
1896 | if (!impl) |
1897 | return JSValueMakeUndefined(context); |
1898 | |
1899 | return JSValueMakeBoolean(context, impl->isRequired()); |
1900 | } |
1901 | |
1902 | JSValueRef JSAccessibilityUIElement::isFocused(JSContextRef context, JSObjectRef object, JSStringRef, JSValueRef* exception) |
1903 | { |
1904 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, object); |
1905 | if (!impl) |
1906 | return JSValueMakeUndefined(context); |
1907 | |
1908 | return JSValueMakeBoolean(context, impl->isFocused()); |
1909 | } |
1910 | |
1911 | JSValueRef JSAccessibilityUIElement::isFocusable(JSContextRef context, JSObjectRef object, JSStringRef, JSValueRef* exception) |
1912 | { |
1913 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, object); |
1914 | if (!impl) |
1915 | return JSValueMakeUndefined(context); |
1916 | |
1917 | return JSValueMakeBoolean(context, impl->isFocusable()); |
1918 | } |
1919 | |
1920 | JSValueRef JSAccessibilityUIElement::isSelectable(JSContextRef context, JSObjectRef object, JSStringRef, JSValueRef* exception) |
1921 | { |
1922 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, object); |
1923 | if (!impl) |
1924 | return JSValueMakeUndefined(context); |
1925 | |
1926 | return JSValueMakeBoolean(context, impl->isSelectable()); |
1927 | } |
1928 | |
1929 | JSValueRef JSAccessibilityUIElement::isSelected(JSContextRef context, JSObjectRef object, JSStringRef, JSValueRef* exception) |
1930 | { |
1931 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, object); |
1932 | if (!impl) |
1933 | return JSValueMakeUndefined(context); |
1934 | |
1935 | return JSValueMakeBoolean(context, impl->isSelected()); |
1936 | } |
1937 | |
1938 | JSValueRef JSAccessibilityUIElement::isSelectedOptionActive(JSContextRef context, JSObjectRef object, JSStringRef, JSValueRef* exception) |
1939 | { |
1940 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, object); |
1941 | if (!impl) |
1942 | return JSValueMakeUndefined(context); |
1943 | |
1944 | return JSValueMakeBoolean(context, impl->isSelectedOptionActive()); |
1945 | } |
1946 | |
1947 | JSValueRef JSAccessibilityUIElement::isMultiSelectable(JSContextRef context, JSObjectRef object, JSStringRef, JSValueRef* exception) |
1948 | { |
1949 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, object); |
1950 | if (!impl) |
1951 | return JSValueMakeUndefined(context); |
1952 | |
1953 | return JSValueMakeBoolean(context, impl->isMultiSelectable()); |
1954 | } |
1955 | |
1956 | JSValueRef JSAccessibilityUIElement::isExpanded(JSContextRef context, JSObjectRef object, JSStringRef, JSValueRef* exception) |
1957 | { |
1958 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, object); |
1959 | if (!impl) |
1960 | return JSValueMakeUndefined(context); |
1961 | |
1962 | return JSValueMakeBoolean(context, impl->isExpanded()); |
1963 | } |
1964 | |
1965 | JSValueRef JSAccessibilityUIElement::isChecked(JSContextRef context, JSObjectRef object, JSStringRef, JSValueRef* exception) |
1966 | { |
1967 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, object); |
1968 | if (!impl) |
1969 | return JSValueMakeUndefined(context); |
1970 | |
1971 | return JSValueMakeBoolean(context, impl->isChecked()); |
1972 | } |
1973 | |
1974 | JSValueRef JSAccessibilityUIElement::isIndeterminate(JSContextRef context, JSObjectRef object, JSStringRef, JSValueRef* exception) |
1975 | { |
1976 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, object); |
1977 | if (!impl) |
1978 | return JSValueMakeUndefined(context); |
1979 | |
1980 | return JSValueMakeBoolean(context, impl->isIndeterminate()); |
1981 | } |
1982 | |
1983 | JSValueRef JSAccessibilityUIElement::isVisible(JSContextRef context, JSObjectRef object, JSStringRef, JSValueRef* exception) |
1984 | { |
1985 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, object); |
1986 | if (!impl) |
1987 | return JSValueMakeUndefined(context); |
1988 | |
1989 | return JSValueMakeBoolean(context, impl->isVisible()); |
1990 | } |
1991 | |
1992 | JSValueRef JSAccessibilityUIElement::isCollapsed(JSContextRef context, JSObjectRef object, JSStringRef, JSValueRef* exception) |
1993 | { |
1994 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, object); |
1995 | if (!impl) |
1996 | return JSValueMakeUndefined(context); |
1997 | |
1998 | return JSValueMakeBoolean(context, impl->isCollapsed()); |
1999 | } |
2000 | |
2001 | JSValueRef JSAccessibilityUIElement::(JSContextRef context, JSObjectRef object, JSStringRef, JSValueRef* exception) |
2002 | { |
2003 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, object); |
2004 | if (!impl) |
2005 | return JSValueMakeUndefined(context); |
2006 | |
2007 | return JSValueMakeBoolean(context, impl->hasPopup()); |
2008 | } |
2009 | |
2010 | JSValueRef JSAccessibilityUIElement::isIgnored(JSContextRef context, JSObjectRef object, JSStringRef, JSValueRef* exception) |
2011 | { |
2012 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, object); |
2013 | if (!impl) |
2014 | return JSValueMakeUndefined(context); |
2015 | |
2016 | return JSValueMakeBoolean(context, impl->isIgnored()); |
2017 | } |
2018 | |
2019 | JSValueRef JSAccessibilityUIElement::isSingleLine(JSContextRef context, JSObjectRef object, JSStringRef, JSValueRef* exception) |
2020 | { |
2021 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, object); |
2022 | if (!impl) |
2023 | return JSValueMakeUndefined(context); |
2024 | |
2025 | return JSValueMakeBoolean(context, impl->isSingleLine()); |
2026 | } |
2027 | |
2028 | JSValueRef JSAccessibilityUIElement::isMultiLine(JSContextRef context, JSObjectRef object, JSStringRef, JSValueRef* exception) |
2029 | { |
2030 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, object); |
2031 | if (!impl) |
2032 | return JSValueMakeUndefined(context); |
2033 | |
2034 | return JSValueMakeBoolean(context, impl->isMultiLine()); |
2035 | } |
2036 | |
2037 | JSValueRef JSAccessibilityUIElement::isOffScreen(JSContextRef context, JSObjectRef object, JSStringRef, JSValueRef* exception) |
2038 | { |
2039 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, object); |
2040 | if (!impl) |
2041 | return JSValueMakeUndefined(context); |
2042 | |
2043 | return JSValueMakeBoolean(context, impl->isOffScreen()); |
2044 | } |
2045 | |
2046 | JSValueRef JSAccessibilityUIElement::isValid(JSContextRef context, JSObjectRef object, JSStringRef, JSValueRef* exception) |
2047 | { |
2048 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, object); |
2049 | if (!impl) |
2050 | return JSValueMakeUndefined(context); |
2051 | |
2052 | return JSValueMakeBoolean(context, impl->isValid()); |
2053 | } |
2054 | |
2055 | JSValueRef JSAccessibilityUIElement::hierarchicalLevel(JSContextRef context, JSObjectRef object, JSStringRef, JSValueRef* exception) |
2056 | { |
2057 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, object); |
2058 | if (!impl) |
2059 | return JSValueMakeUndefined(context); |
2060 | |
2061 | return JSValueMakeNumber(context, impl->hierarchicalLevel()); |
2062 | } |
2063 | |
2064 | JSValueRef JSAccessibilityUIElement::ariaIsGrabbed(JSContextRef context, JSObjectRef object, JSStringRef, JSValueRef* exception) |
2065 | { |
2066 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, object); |
2067 | if (!impl) |
2068 | return JSValueMakeUndefined(context); |
2069 | |
2070 | return JSValueMakeBoolean(context, impl->ariaIsGrabbed()); |
2071 | } |
2072 | |
2073 | JSValueRef JSAccessibilityUIElement::ariaDropEffects(JSContextRef context, JSObjectRef object, JSStringRef, JSValueRef* exception) |
2074 | { |
2075 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, object); |
2076 | if (!impl) |
2077 | return JSValueMakeUndefined(context); |
2078 | |
2079 | return JSValueMakeStringOrNull(context, impl->ariaDropEffects().get()); |
2080 | } |
2081 | |
2082 | JSValueRef JSAccessibilityUIElement::classList(JSContextRef context, JSObjectRef object, JSStringRef, JSValueRef* exception) |
2083 | { |
2084 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, object); |
2085 | if (!impl) |
2086 | return JSValueMakeUndefined(context); |
2087 | |
2088 | return JSValueMakeStringOrNull(context, impl->classList().get()); |
2089 | } |
2090 | |
2091 | JSValueRef JSAccessibilityUIElement::x(JSContextRef context, JSObjectRef object, JSStringRef, JSValueRef* exception) |
2092 | { |
2093 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, object); |
2094 | if (!impl) |
2095 | return JSValueMakeUndefined(context); |
2096 | |
2097 | return JSValueMakeNumber(context, impl->x()); |
2098 | } |
2099 | |
2100 | JSValueRef JSAccessibilityUIElement::y(JSContextRef context, JSObjectRef object, JSStringRef, JSValueRef* exception) |
2101 | { |
2102 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, object); |
2103 | if (!impl) |
2104 | return JSValueMakeUndefined(context); |
2105 | |
2106 | return JSValueMakeNumber(context, impl->y()); |
2107 | } |
2108 | |
2109 | JSValueRef JSAccessibilityUIElement::width(JSContextRef context, JSObjectRef object, JSStringRef, JSValueRef* exception) |
2110 | { |
2111 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, object); |
2112 | if (!impl) |
2113 | return JSValueMakeUndefined(context); |
2114 | |
2115 | return JSValueMakeNumber(context, impl->width()); |
2116 | } |
2117 | |
2118 | JSValueRef JSAccessibilityUIElement::height(JSContextRef context, JSObjectRef object, JSStringRef, JSValueRef* exception) |
2119 | { |
2120 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, object); |
2121 | if (!impl) |
2122 | return JSValueMakeUndefined(context); |
2123 | |
2124 | return JSValueMakeNumber(context, impl->height()); |
2125 | } |
2126 | |
2127 | JSValueRef JSAccessibilityUIElement::clickPointX(JSContextRef context, JSObjectRef object, JSStringRef, JSValueRef* exception) |
2128 | { |
2129 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, object); |
2130 | if (!impl) |
2131 | return JSValueMakeUndefined(context); |
2132 | |
2133 | return JSValueMakeNumber(context, impl->clickPointX()); |
2134 | } |
2135 | |
2136 | JSValueRef JSAccessibilityUIElement::clickPointY(JSContextRef context, JSObjectRef object, JSStringRef, JSValueRef* exception) |
2137 | { |
2138 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, object); |
2139 | if (!impl) |
2140 | return JSValueMakeUndefined(context); |
2141 | |
2142 | return JSValueMakeNumber(context, impl->clickPointY()); |
2143 | } |
2144 | |
2145 | JSValueRef JSAccessibilityUIElement::childrenCount(JSContextRef context, JSObjectRef object, JSStringRef, JSValueRef* exception) |
2146 | { |
2147 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, object); |
2148 | if (!impl) |
2149 | return JSValueMakeUndefined(context); |
2150 | |
2151 | return JSValueMakeNumber(context, impl->childrenCount()); |
2152 | } |
2153 | |
2154 | JSValueRef JSAccessibilityUIElement::selectedChildrenCount(JSContextRef context, JSObjectRef object, JSStringRef, JSValueRef* exception) |
2155 | { |
2156 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, object); |
2157 | if (!impl) |
2158 | return JSValueMakeUndefined(context); |
2159 | |
2160 | return JSValueMakeNumber(context, impl->selectedChildrenCount()); |
2161 | } |
2162 | |
2163 | JSValueRef JSAccessibilityUIElement::rowCount(JSContextRef context, JSObjectRef object, JSStringRef, JSValueRef* exception) |
2164 | { |
2165 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, object); |
2166 | if (!impl) |
2167 | return JSValueMakeUndefined(context); |
2168 | |
2169 | return JSValueMakeNumber(context, impl->rowCount()); |
2170 | } |
2171 | |
2172 | JSValueRef JSAccessibilityUIElement::columnCount(JSContextRef context, JSObjectRef object, JSStringRef, JSValueRef* exception) |
2173 | { |
2174 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, object); |
2175 | if (!impl) |
2176 | return JSValueMakeUndefined(context); |
2177 | |
2178 | return JSValueMakeNumber(context, impl->columnCount()); |
2179 | } |
2180 | |
2181 | JSValueRef JSAccessibilityUIElement::horizontalScrollbar(JSContextRef context, JSObjectRef object, JSStringRef, JSValueRef* exception) |
2182 | { |
2183 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, object); |
2184 | if (!impl) |
2185 | return JSValueMakeUndefined(context); |
2186 | |
2187 | return toJS(context, WTF::getPtr(impl->horizontalScrollbar())); |
2188 | } |
2189 | |
2190 | JSValueRef JSAccessibilityUIElement::verticalScrollbar(JSContextRef context, JSObjectRef object, JSStringRef, JSValueRef* exception) |
2191 | { |
2192 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, object); |
2193 | if (!impl) |
2194 | return JSValueMakeUndefined(context); |
2195 | |
2196 | return toJS(context, WTF::getPtr(impl->verticalScrollbar())); |
2197 | } |
2198 | |
2199 | JSValueRef JSAccessibilityUIElement::startTextMarker(JSContextRef context, JSObjectRef object, JSStringRef, JSValueRef* exception) |
2200 | { |
2201 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, object); |
2202 | if (!impl) |
2203 | return JSValueMakeUndefined(context); |
2204 | |
2205 | return toJS(context, WTF::getPtr(impl->startTextMarker())); |
2206 | } |
2207 | |
2208 | JSValueRef JSAccessibilityUIElement::endTextMarker(JSContextRef context, JSObjectRef object, JSStringRef, JSValueRef* exception) |
2209 | { |
2210 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, object); |
2211 | if (!impl) |
2212 | return JSValueMakeUndefined(context); |
2213 | |
2214 | return toJS(context, WTF::getPtr(impl->endTextMarker())); |
2215 | } |
2216 | |
2217 | JSValueRef JSAccessibilityUIElement::supportedActions(JSContextRef context, JSObjectRef object, JSStringRef, JSValueRef* exception) |
2218 | { |
2219 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, object); |
2220 | if (!impl) |
2221 | return JSValueMakeUndefined(context); |
2222 | |
2223 | return JSValueMakeStringOrNull(context, impl->supportedActions().get()); |
2224 | } |
2225 | |
2226 | JSValueRef JSAccessibilityUIElement::mathPostscriptsDescription(JSContextRef context, JSObjectRef object, JSStringRef, JSValueRef* exception) |
2227 | { |
2228 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, object); |
2229 | if (!impl) |
2230 | return JSValueMakeUndefined(context); |
2231 | |
2232 | return JSValueMakeStringOrNull(context, impl->mathPostscriptsDescription().get()); |
2233 | } |
2234 | |
2235 | JSValueRef JSAccessibilityUIElement::mathPrescriptsDescription(JSContextRef context, JSObjectRef object, JSStringRef, JSValueRef* exception) |
2236 | { |
2237 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, object); |
2238 | if (!impl) |
2239 | return JSValueMakeUndefined(context); |
2240 | |
2241 | return JSValueMakeStringOrNull(context, impl->mathPrescriptsDescription().get()); |
2242 | } |
2243 | |
2244 | JSValueRef JSAccessibilityUIElement::pathDescription(JSContextRef context, JSObjectRef object, JSStringRef, JSValueRef* exception) |
2245 | { |
2246 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, object); |
2247 | if (!impl) |
2248 | return JSValueMakeUndefined(context); |
2249 | |
2250 | return JSValueMakeStringOrNull(context, impl->pathDescription().get()); |
2251 | } |
2252 | |
2253 | JSValueRef JSAccessibilityUIElement::identifier(JSContextRef context, JSObjectRef object, JSStringRef, JSValueRef* exception) |
2254 | { |
2255 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, object); |
2256 | if (!impl) |
2257 | return JSValueMakeUndefined(context); |
2258 | |
2259 | return JSValueMakeStringOrNull(context, impl->identifier().get()); |
2260 | } |
2261 | |
2262 | JSValueRef JSAccessibilityUIElement::traits(JSContextRef context, JSObjectRef object, JSStringRef, JSValueRef* exception) |
2263 | { |
2264 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, object); |
2265 | if (!impl) |
2266 | return JSValueMakeUndefined(context); |
2267 | |
2268 | return JSValueMakeStringOrNull(context, impl->traits().get()); |
2269 | } |
2270 | |
2271 | JSValueRef JSAccessibilityUIElement::elementTextPosition(JSContextRef context, JSObjectRef object, JSStringRef, JSValueRef* exception) |
2272 | { |
2273 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, object); |
2274 | if (!impl) |
2275 | return JSValueMakeUndefined(context); |
2276 | |
2277 | return JSValueMakeNumber(context, impl->elementTextPosition()); |
2278 | } |
2279 | |
2280 | JSValueRef JSAccessibilityUIElement::elementTextLength(JSContextRef context, JSObjectRef object, JSStringRef, JSValueRef* exception) |
2281 | { |
2282 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, object); |
2283 | if (!impl) |
2284 | return JSValueMakeUndefined(context); |
2285 | |
2286 | return JSValueMakeNumber(context, impl->elementTextLength()); |
2287 | } |
2288 | |
2289 | JSValueRef JSAccessibilityUIElement::stringForSelection(JSContextRef context, JSObjectRef object, JSStringRef, JSValueRef* exception) |
2290 | { |
2291 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, object); |
2292 | if (!impl) |
2293 | return JSValueMakeUndefined(context); |
2294 | |
2295 | return JSValueMakeStringOrNull(context, impl->stringForSelection().get()); |
2296 | } |
2297 | |
2298 | JSValueRef JSAccessibilityUIElement::isSearchField(JSContextRef context, JSObjectRef object, JSStringRef, JSValueRef* exception) |
2299 | { |
2300 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, object); |
2301 | if (!impl) |
2302 | return JSValueMakeUndefined(context); |
2303 | |
2304 | return JSValueMakeBoolean(context, impl->isSearchField()); |
2305 | } |
2306 | |
2307 | JSValueRef JSAccessibilityUIElement::isTextArea(JSContextRef context, JSObjectRef object, JSStringRef, JSValueRef* exception) |
2308 | { |
2309 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, object); |
2310 | if (!impl) |
2311 | return JSValueMakeUndefined(context); |
2312 | |
2313 | return JSValueMakeBoolean(context, impl->isTextArea()); |
2314 | } |
2315 | |
2316 | JSValueRef JSAccessibilityUIElement::hasContainedByFieldsetTrait(JSContextRef context, JSObjectRef object, JSStringRef, JSValueRef* exception) |
2317 | { |
2318 | AccessibilityUIElement* impl = toAccessibilityUIElement(context, object); |
2319 | if (!impl) |
2320 | return JSValueMakeUndefined(context); |
2321 | |
2322 | return JSValueMakeBoolean(context, impl->hasContainedByFieldsetTrait()); |
2323 | } |
2324 | |
2325 | } // namespace WTR |
2326 | |
2327 | |