2
* Copyright (C) 2019 Apple Inc. All rights reserved.
4
* Redistribution and use in source and binary forms, with or without
5
* modification, are permitted provided that the following conditions
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.
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.
28
#if ENABLE(ACCESSIBILITY_ISOLATED_TREE)
30
#include "AXObjectCache.h"
31
#include "AccessibilityObjectInterface.h"
33
#include "LayoutRect.h"
35
#include <wtf/Forward.h>
36
#include <wtf/HashMap.h>
37
#include <wtf/RefPtr.h>
38
#include <wtf/RetainPtr.h>
39
#include <wtf/ThreadSafeRefCounted.h>
40
#include <wtf/Variant.h>
41
#include <wtf/Vector.h>
42
#include <wtf/WeakPtr.h>
48
class AXIsolatedObject final : public AXCoreObject {
50
static Ref<AXIsolatedObject> create(AXCoreObject&, bool isRoot);
53
void setObjectID(AXID id) override { m_id = id; }
54
AXID objectID() const override { return m_id; }
55
void init() override { }
57
bool isDetached() const override;
59
void setTreeIdentifier(AXIsolatedTreeID);
61
void appendChild(AXID);
64
void detachRemoteParts(AccessibilityDetachmentType) override;
65
void detachPlatformWrapper(AccessibilityDetachmentType) override;
67
AXID parent() const { return m_parent; }
69
AXIsolatedTreeID treeIdentifier() const { return m_treeIdentifier; }
70
AXIsolatedTree* tree() const { return m_cachedTree.get(); }
72
AXIsolatedObject() = default;
73
AXIsolatedObject(AXCoreObject&, bool isRoot);
74
void initializeAttributeData(AXCoreObject&, bool isRoot);
75
AXCoreObject* associatedAXObject() const
77
ASSERT(isMainThread());
78
return axObjectCache()->objectFromAXID(objectID());
81
enum class AXPropertyName : uint8_t {
85
AccessibilityButtonState,
91
ARIAErrorMessageElements,
94
ARIALandmarkRoleDescription,
96
ARIATreeItemDisclosedRows,
102
CanHaveSelectedChildren,
103
CanSetExpandedAttribute,
104
CanSetFocusAttribute,
106
CanSetSelectedAttribute,
107
CanSetSelectedChildrenAttribute,
108
CanSetTextRangeAttributes,
109
CanSetValueAttribute,
110
CanvasHasFallbackContent,
111
#if PLATFORM(COCOA) && !PLATFORM(IOS_FAMILY)
112
CaretBrowsingEnabled,
121
DatetimeAttributeValue,
128
EstimatedLoadingProgress,
130
ExposesTitleUIElement,
131
FileUploadButtonReturnsValueInTitle,
138
HighestEditableAncestor,
143
IsAccessibilityIgnored,
144
IsActiveDescendantOfFocusedContainer,
145
IsAnonymousMathOperator,
179
IsMathSubscriptSuperscript,
188
IsMathSeparatorOperator,
219
IsSelectedOptionActive,
220
IsShowingValidationMessage,
232
IsValueAutofillAvailable,
243
MathFencedOpenString,
244
MathFencedCloseString,
253
MathDenominatorObject,
256
MathSuperscriptObject,
264
PreventKeyboardDOMEventDispatch,
279
SupportsARIADragging,
280
SupportsARIADropping,
283
SupportsDatetimeAttribute,
285
SupportsExpandedTextValue,
291
SupportsRequiredAttribute,
300
ValueAutofillButtonType,
308
typedef std::pair<AXID, AXID> AccessibilityIsolatedTreeMathMultiscriptPair;
309
struct AccessibilityIsolatedTreeText {
311
AccessibilityTextSource textSource;
312
Vector<AXID> textElements;
315
using AttributeValueVariant = Variant<std::nullptr_t, String, bool, int, unsigned, double, float, uint64_t, Color, URL, LayoutRect, AXID, IntPoint, OptionSet<SpeakAs>, Vector<AccessibilityIsolatedTreeText>, Vector<AXID>, Vector<AccessibilityIsolatedTreeMathMultiscriptPair>, Vector<String>>;
316
void setProperty(AXPropertyName, AttributeValueVariant&&, bool shouldRemove = false);
317
void setObjectProperty(AXPropertyName, AXCoreObject*);
318
void setObjectVectorProperty(AXPropertyName, AccessibilityChildrenVector&);
320
bool boolAttributeValue(AXPropertyName) const;
321
const String stringAttributeValue(AXPropertyName) const;
322
int intAttributeValue(AXPropertyName) const;
323
unsigned unsignedAttributeValue(AXPropertyName) const;
324
double doubleAttributeValue(AXPropertyName) const;
325
float floatAttributeValue(AXPropertyName) const;
326
AXCoreObject* objectAttributeValue(AXPropertyName) const;
327
IntPoint intPointAttributeValue(AXPropertyName) const;
328
Color colorAttributeValue(AXPropertyName) const;
329
URL urlAttributeValue(AXPropertyName) const;
330
uint64_t uint64AttributeValue(AXPropertyName) const;
331
template<typename T> T rectAttributeValue(AXPropertyName) const;
332
template<typename T> Vector<T> vectorAttributeValue(AXPropertyName) const;
333
template<typename T> OptionSet<T> optionSetAttributeValue(AXPropertyName) const;
335
void fillChildrenVectorForProperty(AXPropertyName, AccessibilityChildrenVector&) const;
336
void setMathscripts(AXPropertyName, AXCoreObject&);
337
void insertMathPairs(Vector<AccessibilityIsolatedTreeMathMultiscriptPair>&, AccessibilityMathMultiscriptPairs&);
338
template<typename U> void performFunctionOnMainThread(U&&);
340
// Attribute retrieval overrides.
341
bool isHeading() const override { return boolAttributeValue(AXPropertyName::IsHeading); }
342
bool isLandmark() const override { return boolAttributeValue(AXPropertyName::IsLandmark); }
343
bool isLink() const override { return boolAttributeValue(AXPropertyName::IsLink); }
344
bool isImage() const override { return boolAttributeValue(AXPropertyName::IsImage); }
345
bool isPasswordField() const override { return boolAttributeValue(AXPropertyName::IsPasswordField); }
346
bool isSearchField() const override { return boolAttributeValue(AXPropertyName::IsSearchField); }
347
bool isAttachment() const override { return boolAttributeValue(AXPropertyName::IsAttachment); }
348
bool isMediaTimeline() const override { return boolAttributeValue(AXPropertyName::IsMediaTimeline); }
349
bool isMenuRelated() const override { return boolAttributeValue(AXPropertyName::IsMenuRelated); }
350
bool isMenu() const override { return boolAttributeValue(AXPropertyName::IsMenu); }
351
bool isMenuBar() const override { return boolAttributeValue(AXPropertyName::IsMenuBar); }
352
bool isMenuButton() const override { return boolAttributeValue(AXPropertyName::IsMenuButton); }
353
bool isMenuItem() const override { return boolAttributeValue(AXPropertyName::IsMenuItem); }
354
bool isFileUploadButton() const override { return boolAttributeValue(AXPropertyName::IsFileUploadButton); }
355
bool isInputImage() const override { return boolAttributeValue(AXPropertyName::IsInputImage); }
356
bool isProgressIndicator() const override { return boolAttributeValue(AXPropertyName::IsProgressIndicator); }
357
bool isSlider() const override { return boolAttributeValue(AXPropertyName::IsSlider); }
358
bool isControl() const override { return boolAttributeValue(AXPropertyName::IsControl); }
360
bool isList() const override { return boolAttributeValue(AXPropertyName::IsList); }
361
bool isUnorderedList() const override { return boolAttributeValue(AXPropertyName::IsUnorderedList); }
362
bool isOrderedList() const override { return boolAttributeValue(AXPropertyName::IsOrderedList); }
363
bool isDescriptionList() const override { return boolAttributeValue(AXPropertyName::IsDescriptionList); }
365
bool isTable() const override { return false; }
366
bool isTableRow() const override { return boolAttributeValue(AXPropertyName::IsTableRow); }
367
bool isTableColumn() const override { return boolAttributeValue(AXPropertyName::IsTableColumn); }
368
bool isTableCell() const override { return boolAttributeValue(AXPropertyName::IsTableCell); }
369
bool isFieldset() const override { return boolAttributeValue(AXPropertyName::IsFieldset); }
370
bool isGroup() const override { return boolAttributeValue(AXPropertyName::IsGroup); }
371
bool isARIATreeGridRow() const override { return boolAttributeValue(AXPropertyName::IsARIATreeGridRow); }
372
bool isMenuList() const override { return boolAttributeValue(AXPropertyName::IsMenuList); }
373
bool isMenuListPopup() const override { return boolAttributeValue(AXPropertyName::IsMenuListPopup); }
374
bool isMenuListOption() const override { return boolAttributeValue(AXPropertyName::IsMenuListOption); }
375
bool isTextControl() const override { return boolAttributeValue(AXPropertyName::IsTextControl); }
376
bool isButton() const override { return boolAttributeValue(AXPropertyName::IsButton); }
377
bool isRangeControl() const override { return boolAttributeValue(AXPropertyName::IsRangeControl); }
378
bool isMeter() const override { return boolAttributeValue(AXPropertyName::IsMeter); }
379
bool isStyleFormatGroup() const override { return boolAttributeValue(AXPropertyName::IsStyleFormatGroup); }
380
bool isOutput() const override { return boolAttributeValue(AXPropertyName::IsOutput); }
381
bool isChecked() const override { return boolAttributeValue(AXPropertyName::IsChecked); }
382
bool isEnabled() const override { return boolAttributeValue(AXPropertyName::IsEnabled); }
383
bool isSelected() const override { return boolAttributeValue(AXPropertyName::IsSelected); }
384
bool isFocused() const override { return boolAttributeValue(AXPropertyName::IsFocused); }
385
bool isMultiSelectable() const override { return boolAttributeValue(AXPropertyName::IsMultiSelectable); }
386
bool isVisited() const override { return boolAttributeValue(AXPropertyName::IsVisited); }
387
bool isRequired() const override { return boolAttributeValue(AXPropertyName::IsRequired); }
388
bool supportsRequiredAttribute() const override { return boolAttributeValue(AXPropertyName::SupportsRequiredAttribute); }
389
bool isExpanded() const override { return boolAttributeValue(AXPropertyName::IsExpanded); }
390
FloatRect relativeFrame() const override { return rectAttributeValue<FloatRect>(AXPropertyName::RelativeFrame); }
391
bool supportsDatetimeAttribute() const override { return boolAttributeValue(AXPropertyName::SupportsDatetimeAttribute); }
392
String datetimeAttributeValue() const override { return stringAttributeValue(AXPropertyName::DatetimeAttributeValue); }
393
bool canSetFocusAttribute() const override { return boolAttributeValue(AXPropertyName::CanSetFocusAttribute); }
394
bool canSetTextRangeAttributes() const override { return boolAttributeValue(AXPropertyName::CanSetTextRangeAttributes); }
395
bool canSetValueAttribute() const override { return boolAttributeValue(AXPropertyName::CanSetValueAttribute); }
396
bool canSetNumericValue() const override { return boolAttributeValue(AXPropertyName::CanSetNumericValue); }
397
bool canSetSelectedAttribute() const override { return boolAttributeValue(AXPropertyName::CanSetSelectedAttribute); }
398
bool canSetSelectedChildrenAttribute() const override { return boolAttributeValue(AXPropertyName::CanSetSelectedChildrenAttribute); }
399
bool canSetExpandedAttribute() const override { return boolAttributeValue(AXPropertyName::CanSetExpandedAttribute); }
400
bool accessibilityIsIgnored() const override { return boolAttributeValue(AXPropertyName::IsAccessibilityIgnored); }
401
bool isShowingValidationMessage() const override { return boolAttributeValue(AXPropertyName::IsShowingValidationMessage); }
402
String validationMessage() const override { return stringAttributeValue(AXPropertyName::ValidationMessage); }
403
unsigned blockquoteLevel() const override { return unsignedAttributeValue(AXPropertyName::BlockquoteLevel); }
404
int headingLevel() const override { return intAttributeValue(AXPropertyName::HeadingLevel); }
405
int tableLevel() const override { return intAttributeValue(AXPropertyName::TableLevel); }
406
AccessibilityButtonState checkboxOrRadioValue() const override { return static_cast<AccessibilityButtonState>(intAttributeValue(AXPropertyName::AccessibilityButtonState)); }
407
String valueDescription() const override { return stringAttributeValue(AXPropertyName::ValueDescription); }
408
float valueForRange() const override { return floatAttributeValue(AXPropertyName::ValueForRange); }
409
float maxValueForRange() const override { return floatAttributeValue(AXPropertyName::MaxValueForRange); }
410
float minValueForRange() const override { return floatAttributeValue(AXPropertyName::MinValueForRange); }
411
AXCoreObject* selectedRadioButton() override { return objectAttributeValue(AXPropertyName::SelectedRadioButton); }
412
AXCoreObject* selectedTabItem() override { return objectAttributeValue(AXPropertyName::SelectedTabItem); }
413
int layoutCount() const override { return intAttributeValue(AXPropertyName::LayoutCount); }
414
double estimatedLoadingProgress() const override { return doubleAttributeValue(AXPropertyName::EstimatedLoadingProgress); }
415
bool supportsARIAOwns() const override { return boolAttributeValue(AXPropertyName::SupportsARIAOwns); }
416
bool isActiveDescendantOfFocusedContainer() const override { return boolAttributeValue(AXPropertyName::IsActiveDescendantOfFocusedContainer); }
417
void ariaControlsElements(AccessibilityChildrenVector& children) const override { fillChildrenVectorForProperty(AXPropertyName::ARIAControlsElements, children); }
418
void ariaDetailsElements(AccessibilityChildrenVector& children) const override { fillChildrenVectorForProperty(AXPropertyName::ARIADetailsElements, children); }
419
void ariaErrorMessageElements(AccessibilityChildrenVector& children) const override { fillChildrenVectorForProperty(AXPropertyName::ARIAErrorMessageElements, children); }
420
void ariaFlowToElements(AccessibilityChildrenVector& children) const override { fillChildrenVectorForProperty(AXPropertyName::ARIAFlowToElements, children); }
421
void ariaOwnsElements(AccessibilityChildrenVector& children) const override { fillChildrenVectorForProperty(AXPropertyName::ARIAOwnsElements, children); }
422
bool hasPopup() const override { return boolAttributeValue(AXPropertyName::HasPopup); }
423
String popupValue() const override { return stringAttributeValue(AXPropertyName::PopupValue); }
424
bool pressedIsPresent() const override { return boolAttributeValue(AXPropertyName::PressedIsPresent); }
425
bool ariaIsMultiline() const override { return boolAttributeValue(AXPropertyName::ARIAIsMultiline); }
426
String invalidStatus() const override { return stringAttributeValue(AXPropertyName::InvalidStatus); }
427
bool supportsExpanded() const override { return boolAttributeValue(AXPropertyName::SupportsExpanded); }
428
AccessibilitySortDirection sortDirection() const override { return static_cast<AccessibilitySortDirection>(intAttributeValue(AXPropertyName::SortDirection)); }
429
bool canvasHasFallbackContent() const override { return boolAttributeValue(AXPropertyName::CanvasHasFallbackContent); }
430
bool supportsRangeValue() const override { return boolAttributeValue(AXPropertyName::SupportsRangeValue); }
431
String identifierAttribute() const override { return stringAttributeValue(AXPropertyName::IdentifierAttribute); }
432
String linkRelValue() const override { return stringAttributeValue(AXPropertyName::LinkRelValue); }
433
void classList(Vector<String>&) const override;
434
AccessibilityCurrentState currentState() const override { return static_cast<AccessibilityCurrentState>(intAttributeValue(AXPropertyName::CurrentState)); }
435
String currentValue() const override { return stringAttributeValue(AXPropertyName::CurrentValue); }
436
bool supportsCurrent() const override { return boolAttributeValue(AXPropertyName::SupportsCurrent); }
437
const String keyShortcutsValue() const override { return stringAttributeValue(AXPropertyName::KeyShortcutsValue); }
438
bool supportsSetSize() const override { return boolAttributeValue(AXPropertyName::SupportsSetSize); }
439
bool supportsPosInSet() const override { return boolAttributeValue(AXPropertyName::SupportsPosInSet); }
440
int setSize() const override { return intAttributeValue(AXPropertyName::SetSize); }
441
int posInSet() const override { return intAttributeValue(AXPropertyName::PosInSet); }
442
bool supportsARIADropping() const override { return boolAttributeValue(AXPropertyName::SupportsARIADropping); }
443
bool supportsARIADragging() const override { return boolAttributeValue(AXPropertyName::SupportsARIADragging); }
444
bool isARIAGrabbed() override { return boolAttributeValue(AXPropertyName::IsARIAGrabbed); }
445
Vector<String> determineARIADropEffects() override { return vectorAttributeValue<String>(AXPropertyName::ARIADropEffects); }
446
AXCoreObject* accessibilityHitTest(const IntPoint&) const override;
447
AXCoreObject* focusedUIElement() const override;
448
AXCoreObject* parentObject() const override { return parentObjectUnignored(); }
449
AXCoreObject* parentObjectUnignored() const override;
450
void linkedUIElements(AccessibilityChildrenVector& children) const override { fillChildrenVectorForProperty(AXPropertyName::LinkedUIElements, children); }
451
AXCoreObject* titleUIElement() const override { return objectAttributeValue(AXPropertyName::TitleUIElement); }
452
bool exposesTitleUIElement() const override { return boolAttributeValue(AXPropertyName::ExposesTitleUIElement); }
453
AXCoreObject* scrollBar(AccessibilityOrientation) override;
454
AccessibilityRole ariaRoleAttribute() const override { return static_cast<AccessibilityRole>(intAttributeValue(AXPropertyName::ARIARoleAttribute)); }
455
String computedLabel() override { return stringAttributeValue(AXPropertyName::ComputedLabel); }
456
int textLength() const override { return intAttributeValue(AXPropertyName::TextLength); }
457
const String placeholderValue() const override { return stringAttributeValue(AXPropertyName::PlaceholderValue); }
458
String expandedTextValue() const override { return stringAttributeValue(AXPropertyName::ExpandedTextValue); }
459
bool supportsExpandedTextValue() const override { return boolAttributeValue(AXPropertyName::SupportsExpandedTextValue); }
460
void colorValue(int&, int&, int&) const override;
461
AccessibilityRole roleValue() const override { return static_cast<AccessibilityRole>(intAttributeValue(AXPropertyName::RoleValue)); }
462
String rolePlatformString() const override { return stringAttributeValue(AXPropertyName::RolePlatformString); }
463
String roleDescription() const override { return stringAttributeValue(AXPropertyName::RoleDescription); }
464
String ariaLandmarkRoleDescription() const override { return stringAttributeValue(AXPropertyName::ARIALandmarkRoleDescription); }
465
bool supportsPressAction() const override { return boolAttributeValue(AXPropertyName::SupportsPressAction); }
466
LayoutRect boundingBoxRect() const override { return rectAttributeValue<LayoutRect>(AXPropertyName::BoundingBoxRect); }
467
LayoutRect elementRect() const override { return rectAttributeValue<LayoutRect>(AXPropertyName::ElementRect); }
468
IntPoint clickPoint() override { return intPointAttributeValue(AXPropertyName::ClickPoint); }
469
void accessibilityText(Vector<AccessibilityText>& texts) const override;
470
String computedRoleString() const override { return stringAttributeValue(AXPropertyName::ComputedRoleString); }
471
bool isValueAutofilled() const override { return boolAttributeValue(AXPropertyName::IsValueAutofilled); }
472
bool isValueAutofillAvailable() const override { return boolAttributeValue(AXPropertyName::IsValueAutofillAvailable); }
473
AutoFillButtonType valueAutofillButtonType() const override { return static_cast<AutoFillButtonType>(intAttributeValue(AXPropertyName::ValueAutofillButtonType)); }
474
void ariaTreeRows(AccessibilityChildrenVector& children) override { fillChildrenVectorForProperty(AXPropertyName::ARIATreeRows, children); }
475
void ariaTreeItemDisclosedRows(AccessibilityChildrenVector& children) override { fillChildrenVectorForProperty(AXPropertyName::ARIATreeItemDisclosedRows, children); }
476
void ariaTreeItemContent(AccessibilityChildrenVector& children) override { fillChildrenVectorForProperty(AXPropertyName::ARIATreeItemContent, children); }
477
URL url() const override { return urlAttributeValue(AXPropertyName::URL); }
478
String accessKey() const override { return stringAttributeValue(AXPropertyName::AccessKey); }
479
String actionVerb() const override { return stringAttributeValue(AXPropertyName::ActionVerb); }
480
String readOnlyValue() const override { return stringAttributeValue(AXPropertyName::ReadOnlyValue); }
481
String autoCompleteValue() const override { return stringAttributeValue(AXPropertyName::AutoCompleteValue); }
482
OptionSet<SpeakAs> speakAsProperty() const override { return optionSetAttributeValue<SpeakAs>(AXPropertyName::SpeakAs); }
483
bool isMathElement() const override { return boolAttributeValue(AXPropertyName::IsMathElement); }
484
bool isMathFraction() const override { return boolAttributeValue(AXPropertyName::IsMathFraction); }
485
bool isMathFenced() const override { return boolAttributeValue(AXPropertyName::IsMathFenced); }
486
bool isMathSubscriptSuperscript() const override { return boolAttributeValue(AXPropertyName::IsMathSubscriptSuperscript); }
487
bool isMathRow() const override { return boolAttributeValue(AXPropertyName::IsMathRow); }
488
bool isMathUnderOver() const override { return boolAttributeValue(AXPropertyName::IsMathUnderOver); }
489
bool isMathRoot() const override { return boolAttributeValue(AXPropertyName::IsMathRoot); }
490
bool isMathSquareRoot() const override { return boolAttributeValue(AXPropertyName::IsMathSquareRoot); }
491
bool isMathText() const override { return boolAttributeValue(AXPropertyName::IsMathText); }
492
bool isMathNumber() const override { return boolAttributeValue(AXPropertyName::IsMathNumber); }
493
bool isMathOperator() const override { return boolAttributeValue(AXPropertyName::IsMathOperator); }
494
bool isMathFenceOperator() const override { return boolAttributeValue(AXPropertyName::IsMathFenceOperator); }
495
bool isMathSeparatorOperator() const override { return boolAttributeValue(AXPropertyName::IsMathSeparatorOperator); }
496
bool isMathIdentifier() const override { return boolAttributeValue(AXPropertyName::IsMathIdentifier); }
497
bool isMathTable() const override { return boolAttributeValue(AXPropertyName::IsMathTable); }
498
bool isMathTableRow() const override { return boolAttributeValue(AXPropertyName::IsMathTableRow); }
499
bool isMathTableCell() const override { return boolAttributeValue(AXPropertyName::IsMathTableCell); }
500
bool isMathMultiscript() const override { return boolAttributeValue(AXPropertyName::IsMathMultiscript); }
501
bool isMathToken() const override { return boolAttributeValue(AXPropertyName::IsMathToken); }
502
AXCoreObject* mathRadicandObject() override { return objectAttributeValue(AXPropertyName::MathRadicandObject); }
503
AXCoreObject* mathRootIndexObject() override { return objectAttributeValue(AXPropertyName::MathRootIndexObject); }
504
AXCoreObject* mathUnderObject() override { return objectAttributeValue(AXPropertyName::MathUnderObject); }
505
AXCoreObject* mathOverObject() override { return objectAttributeValue(AXPropertyName::MathOverObject); }
506
AXCoreObject* mathNumeratorObject() override { return objectAttributeValue(AXPropertyName::MathNumeratorObject); }
507
AXCoreObject* mathDenominatorObject() override { return objectAttributeValue(AXPropertyName::MathDenominatorObject); }
508
AXCoreObject* mathBaseObject() override { return objectAttributeValue(AXPropertyName::MathBaseObject); }
509
AXCoreObject* mathSubscriptObject() override { return objectAttributeValue(AXPropertyName::MathSubscriptObject); }
510
AXCoreObject* mathSuperscriptObject() override { return objectAttributeValue(AXPropertyName::MathSuperscriptObject); }
511
String mathFencedOpenString() const override { return stringAttributeValue(AXPropertyName::MathFencedOpenString); }
512
String mathFencedCloseString() const override { return stringAttributeValue(AXPropertyName::MathFencedCloseString); }
513
int mathLineThickness() const override { return intAttributeValue(AXPropertyName::MathLineThickness); }
514
bool isAnonymousMathOperator() const override { return boolAttributeValue(AXPropertyName::IsAnonymousMathOperator); }
515
void mathPrescripts(AccessibilityMathMultiscriptPairs&) override;
516
void mathPostscripts(AccessibilityMathMultiscriptPairs&) override;
517
bool fileUploadButtonReturnsValueInTitle() const override { return boolAttributeValue(AXPropertyName::FileUploadButtonReturnsValueInTitle); }
518
String speechHintAttributeValue() const override { return stringAttributeValue(AXPropertyName::SpeechHint); }
519
String descriptionAttributeValue() const override { return stringAttributeValue(AXPropertyName::Description); }
520
String helpTextAttributeValue() const override { return stringAttributeValue(AXPropertyName::HelpText); }
521
String titleAttributeValue() const override { return stringAttributeValue(AXPropertyName::Title); }
522
#if PLATFORM(COCOA) && !PLATFORM(IOS_FAMILY)
523
bool caretBrowsingEnabled() const override { return boolAttributeValue(AXPropertyName::CaretBrowsingEnabled); }
525
AXCoreObject* focusableAncestor() override { return objectAttributeValue(AXPropertyName::FocusableAncestor); }
526
AXCoreObject* editableAncestor() override { return objectAttributeValue(AXPropertyName::EditableAncestor); }
527
AXCoreObject* highestEditableAncestor() override { return objectAttributeValue(AXPropertyName::HighestEditableAncestor); }
528
AccessibilityOrientation orientation() const override { return static_cast<AccessibilityOrientation>(intAttributeValue(AXPropertyName::Orientation)); }
529
unsigned hierarchicalLevel() const override { return unsignedAttributeValue(AXPropertyName::HierarchicalLevel); }
530
String language() const override { return stringAttributeValue(AXPropertyName::Language); }
531
bool canHaveSelectedChildren() const override { return boolAttributeValue(AXPropertyName::CanHaveSelectedChildren); }
532
void selectedChildren(AccessibilityChildrenVector& children) override { fillChildrenVectorForProperty(AXPropertyName::SelectedChildren, children); }
533
void visibleChildren(AccessibilityChildrenVector& children) override { fillChildrenVectorForProperty(AXPropertyName::VisibleChildren, children); }
534
void tabChildren(AccessibilityChildrenVector& children) override { fillChildrenVectorForProperty(AXPropertyName::TabChildren, children); }
535
bool hasARIAValueNow() const override { return boolAttributeValue(AXPropertyName::HasARIAValueNow); }
536
String tagName() const override { return stringAttributeValue(AXPropertyName::TagName); }
537
const AccessibilityChildrenVector& children(bool updateChildrenIfNeeded = true) override;
538
void updateChildrenIfNecessary() override { }
539
bool isDetachedFromParent() override;
540
bool supportsLiveRegion(bool = true) const override { return boolAttributeValue(AXPropertyName::SupportsLiveRegion); }
541
bool isInsideLiveRegion(bool = true) const override { return boolAttributeValue(AXPropertyName::IsInsideLiveRegion); }
542
const String liveRegionStatus() const override { return stringAttributeValue(AXPropertyName::LiveRegionStatus); }
543
const String liveRegionRelevant() const override { return stringAttributeValue(AXPropertyName::LiveRegionRelevant); }
544
bool liveRegionAtomic() const override { return boolAttributeValue(AXPropertyName::LiveRegionAtomic); }
545
bool isBusy() const override { return boolAttributeValue(AXPropertyName::IsBusy); }
546
bool isInlineText() const override { return boolAttributeValue(AXPropertyName::IsInlineText); }
547
// Spin button support.
548
AXCoreObject* incrementButton() override { return objectAttributeValue(AXPropertyName::IncrementButton); }
549
AXCoreObject* decrementButton() override { return objectAttributeValue(AXPropertyName::DecrementButton); }
550
bool isIncrementor() const override { return boolAttributeValue(AXPropertyName::IsIncrementor); }
552
String stringValue() const override { return stringAttributeValue(AXPropertyName::StringValue); }
554
// Parameterized attribute retrieval.
555
Vector<RefPtr<Range>> findTextRanges(AccessibilitySearchTextCriteria const&) const override;
556
Vector<String> performTextOperation(AccessibilityTextOperation const&) override;
557
void findMatchingObjects(AccessibilitySearchCriteria*, AccessibilityChildrenVector&) override;
559
// Attributes retrieved from the root node only so that the data isn't duplicated on each node.
560
uint64_t sessionID() const override;
561
String documentURI() const override;
562
String documentEncoding() const override;
563
bool preventKeyboardDOMEventDispatch() const override;
565
// TODO: Text ranges and selection.
566
PlainTextRange selectedTextRange() const override { return PlainTextRange(); }
567
unsigned selectionStart() const override { return 0; }
568
unsigned selectionEnd() const override { return 0; }
569
VisibleSelection selection() const override { return VisibleSelection(); }
570
String selectedText() const override { return String(); }
571
VisiblePositionRange visiblePositionRange() const override { return VisiblePositionRange(); }
572
VisiblePositionRange visiblePositionRangeForLine(unsigned) const override { return VisiblePositionRange(); }
573
RefPtr<Range> elementRange() const override { return nullptr; }
574
VisiblePositionRange visiblePositionRangeForUnorderedPositions(const VisiblePosition&, const VisiblePosition&) const override { return VisiblePositionRange(); }
575
VisiblePositionRange positionOfLeftWord(const VisiblePosition&) const override { return VisiblePositionRange(); }
576
VisiblePositionRange positionOfRightWord(const VisiblePosition&) const override { return VisiblePositionRange(); }
577
VisiblePositionRange leftLineVisiblePositionRange(const VisiblePosition&) const override { return VisiblePositionRange(); }
578
VisiblePositionRange rightLineVisiblePositionRange(const VisiblePosition&) const override { return VisiblePositionRange(); }
579
VisiblePositionRange sentenceForPosition(const VisiblePosition&) const override { return VisiblePositionRange(); }
580
VisiblePositionRange paragraphForPosition(const VisiblePosition&) const override { return VisiblePositionRange(); }
581
VisiblePositionRange styleRangeForPosition(const VisiblePosition&) const override { return VisiblePositionRange(); }
582
VisiblePositionRange visiblePositionRangeForRange(const PlainTextRange&) const override { return VisiblePositionRange(); }
583
VisiblePositionRange lineRangeForPosition(const VisiblePosition&) const override { return VisiblePositionRange(); }
584
RefPtr<Range> rangeForPlainTextRange(const PlainTextRange&) const override { return nullptr; }
585
String stringForRange(RefPtr<Range>) const override { return String(); }
586
IntRect boundsForVisiblePositionRange(const VisiblePositionRange&) const override { return IntRect(); }
587
IntRect boundsForRange(const RefPtr<Range>) const override { return IntRect(); }
588
int lengthForVisiblePositionRange(const VisiblePositionRange&) const override { return 0; }
589
void setSelectedVisiblePositionRange(const VisiblePositionRange&) const override { }
590
VisiblePosition visiblePositionForBounds(const IntRect&, AccessibilityVisiblePositionForBounds) const override { return VisiblePosition(); }
591
VisiblePosition visiblePositionForPoint(const IntPoint&) const override { return VisiblePosition(); }
592
VisiblePosition nextVisiblePosition(const VisiblePosition&) const override { return VisiblePosition(); }
593
VisiblePosition previousVisiblePosition(const VisiblePosition&) const override { return VisiblePosition(); }
594
VisiblePosition nextWordEnd(const VisiblePosition&) const override { return VisiblePosition(); }
595
VisiblePosition previousWordStart(const VisiblePosition&) const override { return VisiblePosition(); }
596
VisiblePosition nextLineEndPosition(const VisiblePosition&) const override { return VisiblePosition(); }
597
VisiblePosition previousLineStartPosition(const VisiblePosition&) const override { return VisiblePosition(); }
598
VisiblePosition nextSentenceEndPosition(const VisiblePosition&) const override { return VisiblePosition(); }
599
VisiblePosition previousSentenceStartPosition(const VisiblePosition&) const override { return VisiblePosition(); }
600
VisiblePosition nextParagraphEndPosition(const VisiblePosition&) const override { return VisiblePosition(); }
601
VisiblePosition previousParagraphStartPosition(const VisiblePosition&) const override { return VisiblePosition(); }
602
VisiblePosition visiblePositionForIndex(unsigned, bool /*lastIndexOK */) const override { return VisiblePosition(); }
603
VisiblePosition visiblePositionForIndex(int) const override { return VisiblePosition(); }
604
int indexForVisiblePosition(const VisiblePosition&) const override { return 0; }
605
AXCoreObject* accessibilityObjectForPosition(const VisiblePosition&) const override { return nullptr; }
606
int lineForPosition(const VisiblePosition&) const override { return 0; }
607
PlainTextRange plainTextRangeForVisiblePositionRange(const VisiblePositionRange&) const override { return PlainTextRange(); }
608
int index(const VisiblePosition&) const override { return 0; }
609
void lineBreaks(Vector<int>&) const override { }
610
PlainTextRange doAXRangeForLine(unsigned) const override { return PlainTextRange(); }
611
PlainTextRange doAXRangeForPosition(const IntPoint&) const override { return PlainTextRange(); }
612
PlainTextRange doAXRangeForIndex(unsigned) const override { return PlainTextRange(); }
613
PlainTextRange doAXStyleRangeForIndex(unsigned) const override { return PlainTextRange(); }
614
String doAXStringForRange(const PlainTextRange&) const override { return String(); }
615
IntRect doAXBoundsForRange(const PlainTextRange&) const override { return IntRect(); }
616
IntRect doAXBoundsForRangeUsingCharacterOffset(const PlainTextRange&) const override { return IntRect(); }
617
unsigned doAXLineForIndex(unsigned) override { return 0; }
619
// Attribute setters.
620
void setARIAGrabbed(bool) override;
621
void setIsExpanded(bool) override;
622
void setValue(float) override;
623
void setSelected(bool) override;
624
void setSelectedRows(AccessibilityChildrenVector&) override;
625
void setFocused(bool) override;
626
void setSelectedText(const String&) override;
627
void setSelectedTextRange(const PlainTextRange&) override;
628
void setValue(const String&) override;
629
#if PLATFORM(COCOA) && !PLATFORM(IOS_FAMILY)
630
void setCaretBrowsingEnabled(bool) override;
632
void setPreventKeyboardDOMEventDispatch(bool) override;
635
String textUnderElement(AccessibilityTextUnderElementMode = AccessibilityTextUnderElementMode()) const override { return String(); }
636
RefPtr<Range> getMisspellingRange(RefPtr<Range> const&, AccessibilitySearchDirection) const override { return nullptr; }
637
FloatRect convertFrameToSpace(const FloatRect&, AccessibilityConversionSpace) const override { return FloatRect(); }
638
void increment() override { }
639
void decrement() override { }
640
void scrollToMakeVisible() const override { }
641
void scrollToMakeVisibleWithSubFocus(const IntRect&) const override { }
642
void scrollToGlobalPoint(const IntPoint&) const override { }
643
bool replaceTextInRange(const String&, const PlainTextRange&) override;
644
bool insertText(const String&) override;
645
void makeRangeVisible(const PlainTextRange&) override { }
646
bool press() override;
647
bool performDefaultAction() override;
649
// Functions that should never be called on an isolated tree object. ASSERT that these are not reached;
650
bool isAccessibilityObject() const override;
651
bool isAccessibilityNodeObject() const override;
652
bool isAccessibilityRenderObject() const override;
653
bool isAccessibilityScrollbar() const override;
654
bool isAccessibilityScrollView() const override;
655
bool isAccessibilitySVGRoot() const override;
656
bool isAccessibilitySVGElement() const override;
657
bool isAttachmentElement() const override;
658
bool isNativeImage() const override;
659
bool isImageButton() const override;
660
bool isContainedByPasswordField() const override;
661
AXCoreObject* passwordFieldOrContainingPasswordField() override;
662
bool isNativeTextControl() const override;
663
bool isNativeListBox() const override;
664
bool isListBoxOption() const override;
665
bool isSliderThumb() const override;
666
bool isInputSlider() const override;
667
bool isLabel() const override;
668
bool isDataTable() const override;
669
bool isImageMapLink() const override;
670
bool isNativeSpinButton() const override;
671
bool isSpinButtonPart() const override;
672
bool isMockObject() const override;
673
bool isMediaObject() const override;
674
bool isARIATextControl() const override;
675
bool isNonNativeTextControl() const override;
676
bool isBlockquote() const override;
677
bool isFigureElement() const override;
678
bool isKeyboardFocusable() const override;
679
bool isHovered() const override;
680
bool isIndeterminate() const override;
681
bool isLoaded() const override { return boolAttributeValue(AXPropertyName::IsLoaded); }
682
bool isOnScreen() const override;
683
bool isOffScreen() const override;
684
bool isPressed() const override;
685
bool isUnvisited() const override;
686
bool isLinked() const override;
687
bool isVisible() const override;
688
bool isCollapsed() const override;
689
bool isSelectedOptionActive() const override;
690
bool hasBoldFont() const override;
691
bool hasItalicFont() const override;
692
bool hasMisspelling() const override;
693
bool hasPlainText() const override;
694
bool hasSameFont(RenderObject*) const override;
695
bool hasSameFontColor(RenderObject*) const override;
696
bool hasSameStyle(RenderObject*) const override;
697
bool hasUnderline() const override;
698
bool hasHighlighting() const override;
699
Element* element() const override;
700
Node* node() const override;
701
RenderObject* renderer() const override;
702
AccessibilityObjectInclusion defaultObjectInclusion() const override;
703
bool accessibilityIsIgnoredByDefault() const override;
704
float stepValueForRange() const override;
705
AXCoreObject* selectedListItem() override;
706
void ariaActiveDescendantReferencingElements(AccessibilityChildrenVector&) const override;
707
void ariaControlsReferencingElements(AccessibilityChildrenVector&) const override;
708
void ariaDescribedByElements(AccessibilityChildrenVector&) const override;
709
void ariaDescribedByReferencingElements(AccessibilityChildrenVector&) const override;
710
void ariaDetailsReferencingElements(AccessibilityChildrenVector&) const override;
711
void ariaErrorMessageReferencingElements(AccessibilityChildrenVector&) const override;
712
void ariaFlowToReferencingElements(AccessibilityChildrenVector&) const override;
713
void ariaLabelledByElements(AccessibilityChildrenVector&) const override;
714
void ariaLabelledByReferencingElements(AccessibilityChildrenVector&) const override;
715
void ariaOwnsReferencingElements(AccessibilityChildrenVector&) const override;
716
bool hasDatalist() const override;
717
bool supportsHasPopup() const override;
718
bool supportsPressed() const override;
719
bool supportsChecked() const override;
720
bool ignoredFromModalPresence() const override;
721
bool isModalDescendant(Node*) const override;
722
bool isModalNode() const override;
723
AXCoreObject* elementAccessibilityHitTest(const IntPoint&) const override;
724
AXCoreObject* firstChild() const override;
725
AXCoreObject* lastChild() const override;
726
AXCoreObject* previousSibling() const override;
727
AXCoreObject* nextSibling() const override;
728
AXCoreObject* nextSiblingUnignored(int limit) const override;
729
AXCoreObject* previousSiblingUnignored(int limit) const override;
730
AXCoreObject* parentObjectIfExists() const override;
731
bool isDescendantOfBarrenParent() const override;
732
bool isDescendantOfRole(AccessibilityRole) const override;
733
AXCoreObject* observableObject() const override;
734
AXCoreObject* correspondingLabelForControlElement() const override;
735
AXCoreObject* correspondingControlForLabelElement() const override;
736
bool isPresentationalChildOfAriaRole() const override;
737
bool ariaRoleHasPresentationalChildren() const override;
738
bool inheritsPresentationalRole() const override;
739
void setAccessibleName(const AtomString&) override;
740
bool hasAttributesRequiredForInclusion() const override;
741
String accessibilityDescription() const override;
742
String title() const override;
743
String helpText() const override;
744
bool isARIAStaticText() const override;
745
String text() const override;
746
String ariaLabeledByAttribute() const override;
747
String ariaDescribedByAttribute() const override;
748
bool accessibleNameDerivesFromContent() const override;
749
void elementsFromAttribute(Vector<Element*>&, const QualifiedName&) const override;
750
AXObjectCache* axObjectCache() const override;
751
Element* anchorElement() const override;
752
Element* actionElement() const override;
753
Path elementPath() const override;
754
bool supportsPath() const override { return boolAttributeValue(AXPropertyName::SupportsPath); }
755
TextIteratorBehavior textIteratorBehaviorForTextRange() const override;
756
Widget* widget() const override;
757
Widget* widgetForAttachmentView() const override;
758
Page* page() const override;
759
Document* document() const override;
760
FrameView* documentFrameView() const override;
761
Frame* frame() const override;
762
Frame* mainFrame() const override;
763
Document* topDocument() const override;
764
ScrollView* scrollViewAncestor() const override;
765
void childrenChanged() override;
766
void textChanged() override;
767
void updateAccessibilityRole() override;
768
void addChildren() override;
769
void addChild(AXCoreObject*) override;
770
void insertChild(AXCoreObject*, unsigned) override;
771
bool shouldIgnoreAttributeRole() const override;
772
bool canHaveChildren() const override;
773
bool hasChildren() const override;
774
void setNeedsToUpdateChildren() override;
775
void setNeedsToUpdateSubtree() override;
776
void clearChildren() override;
777
bool needsToUpdateChildren() const override;
778
void detachFromParent() override;
779
bool shouldFocusActiveDescendant() const override;
780
AXCoreObject* activeDescendant() const override;
781
void handleActiveDescendantChanged() override;
782
void handleAriaExpandedChanged() override;
783
bool isDescendantOfObject(const AXCoreObject*) const override;
784
bool isAncestorOfObject(const AXCoreObject*) const override;
785
AXCoreObject* firstAnonymousBlockChild() const override;
786
bool hasAttribute(const QualifiedName&) const override;
787
const AtomString& getAttribute(const QualifiedName&) const override;
788
bool hasTagName(const QualifiedName&) const override;
789
String stringValueForMSAA() const override;
790
String stringRoleForMSAA() const override;
791
String nameForMSAA() const override;
792
String descriptionForMSAA() const override;
793
AccessibilityRole roleValueForMSAA() const override;
794
String passwordFieldValue() const override;
795
AXCoreObject* liveRegionAncestor(bool excludeIfOff = true) const override;
796
bool hasContentEditableAttributeSet() const override;
797
bool supportsReadOnly() const override;
798
bool supportsAutoComplete() const override;
799
bool supportsARIAAttributes() const override;
800
bool scrollByPage(ScrollByPageDirection) const override;
801
IntPoint scrollPosition() const override;
802
IntSize scrollContentsSize() const override;
803
IntRect scrollVisibleContentRect() const override;
804
void scrollToMakeVisible(const ScrollRectToVisibleOptions&) const override;
805
bool lastKnownIsIgnoredValue() override;
806
void setLastKnownIsIgnoredValue(bool) override;
807
void notifyIfIgnoredValueChanged() override;
808
bool isMathScriptObject(AccessibilityMathScriptObjectType) const override;
809
bool isMathMultiscriptObject(AccessibilityMathMultiscriptObjectType) const override;
810
bool isAXHidden() const override;
811
bool isDOMHidden() const override;
812
bool isHidden() const override;
813
void overrideAttachmentParent(AXCoreObject* parent) override;
814
bool accessibilityIgnoreAttachment() const override;
815
AccessibilityObjectInclusion accessibilityPlatformIncludesObject() const override;
816
bool hasApplePDFAnnotationAttribute() const override;
817
const AccessibilityScrollView* ancestorAccessibilityScrollView(bool includeSelf) const override;
818
void setIsIgnoredFromParentData(AccessibilityIsIgnoredFromParentData&) override;
819
void clearIsIgnoredFromParentData() override;
820
void setIsIgnoredFromParentDataForChild(AXCoreObject*) override;
822
void updateBackingStore() override;
824
AXID m_parent { InvalidAXID };
825
AXID m_id { InvalidAXID };
826
bool m_initialized { false };
827
AXIsolatedTreeID m_treeIdentifier;
828
RefPtr<AXIsolatedTree> m_cachedTree;
829
Vector<AXID> m_childrenIDs;
830
Vector<RefPtr<AXCoreObject>> m_children;
832
HashMap<AXPropertyName, AttributeValueVariant, WTF::IntHash<AXPropertyName>, WTF::StrongEnumHashTraits<AXPropertyName>> m_attributeMap;
833
Lock m_attributeMapLock;
836
} // namespace WebCore
838
#endif // ENABLE((ACCESSIBILITY_ISOLATED_TREE))