257d9a447efce4a34668e08727f763ad8d6af677
[WebKit-https.git] / Tools / DumpRenderTree / win / AccessibilityUIElementWin.cpp
1 /*
2  * Copyright (C) 2008, 2013 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. ``AS IS'' AND ANY
14  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
17  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
24  */
25
26 #include "config.h"
27 #include "AccessibilityUIElement.h"
28
29 #include "AccessibilityController.h"
30 #include "DumpRenderTree.h"
31 #include "FrameLoadDelegate.h"
32 #include <JavaScriptCore/JSStringRef.h>
33 #include <wtf/text/WTFString.h>
34 #include <comutil.h>
35 #include <tchar.h>
36 #include <string>
37
38 using std::wstring;
39
40 static COMPtr<IAccessibleComparable> comparableObject(IAccessible* accessible)
41 {
42     COMPtr<IServiceProvider> serviceProvider(Query, accessible);
43     if (!serviceProvider)
44         return 0;
45     COMPtr<IAccessibleComparable> comparable;
46     serviceProvider->QueryService(SID_AccessibleComparable, __uuidof(IAccessibleComparable), reinterpret_cast<void**>(&comparable));
47     return comparable;
48 }
49
50 AccessibilityUIElement::AccessibilityUIElement(PlatformUIElement element)
51     : m_element(element)
52 {
53 }
54
55 AccessibilityUIElement::AccessibilityUIElement(const AccessibilityUIElement& other)
56     : m_element(other.m_element)
57 {
58 }
59
60 AccessibilityUIElement::~AccessibilityUIElement()
61 {
62 }
63
64 bool AccessibilityUIElement::isEqual(AccessibilityUIElement* otherElement)
65 {
66     COMPtr<IAccessibleComparable> comparable = comparableObject(m_element.get());
67     COMPtr<IAccessibleComparable> otherComparable = comparableObject(otherElement->m_element.get());
68     if (!comparable || !otherComparable)
69         return false;
70     BOOL isSame = FALSE;
71     if (FAILED(comparable->isSameObject(otherComparable.get(), &isSame)))
72         return false;
73     return isSame;
74 }
75
76 void AccessibilityUIElement::getLinkedUIElements(Vector<AccessibilityUIElement>&)
77 {
78 }
79
80 void AccessibilityUIElement::getDocumentLinks(Vector<AccessibilityUIElement>&)
81 {
82 }
83
84 void AccessibilityUIElement::getChildren(Vector<AccessibilityUIElement>& children)
85 {
86     if (!m_element)
87         return;
88
89     long childCount;
90     if (FAILED(m_element->get_accChildCount(&childCount)))
91         return;
92     for (long i = 0; i < childCount; ++i)
93         children.append(getChildAtIndex(i));
94 }
95
96 void AccessibilityUIElement::getChildrenWithRange(Vector<AccessibilityUIElement>& elementVector, unsigned location, unsigned length)
97 {
98     if (!m_element)
99         return;
100
101     long childCount;
102     unsigned appendedCount = 0;
103     if (FAILED(m_element->get_accChildCount(&childCount)))
104         return;
105     for (long i = location; i < childCount && appendedCount < length; ++i, ++appendedCount)
106         elementVector.append(getChildAtIndex(i));
107 }
108
109 int AccessibilityUIElement::childrenCount()
110 {
111     if (!m_element)
112         return 0;
113
114     long childCount;
115     m_element->get_accChildCount(&childCount);
116     return childCount;
117 }
118
119 int AccessibilityUIElement::rowCount()
120 {
121     // FIXME: implement
122     return 0;
123 }
124  
125 int AccessibilityUIElement::columnCount()
126 {
127     // FIXME: implement
128     return 0;
129 }
130
131 AccessibilityUIElement AccessibilityUIElement::elementAtPoint(int x, int y)
132 {
133     return 0;
134 }
135
136 AccessibilityUIElement AccessibilityUIElement::linkedUIElementAtIndex(unsigned index)
137 {
138     // FIXME: implement
139     return 0;
140 }
141
142 AccessibilityUIElement AccessibilityUIElement::getChildAtIndex(unsigned index)
143 {
144     if (!m_element)
145         return 0;
146
147     COMPtr<IDispatch> child;
148     VARIANT vChild;
149     ::VariantInit(&vChild);
150     V_VT(&vChild) = VT_I4;
151     // In MSAA, index 0 is the object itself.
152     V_I4(&vChild) = index + 1;
153     if (FAILED(m_element->get_accChild(vChild, &child)))
154         return 0;
155     return COMPtr<IAccessible>(Query, child);
156 }
157
158 unsigned AccessibilityUIElement::indexOfChild(AccessibilityUIElement* element)
159
160     // FIXME: implement
161     return 0;
162 }
163
164 JSStringRef AccessibilityUIElement::allAttributes()
165 {
166     return JSStringCreateWithCharacters(0, 0);
167 }
168
169 JSStringRef AccessibilityUIElement::attributesOfLinkedUIElements()
170 {
171     return JSStringCreateWithCharacters(0, 0);
172 }
173
174 JSStringRef AccessibilityUIElement::attributesOfDocumentLinks()
175 {
176     return JSStringCreateWithCharacters(0, 0);
177 }
178
179 AccessibilityUIElement AccessibilityUIElement::titleUIElement()
180 {
181     COMPtr<IAccessible> platformElement = platformUIElement();
182
183     COMPtr<IAccessibleComparable> comparable = comparableObject(platformElement.get());
184     if (!comparable)
185         return 0;
186
187     VARIANT value;
188     ::VariantInit(&value);
189
190     _bstr_t titleUIElementAttributeKey(L"AXTitleUIElementAttribute");
191     if (FAILED(comparable->get_attribute(titleUIElementAttributeKey, &value))) {
192         ::VariantClear(&value);
193         return 0;
194     }
195
196     if (V_VT(&value) == VT_EMPTY) {
197         ::VariantClear(&value);
198         return 0;
199     }
200
201     ASSERT(V_VT(&value) == VT_UNKNOWN);
202
203     if (V_VT(&value) != VT_UNKNOWN) {
204         ::VariantClear(&value);
205         return 0;
206     }
207
208     COMPtr<IAccessible> titleElement(Query, value.punkVal);
209     if (value.punkVal)
210         value.punkVal->Release();
211     ::VariantClear(&value);
212
213     return titleElement;
214 }
215
216 AccessibilityUIElement AccessibilityUIElement::parentElement()
217 {
218     if (!m_element)
219         return 0;
220
221     COMPtr<IDispatch> parent;
222     m_element->get_accParent(&parent);
223
224     COMPtr<IAccessible> parentAccessible(Query, parent);
225     return parentAccessible;
226 }
227
228 JSStringRef AccessibilityUIElement::attributesOfChildren()
229 {
230     return JSStringCreateWithCharacters(0, 0);
231 }
232
233 JSStringRef AccessibilityUIElement::parameterizedAttributeNames()
234 {
235     return JSStringCreateWithCharacters(0, 0);
236 }
237
238 static VARIANT& self()
239 {
240     static VARIANT vSelf;
241     static bool haveInitialized;
242
243     if (!haveInitialized) {
244         ::VariantInit(&vSelf);
245         V_VT(&vSelf) = VT_I4;
246         V_I4(&vSelf) = CHILDID_SELF;
247     }
248     return vSelf;
249 }
250
251 JSStringRef AccessibilityUIElement::role()
252 {
253     if (!m_element)
254         return JSStringCreateWithCharacters(0, 0);
255
256     VARIANT vRole;
257     if (FAILED(m_element->get_accRole(self(), &vRole)))
258         return JSStringCreateWithCharacters(0, 0);
259
260     ASSERT(V_VT(&vRole) == VT_I4 || V_VT(&vRole) == VT_BSTR);
261
262     wstring result;
263     if (V_VT(&vRole) == VT_I4) {
264         unsigned roleTextLength = ::GetRoleText(V_I4(&vRole), 0, 0) + 1;
265
266         Vector<TCHAR> roleText(roleTextLength);
267
268         ::GetRoleText(V_I4(&vRole), roleText.data(), roleTextLength);
269
270         result = roleText.data();
271     } else if (V_VT(&vRole) == VT_BSTR)
272         result = wstring(V_BSTR(&vRole), ::SysStringLen(V_BSTR(&vRole)));
273
274     ::VariantClear(&vRole);
275
276     return JSStringCreateWithCharacters(result.data(), result.length());
277 }
278
279 JSStringRef AccessibilityUIElement::subrole()
280 {
281     return 0;
282 }
283
284 JSStringRef AccessibilityUIElement::roleDescription()
285 {
286     return 0;
287 }
288
289 JSStringRef AccessibilityUIElement::computedRoleString()
290 {
291     return 0;
292 }
293
294 JSStringRef AccessibilityUIElement::title()
295 {
296     if (!m_element)
297         return JSStringCreateWithCharacters(0, 0);
298
299     BSTR titleBSTR;
300     if (FAILED(m_element->get_accName(self(), &titleBSTR)) || !titleBSTR)
301         return JSStringCreateWithCharacters(0, 0);
302     wstring title(titleBSTR, SysStringLen(titleBSTR));
303     ::SysFreeString(titleBSTR);
304     return JSStringCreateWithCharacters(title.data(), title.length());
305 }
306
307 JSStringRef AccessibilityUIElement::description()
308 {
309     if (!m_element)
310         return JSStringCreateWithCharacters(0, 0);
311
312     BSTR descriptionBSTR;
313     if (FAILED(m_element->get_accDescription(self(), &descriptionBSTR)) || !descriptionBSTR)
314         return JSStringCreateWithCharacters(0, 0);
315     wstring description(descriptionBSTR, SysStringLen(descriptionBSTR));
316     ::SysFreeString(descriptionBSTR);
317     return JSStringCreateWithCharacters(description.data(), description.length());
318 }
319
320 JSStringRef AccessibilityUIElement::stringValue()
321 {
322     return JSStringCreateWithCharacters(0, 0);
323 }
324
325 JSStringRef AccessibilityUIElement::language()
326 {
327     return JSStringCreateWithCharacters(0, 0);
328 }
329
330 JSStringRef AccessibilityUIElement::helpText() const
331 {
332     if (!m_element)
333         return JSStringCreateWithCharacters(0, 0);
334
335     BSTR helpTextBSTR;
336     if (FAILED(m_element->get_accHelp(self(), &helpTextBSTR)) || !helpTextBSTR)
337         return JSStringCreateWithCharacters(0, 0);
338     wstring helpText(helpTextBSTR, SysStringLen(helpTextBSTR));
339     ::SysFreeString(helpTextBSTR);
340     return JSStringCreateWithCharacters(helpText.data(), helpText.length());
341 }
342
343 double AccessibilityUIElement::x()
344 {
345     if (!m_element)
346         return 0;
347
348     long x, y, width, height;
349     if (FAILED(m_element->accLocation(&x, &y, &width, &height, self())))
350         return 0;
351     return x;
352 }
353
354 double AccessibilityUIElement::y()
355 {
356     if (!m_element)
357         return 0;
358
359     long x, y, width, height;
360     if (FAILED(m_element->accLocation(&x, &y, &width, &height, self())))
361         return 0;
362     return y;
363 }
364
365 double AccessibilityUIElement::width()
366 {
367     if (!m_element)
368         return 0;
369
370     long x, y, width, height;
371     if (FAILED(m_element->accLocation(&x, &y, &width, &height, self())))
372         return 0;
373     return width;
374 }
375
376 double AccessibilityUIElement::height()
377 {
378     if (!m_element)
379         return 0;
380
381     long x, y, width, height;
382     if (FAILED(m_element->accLocation(&x, &y, &width, &height, self())))
383         return 0;
384     return height;
385 }
386
387 double AccessibilityUIElement::clickPointX()
388 {
389     return 0;
390 }
391
392 double AccessibilityUIElement::clickPointY()
393 {
394     return 0;
395 }
396
397 JSStringRef AccessibilityUIElement::valueDescription()
398 {
399     return 0;
400 }
401
402 static DWORD accessibilityState(COMPtr<IAccessible> element)
403 {
404     VARIANT state;
405     element->get_accState(self(), &state);
406
407     ASSERT(V_VT(&state) == VT_I4);
408
409     DWORD result = state.lVal;
410     VariantClear(&state);
411
412     return result;
413 }
414
415 bool AccessibilityUIElement::isFocused() const
416 {
417     // FIXME: implement
418     return false;
419 }
420
421 bool AccessibilityUIElement::isSelected() const
422 {
423     DWORD state = accessibilityState(m_element);
424     return (state & STATE_SYSTEM_SELECTED) == STATE_SYSTEM_SELECTED;
425 }
426
427 int AccessibilityUIElement::hierarchicalLevel() const
428 {
429     return 0;
430 }
431
432 bool AccessibilityUIElement::ariaIsGrabbed() const
433 {
434     return false;
435 }
436  
437 JSStringRef AccessibilityUIElement::ariaDropEffects() const
438 {
439     return 0;
440 }
441
442 bool AccessibilityUIElement::isExpanded() const
443 {
444     return false;
445 }
446
447 bool AccessibilityUIElement::isChecked() const
448 {
449     if (!m_element)
450         return false;
451
452     VARIANT vState;
453     if (FAILED(m_element->get_accState(self(), &vState)))
454         return false;
455
456     return vState.lVal & STATE_SYSTEM_CHECKED;
457 }
458
459 bool AccessibilityUIElement::isIndeterminate() const
460 {
461     // FIXME: implement
462     return false;
463 }
464
465 JSStringRef AccessibilityUIElement::orientation() const
466 {
467     return 0;
468 }
469
470 double AccessibilityUIElement::intValue() const
471 {
472     if (!m_element)
473         return 0;
474
475     BSTR valueBSTR;
476     if (FAILED(m_element->get_accValue(self(), &valueBSTR)) || !valueBSTR)
477         return 0;
478     wstring value(valueBSTR, SysStringLen(valueBSTR));
479     ::SysFreeString(valueBSTR);
480     TCHAR* ignored;
481     return _tcstod(value.data(), &ignored);
482 }
483
484 double AccessibilityUIElement::minValue()
485 {
486     return 0;
487 }
488
489 double AccessibilityUIElement::maxValue()
490 {
491     return 0;
492 }
493
494 bool AccessibilityUIElement::isPressActionSupported()
495 {
496     if (!m_element)
497         return 0;
498
499     BSTR valueBSTR;
500     if (FAILED(m_element->get_accDefaultAction(self(), &valueBSTR) || !valueBSTR))
501         return false;
502
503     if (!::SysStringLen(valueBSTR))
504         return false;
505
506     return true;
507 }
508
509 bool AccessibilityUIElement::isIncrementActionSupported()
510 {
511     return false;
512 }
513
514 bool AccessibilityUIElement::isDecrementActionSupported()
515 {
516     return false;
517 }
518
519 bool AccessibilityUIElement::isEnabled()
520 {
521     DWORD state = accessibilityState(m_element);
522     return (state & STATE_SYSTEM_UNAVAILABLE) != STATE_SYSTEM_UNAVAILABLE;
523 }
524
525 bool AccessibilityUIElement::isRequired() const
526 {
527     return false;
528 }
529
530
531 int AccessibilityUIElement::insertionPointLineNumber()
532 {
533     return 0;
534 }
535
536 JSStringRef AccessibilityUIElement::attributesOfColumnHeaders()
537 {
538     return JSStringCreateWithCharacters(0, 0);
539 }
540
541 JSStringRef AccessibilityUIElement::attributesOfRowHeaders()
542 {
543     return JSStringCreateWithCharacters(0, 0);
544 }
545
546 JSStringRef AccessibilityUIElement::attributesOfColumns()
547 {
548     return JSStringCreateWithCharacters(0, 0);
549 }
550
551 JSStringRef AccessibilityUIElement::attributesOfRows()
552 {
553     return JSStringCreateWithCharacters(0, 0);
554 }
555
556 JSStringRef AccessibilityUIElement::attributesOfVisibleCells()
557 {
558     return JSStringCreateWithCharacters(0, 0);
559 }
560
561 JSStringRef AccessibilityUIElement::attributesOfHeader()
562 {
563     return JSStringCreateWithCharacters(0, 0);
564 }
565
566 int AccessibilityUIElement::indexInTable()
567 {
568     return 0;
569 }
570
571 JSStringRef AccessibilityUIElement::rowIndexRange()
572 {
573     return JSStringCreateWithCharacters(0, 0);
574 }
575
576 JSStringRef AccessibilityUIElement::columnIndexRange()
577 {
578     return JSStringCreateWithCharacters(0, 0);
579 }
580
581 int AccessibilityUIElement::lineForIndex(int)
582 {
583     return 0;
584 }
585
586 JSStringRef AccessibilityUIElement::boundsForRange(unsigned location, unsigned length)
587 {
588     return JSStringCreateWithCharacters(0, 0);
589 }
590
591 JSStringRef AccessibilityUIElement::stringForRange(unsigned, unsigned)
592 {
593     return JSStringCreateWithCharacters(0, 0);
594 }
595
596 JSStringRef AccessibilityUIElement::attributedStringForRange(unsigned, unsigned)
597 {
598     return JSStringCreateWithCharacters(0, 0);
599 }
600
601 bool AccessibilityUIElement::attributedStringRangeIsMisspelled(unsigned, unsigned)
602 {
603     return false;
604 }
605
606 unsigned AccessibilityUIElement::uiElementCountForSearchPredicate(JSContextRef context, AccessibilityUIElement* startElement, bool isDirectionNext, JSValueRef searchKey, JSStringRef searchText, bool visibleOnly, bool immediateDescendantsOnly)
607 {
608     return 0;
609 }
610
611 AccessibilityUIElement AccessibilityUIElement::uiElementForSearchPredicate(JSContextRef context, AccessibilityUIElement* startElement, bool isDirectionNext, JSValueRef searchKey, JSStringRef searchText, bool visibleOnly, bool immediateDescendantsOnly)
612 {
613     return 0;
614 }
615
616 JSStringRef AccessibilityUIElement::selectTextWithCriteria(JSContextRef context, JSStringRef ambiguityResolution, JSValueRef searchStrings, JSStringRef replacementString)
617 {
618     return 0;
619 }
620
621 AccessibilityUIElement AccessibilityUIElement::cellForColumnAndRow(unsigned column, unsigned row)
622 {
623     return 0;
624 }
625
626 JSStringRef AccessibilityUIElement::selectedTextRange()
627 {
628     return JSStringCreateWithCharacters(0, 0);    
629 }
630
631 void AccessibilityUIElement::setSelectedTextRange(unsigned location, unsigned length)
632 {
633 }
634
635 JSStringRef AccessibilityUIElement::stringAttributeValue(JSStringRef attribute)
636 {
637     // FIXME: implement
638     return JSStringCreateWithCharacters(0, 0);
639 }
640
641 double AccessibilityUIElement::numberAttributeValue(JSStringRef attribute)
642 {
643     // FIXME: implement
644     return 0;
645 }
646
647 bool AccessibilityUIElement::boolAttributeValue(JSStringRef attribute)
648 {
649     // FIXME: implement
650     return false;
651 }
652
653 bool AccessibilityUIElement::isAttributeSettable(JSStringRef attribute)
654 {
655     return false;
656 }
657
658 bool AccessibilityUIElement::isAttributeSupported(JSStringRef attribute)
659 {
660     return false;
661 }
662
663 void AccessibilityUIElement::increment()
664 {
665 }
666
667 void AccessibilityUIElement::decrement()
668 {
669 }
670
671 void AccessibilityUIElement::showMenu()
672 {
673     if (!m_element)
674         return;
675
676     ASSERT(hasPopup());
677     m_element->accDoDefaultAction(self());
678 }
679
680 void AccessibilityUIElement::press()
681 {
682     if (!m_element)
683         return;
684
685     m_element->accDoDefaultAction(self());
686 }
687
688 AccessibilityUIElement AccessibilityUIElement::disclosedRowAtIndex(unsigned index)
689 {
690     return 0;
691 }
692
693 AccessibilityUIElement AccessibilityUIElement::ariaOwnsElementAtIndex(unsigned index)
694 {
695     return 0;
696 }
697
698 AccessibilityUIElement AccessibilityUIElement::ariaFlowToElementAtIndex(unsigned index)
699 {
700     return 0;
701 }
702
703 AccessibilityUIElement AccessibilityUIElement::ariaControlsElementAtIndex(unsigned index)
704 {
705     return 0;
706 }
707
708 AccessibilityUIElement AccessibilityUIElement::selectedRowAtIndex(unsigned index)
709 {
710     return 0;
711 }
712
713 AccessibilityUIElement AccessibilityUIElement::rowAtIndex(unsigned index)
714 {
715     return 0;
716 }
717
718 AccessibilityUIElement AccessibilityUIElement::disclosedByRow()
719 {
720     return 0;
721 }
722
723 JSStringRef AccessibilityUIElement::accessibilityValue() const
724 {
725     if (!m_element)
726         return JSStringCreateWithCharacters(0, 0);
727
728     BSTR valueBSTR;
729     if (FAILED(m_element->get_accValue(self(), &valueBSTR)) || !valueBSTR)
730         return JSStringCreateWithCharacters(0, 0);
731
732     wstring value(valueBSTR, SysStringLen(valueBSTR));
733     ::SysFreeString(valueBSTR);
734
735     return JSStringCreateWithCharacters(value.data(), value.length());
736 }
737
738
739 JSStringRef AccessibilityUIElement::documentEncoding()
740 {
741     return JSStringCreateWithCharacters(0, 0);
742 }
743
744 JSStringRef AccessibilityUIElement::documentURI()
745 {
746     return JSStringCreateWithCharacters(0, 0);
747 }
748
749 JSStringRef AccessibilityUIElement::url()
750 {
751     // FIXME: implement
752     return JSStringCreateWithCharacters(0, 0);
753 }
754
755 bool AccessibilityUIElement::addNotificationListener(JSObjectRef functionCallback)
756 {
757     if (!functionCallback)
758         return false;
759
760     sharedFrameLoadDelegate->accessibilityController()->winAddNotificationListener(m_element, functionCallback);
761     return true;
762 }
763
764 void AccessibilityUIElement::removeNotificationListener()
765 {
766     // FIXME: implement
767 }
768
769 bool AccessibilityUIElement::isFocusable() const
770 {
771     // FIXME: implement
772     return false;
773 }
774
775 bool AccessibilityUIElement::isSelectable() const
776 {
777     DWORD state = accessibilityState(m_element);
778     return (state & STATE_SYSTEM_SELECTABLE) == STATE_SYSTEM_SELECTABLE;
779 }
780
781 bool AccessibilityUIElement::isMultiSelectable() const
782 {
783     DWORD multiSelectable = STATE_SYSTEM_EXTSELECTABLE | STATE_SYSTEM_MULTISELECTABLE;
784     DWORD state = accessibilityState(m_element);
785     return (state & multiSelectable) == multiSelectable;
786 }
787
788 bool AccessibilityUIElement::isSelectedOptionActive() const
789 {
790     // FIXME: implement
791     return false;
792 }
793
794 bool AccessibilityUIElement::isVisible() const
795 {
796     DWORD state = accessibilityState(m_element);
797     return (state & STATE_SYSTEM_INVISIBLE) != STATE_SYSTEM_INVISIBLE;
798 }
799
800 bool AccessibilityUIElement::isOffScreen() const
801 {
802     DWORD state = accessibilityState(m_element);
803     return (state & STATE_SYSTEM_OFFSCREEN) == STATE_SYSTEM_OFFSCREEN;
804 }
805
806 bool AccessibilityUIElement::isCollapsed() const
807 {
808     DWORD state = accessibilityState(m_element);
809     return (state & STATE_SYSTEM_COLLAPSED) == STATE_SYSTEM_COLLAPSED;
810 }
811
812 bool AccessibilityUIElement::isIgnored() const
813 {
814     // FIXME: implement
815     return false;
816 }
817
818 bool AccessibilityUIElement::hasPopup() const
819 {
820     DWORD state = accessibilityState(m_element);
821     return (state & STATE_SYSTEM_HASPOPUP) == STATE_SYSTEM_HASPOPUP;
822 }
823
824 void AccessibilityUIElement::takeFocus()
825 {
826     if (!m_element)
827         return;
828
829     m_element->accSelect(SELFLAG_TAKEFOCUS, self());
830 }
831
832 void AccessibilityUIElement::takeSelection()
833 {
834     if (!m_element)
835         return;
836
837     m_element->accSelect(SELFLAG_TAKESELECTION, self());
838 }
839
840 void AccessibilityUIElement::addSelection()
841 {
842     if (!m_element)
843         return;
844
845     m_element->accSelect(SELFLAG_ADDSELECTION, self());
846 }
847
848 void AccessibilityUIElement::removeSelection()
849 {
850     if (!m_element)
851         return;
852
853     m_element->accSelect(SELFLAG_REMOVESELECTION, self());
854 }
855
856 void AccessibilityUIElement::scrollToMakeVisible()
857 {
858     // FIXME: implement
859 }
860
861 void AccessibilityUIElement::scrollToMakeVisibleWithSubFocus(int x, int y, int width, int height)
862 {
863     // FIXME: implement
864 }
865
866 void AccessibilityUIElement::scrollToGlobalPoint(int x, int y)
867 {
868     // FIXME: implement
869 }
870
871 JSStringRef AccessibilityUIElement::classList() const
872 {
873     // FIXME: implement
874     return 0;
875 }
876
877 unsigned AccessibilityUIElement::selectedChildrenCount() const
878 {
879     // FIXME: implement
880     return 0;
881 }
882
883 AccessibilityUIElement AccessibilityUIElement::selectedChildAtIndex(unsigned) const
884 {
885     // FIXME: implement
886     return 0;
887 }
888
889 void AccessibilityUIElement::columnHeaders(Vector<AccessibilityUIElement>&) const
890 {
891     // FIXME: implement
892 }
893
894 void AccessibilityUIElement::rowHeaders(Vector<AccessibilityUIElement>&) const
895 {
896     // FIXME: implement
897 }