Skip to content

Commit d1780bb

Browse files
committed
Add feature flag for enumerated ARIA attributes and new ARIA IDL
https://bugs.webkit.org/show_bug.cgi?id=296851 rdar://157952768 Reviewed by NOBODY (OOPS!). Adds 'status: developer' feature flag for enumerated ARIA attributes: w3c/aria#2484. The ARIA spec intends to convert the following attributes to be enumerated, i.e., content attributes with permissible keywords and invalid/missing value defaults: - aria-atomic - aria-autocomplete - aria-busy - aria-checked - aria-current - aria-disabled - aria-expanded - aria-haspopup - aria-hidden - aria-invalid - aria-live - aria-modal - aria-multiline - aria-multiselectable - aria-orientation - aria-pressed - aria-readonly - aria-required - aria-selected - aria-sort This PR changes ARIA's IDL to use [ReflectSetter] for enumerated attributes in order to implement the desired reflection behavior behind a flag using manual getters; this also allows maintaining current ARIA IDL behavior when the flag is disabled. When ARIA PR WebKit#2484 lands, ARIA's IDL should be updated to use [Reflect, Enumerated] for automatic JS bindings codegen that doesn't need manual code. * Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml: * Source/WebCore/accessibility/AriaAttributes.idl: * Source/WebCore/dom/Element.h: * Source/WebCore/dom/Element.cpp: (WebCore::Element::ariaAtomic const): (WebCore::Element::ariaAutoComplete const): (WebCore::Element::ariaBusy const): (WebCore::Element::ariaChecked const): (WebCore::Element::ariaCurrent const): (WebCore::Element::ariaDisabled const): (WebCore::Element::ariaExpanded const): (WebCore::Element::ariaHasPopup const): (WebCore::Element::ariaHidden const): (WebCore::Element::ariaInvalid const): (WebCore::Element::ariaLive const): (WebCore::Element::ariaModal const): (WebCore::Element::ariaMultiLine const): (WebCore::Element::ariaMultiSelectable const): (WebCore::Element::ariaOrientation const): (WebCore::Element::ariaPressed const): (WebCore::Element::ariaReadOnly const): (WebCore::Element::ariaRequired const): (WebCore::Element::ariaSelected const): (WebCore::Element::ariaSort const): * Tools/DumpRenderTree/TestOptions.cpp: * Tools/WebKitTestRunner/TestOptions.cpp:
1 parent a722bd4 commit d1780bb

File tree

6 files changed

+544
-42
lines changed

6 files changed

+544
-42
lines changed

Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2643,6 +2643,20 @@ EnterKeyHintEnabled:
26432643
WebCore:
26442644
default: false
26452645

2646+
EnumeratedARIAAttributeReflectionEnabled:
2647+
type: bool
2648+
status: developer
2649+
category: javascript
2650+
humanReadableName: "Enumerated ARIA Attribute Reflection"
2651+
humanReadableDescription: "Enable enumerated ARIA attributes"
2652+
defaultValue:
2653+
WebKitLegacy:
2654+
default: false
2655+
WebKit:
2656+
default: false
2657+
WebCore:
2658+
default: false
2659+
26462660
EnumeratingAllNetworkInterfacesEnabled:
26472661
type: bool
26482662
status: internal

Source/WebCore/accessibility/AriaAttributes.idl

Lines changed: 46 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -25,55 +25,59 @@
2525

