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