2626
// https://w3c.github.io/aria/#idl-interface
2727
interface mixin AriaAttributes {
28+
// https://github.com/w3c/aria/pull/2484
29+
// ARIA attributes that use [ReflectSetter] will become enumerated and thus, use custom getters to facilitate the
30+
// EnumeratedARIAAttributeReflectionEnabled flag to manually handle enumerated reflection.
31+
// FIXME: Use [Reflect, Enumerated] for ARIA enumerated attributes when the feature flag is no longer needed.
2832
[CEReactions=Needed, Reflect="aria-activedescendant"] attribute Element? ariaActiveDescendantElement;
29-
[CEReactions=Needed, Reflect="aria-atomic"] attribute DOMString? ariaAtomic;
30-
[CEReactions=Needed, Reflect="aria-autocomplete"] attribute DOMString? ariaAutoComplete;
31-
[CEReactions=Needed, Reflect="aria-braillelabel"] attribute DOMString? ariaBrailleLabel;
33+
[CEReactions=Needed, ReflectSetter="aria-atomic"] attribute [AtomString] DOMString? ariaAtomic;
34+
[CEReactions=Needed, ReflectSetter="aria-autocomplete"] attribute [AtomString] DOMString? ariaAutoComplete;
35+
[CEReactions=Needed, Reflect="aria-braillelabel"] attribute DOMString? ariaBrailleLabel;
3236
[CEReactions=Needed, Reflect="aria-brailleroledescription"] attribute DOMString? ariaBrailleRoleDescription;
33-
[CEReactions=Needed, Reflect="aria-busy"] attribute DOMString? ariaBusy;
34-
[CEReactions=Needed, Reflect="aria-checked"] attribute DOMString? ariaChecked;
35-
[CEReactions=Needed, Reflect="aria-colcount"] attribute DOMString? ariaColCount;
36-
[CEReactions=Needed, Reflect="aria-colindex"] attribute DOMString? ariaColIndex;
37-
[CEReactions=Needed, Reflect="aria-colindextext"] attribute DOMString? ariaColIndexText;
38-
[CEReactions=Needed, Reflect="aria-colspan"] attribute DOMString? ariaColSpan;
37+
[CEReactions=Needed, ReflectSetter="aria-busy"] attribute [AtomString] DOMString? ariaBusy;
38+
[CEReactions=Needed, ReflectSetter="aria-checked"] attribute [AtomString] DOMString? ariaChecked;
39+
[CEReactions=Needed, Reflect="aria-colcount"] attribute DOMString? ariaColCount;
40+
[CEReactions=Needed, Reflect="aria-colindex"] attribute DOMString? ariaColIndex;
41+
[CEReactions=Needed, Reflect="aria-colindextext"] attribute DOMString? ariaColIndexText;
42+
[CEReactions=Needed, Reflect="aria-colspan"] attribute DOMString? ariaColSpan;
3943
[CEReactions=Needed, CustomGetter, Reflect="aria-controls"] attribute FrozenArray<Element>? ariaControlsElements;
40-
[CEReactions=Needed, Reflect="aria-current"] attribute DOMString? ariaCurrent;
44+
[CEReactions=Needed, ReflectSetter="aria-current"] attribute [AtomString] DOMString? ariaCurrent;
4145
[CEReactions=Needed, CustomGetter, Reflect="aria-describedby"] attribute FrozenArray<Element>? ariaDescribedByElements;
42-
[CEReactions=Needed, Reflect="aria-description"] attribute DOMString? ariaDescription;
46+
[CEReactions=Needed, Reflect="aria-description"] attribute DOMString? ariaDescription;
4347
[CEReactions=Needed, CustomGetter, Reflect="aria-details"] attribute FrozenArray<Element>? ariaDetailsElements;
44-
[CEReactions=Needed, Reflect="aria-disabled"] attribute DOMString? ariaDisabled;
48+
[CEReactions=Needed, ReflectSetter="aria-disabled"] attribute [AtomString] DOMString? ariaDisabled;
4549
[CEReactions=Needed, CustomGetter, Reflect="aria-errormessage"] attribute FrozenArray<Element>? ariaErrorMessageElements;
46-
[CEReactions=Needed, Reflect="aria-expanded"] attribute DOMString? ariaExpanded;
50+
[CEReactions=Needed, ReflectSetter="aria-expanded"] attribute [AtomString] DOMString? ariaExpanded;
4751
[CEReactions=Needed, CustomGetter, Reflect="aria-flowto"] attribute FrozenArray<Element>? ariaFlowToElements;
48-
[CEReactions=Needed, Reflect="aria-haspopup"] attribute DOMString? ariaHasPopup;
49-
[CEReactions=Needed, Reflect="aria-hidden"] attribute DOMString? ariaHidden;
50-
[CEReactions=Needed, Reflect="aria-invalid"] attribute DOMString? ariaInvalid;
51-
[CEReactions=Needed, Reflect="aria-keyshortcuts"] attribute DOMString? ariaKeyShortcuts;
52-
[CEReactions=Needed, Reflect="aria-label"] attribute DOMString? ariaLabel;
52+
[CEReactions=Needed, ReflectSetter="aria-haspopup"] attribute [AtomString] DOMString? ariaHasPopup;
53+
[CEReactions=Needed, ReflectSetter="aria-hidden"] attribute [AtomString] DOMString? ariaHidden;
54+
[CEReactions=Needed, ReflectSetter="aria-invalid"] attribute [AtomString] DOMString? ariaInvalid;
55+
[CEReactions=Needed, Reflect="aria-keyshortcuts"] attribute DOMString? ariaKeyShortcuts;
56+
[CEReactions=Needed, Reflect="aria-label"] attribute DOMString? ariaLabel;
5357
[CEReactions=Needed, CustomGetter, Reflect="aria-labelledby"] attribute FrozenArray<Element>? ariaLabelledByElements;
54-
[CEReactions=Needed, Reflect="aria-level"] attribute DOMString? ariaLevel;
55-
[CEReactions=Needed, Reflect="aria-live"] attribute DOMString? ariaLive;
56-
[CEReactions=Needed, Reflect="aria-modal"] attribute DOMString? ariaModal;
57-
[CEReactions=Needed, Reflect="aria-multiline"] attribute DOMString? ariaMultiLine;
58-
[CEReactions=Needed, Reflect="aria-multiselectable"] attribute DOMString? ariaMultiSelectable;
59-
[CEReactions=Needed, Reflect="aria-orientation"] attribute DOMString? ariaOrientation;
58+
[CEReactions=Needed, Reflect="aria-level"] attribute DOMString? ariaLevel;
59+
[CEReactions=Needed, ReflectSetter="aria-live"] attribute [AtomString] DOMString? ariaLive;
60+
[CEReactions=Needed, ReflectSetter="aria-modal"] attribute [AtomString] DOMString? ariaModal;
61+
[CEReactions=Needed, ReflectSetter="aria-multiline"] attribute [AtomString] DOMString? ariaMultiLine;
62+
[CEReactions=Needed, ReflectSetter="aria-multiselectable"] attribute [AtomString] DOMString? ariaMultiSelectable;
63+
[CEReactions=Needed, ReflectSetter="aria-orientation"] attribute [AtomString] DOMString? ariaOrientation;
6064
[CEReactions=Needed, CustomGetter, Reflect="aria-owns"] attribute FrozenArray<Element>? ariaOwnsElements;
61-
[CEReactions=Needed, Reflect="aria-placeholder"] attribute DOMString? ariaPlaceholder;
62-
[CEReactions=Needed, Reflect="aria-posinset"] attribute DOMString? ariaPosInSet;
63-
[CEReactions=Needed, Reflect="aria-pressed"] attribute DOMString? ariaPressed;
64-
[CEReactions=Needed, Reflect="aria-readonly"] attribute DOMString? ariaReadOnly;
65-
[CEReactions=Needed, Reflect="aria-relevant"] attribute DOMString? ariaRelevant;
66-
[CEReactions=Needed, Reflect="aria-required"] attribute DOMString? ariaRequired;
67-
[CEReactions=Needed, Reflect="aria-roledescription"] attribute DOMString? ariaRoleDescription;
68-
[CEReactions=Needed, Reflect="aria-rowcount"] attribute DOMString? ariaRowCount;
69-
[CEReactions=Needed, Reflect="aria-rowindex"] attribute DOMString? ariaRowIndex;
70-
[CEReactions=Needed, Reflect="aria-rowindextext"] attribute DOMString? ariaRowIndexText;
71-
[CEReactions=Needed, Reflect="aria-rowspan"] attribute DOMString? ariaRowSpan;
72-
[CEReactions=Needed, Reflect="aria-selected"] attribute DOMString? ariaSelected;
73-
[CEReactions=Needed, Reflect="aria-setsize"] attribute DOMString? ariaSetSize;
74-
[CEReactions=Needed, Reflect="aria-sort"] attribute DOMString? ariaSort;
75-
[CEReactions=Needed, Reflect="aria-valuemax"] attribute DOMString? ariaValueMax;
76-
[CEReactions=Needed, Reflect="aria-valuemin"] attribute DOMString? ariaValueMin;
77-
[CEReactions=Needed, Reflect="aria-valuenow"] attribute DOMString? ariaValueNow;
78-
[CEReactions=Needed, Reflect="aria-valuetext"] attribute DOMString? ariaValueText;
65+
[CEReactions=Needed, Reflect="aria-placeholder"] attribute DOMString? ariaPlaceholder;
66+
[CEReactions=Needed, Reflect="aria-posinset"] attribute DOMString? ariaPosInSet;
67+
[CEReactions=Needed, ReflectSetter="aria-pressed"] attribute [AtomString] DOMString? ariaPressed;
68+
[CEReactions=Needed, ReflectSetter="aria-readonly"] attribute [AtomString] DOMString? ariaReadOnly;
69+
[CEReactions=Needed, Reflect="aria-relevant"] attribute DOMString? ariaRelevant;
70+
[CEReactions=Needed, ReflectSetter="aria-required"] attribute [AtomString] DOMString? ariaRequired;
71+
[CEReactions=Needed, Reflect="aria-roledescription"] attribute DOMString? ariaRoleDescription;
72+
[CEReactions=Needed, Reflect="aria-rowcount"] attribute DOMString? ariaRowCount;
73+
[CEReactions=Needed, Reflect="aria-rowindex"] attribute DOMString? ariaRowIndex;
74+
[CEReactions=Needed, Reflect="aria-rowindextext"] attribute DOMString? ariaRowIndexText;
75+
[CEReactions=Needed, Reflect="aria-rowspan"] attribute DOMString? ariaRowSpan;
76+
[CEReactions=Needed, ReflectSetter="aria-selected"] attribute [AtomString] DOMString? ariaSelected;
77+
[CEReactions=Needed, Reflect="aria-setsize"] attribute DOMString? ariaSetSize;
78+
[CEReactions=Needed, ReflectSetter="aria-sort"] attribute [AtomString] DOMString? ariaSort;
79+
[CEReactions=Needed, Reflect="aria-valuemax"] attribute DOMString? ariaValueMax;
80+
[CEReactions=Needed, Reflect="aria-valuemin"] attribute DOMString? ariaValueMin;
81+
[CEReactions=Needed, Reflect="aria-valuenow"] attribute DOMString? ariaValueNow;
82+
[CEReactions=Needed, Reflect="aria-valuetext"] attribute DOMString? ariaValueText;
7983
};

0 commit comments

Comments
 (0)