Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(294)

Unified Diff: third_party/WebKit/Source/core/dom/AccessibleNode.h

Issue 2805493002: Boolean properties for Accessibility Object Model Phase 1 (Closed)
Patch Set: Back to previous patchset, ready to land Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/dom/AccessibleNode.h
diff --git a/third_party/WebKit/Source/core/dom/AccessibleNode.h b/third_party/WebKit/Source/core/dom/AccessibleNode.h
index 333d5ef119739b521d2f826fe1423755d8ef3a48..8d7fa817b4e07cc1bc341366f0a6638d4aa8ef2e 100644
--- a/third_party/WebKit/Source/core/dom/AccessibleNode.h
+++ b/third_party/WebKit/Source/core/dom/AccessibleNode.h
@@ -37,6 +37,21 @@ enum class AOMStringProperty {
kValueText
};
+// All of the properties of AccessibleNode that have type "boolean".
+enum class AOMBooleanProperty {
+ kAtomic,
+ kBusy,
+ kDisabled,
+ kExpanded,
+ kHidden,
+ kModal,
+ kMultiline,
+ kMultiselectable,
+ kReadOnly,
+ kRequired,
+ kSelected
+};
+
// Accessibility Object Model node
// Explainer: https://github.com/WICG/aom/blob/master/explainer.md
// Spec: https://wicg.github.io/aom/spec/
@@ -52,20 +67,49 @@ class CORE_EXPORT AccessibleNode
// Returns the given string property if the Element has an AccessibleNode.
static const AtomicString& GetProperty(Element*, AOMStringProperty);
- // Returns the given string property if the Element has an AccessibleNode,
- // otherwise returns the equivalent ARIA attribute.
+ // Returns the value of the given boolean property if the
+ // Element has an AccessibleNode. Sets |isNull| if the property and
+ // attribute are not present.
+ static bool GetProperty(Element*, AOMBooleanProperty, bool& is_null);
+
+ // Returns the value of the given string property if the
+ // Element has an AccessibleNode, otherwise returns the equivalent
+ // ARIA attribute.
static const AtomicString& GetPropertyOrARIAAttribute(Element*,
AOMStringProperty);
+ // Returns the value of the given boolean property if the
+ // Element has an AccessibleNode, otherwise returns the equivalent
+ // ARIA attribute. Sets |isNull| if the property and attribute are not
+ // present.
+ static bool GetPropertyOrARIAAttribute(Element*,
+ AOMBooleanProperty,
+ bool& is_null);
+
+ bool atomic(bool&) const;
+ void setAtomic(bool, bool is_null);
+
AtomicString autocomplete() const;
void setAutocomplete(const AtomicString&);
+ bool busy(bool&) const;
+ void setBusy(bool, bool is_null);
+
AtomicString checked() const;
void setChecked(const AtomicString&);
AtomicString current() const;
void setCurrent(const AtomicString&);
+ bool disabled(bool&) const;
+ void setDisabled(bool, bool is_null);
+
+ bool expanded(bool&) const;
+ void setExpanded(bool, bool is_null);
+
+ bool hidden(bool&) const;
+ void setHidden(bool, bool is_null);
+
AtomicString invalid() const;
void setInvalid(const AtomicString&);
@@ -78,21 +122,39 @@ class CORE_EXPORT AccessibleNode
AtomicString live() const;
void setLive(const AtomicString&);
+ bool modal(bool&) const;
+ void setModal(bool, bool is_null);
+
+ bool multiline(bool&) const;
+ void setMultiline(bool, bool is_null);
+
+ bool multiselectable(bool&) const;
+ void setMultiselectable(bool, bool is_null);
+
AtomicString orientation() const;
void setOrientation(const AtomicString&);
AtomicString placeholder() const;
void setPlaceholder(const AtomicString&);
+ bool readOnly(bool&) const;
+ void setReadOnly(bool, bool is_null);
+
AtomicString relevant() const;
void setRelevant(const AtomicString&);
+ bool required(bool&) const;
+ void setRequired(bool, bool is_null);
+
AtomicString role() const;
void setRole(const AtomicString&);
AtomicString roleDescription() const;
void setRoleDescription(const AtomicString&);
+ bool selected(bool&) const;
+ void setSelected(bool, bool is_null);
+
AtomicString sort() const;
void setSort(const AtomicString&);
@@ -103,10 +165,12 @@ class CORE_EXPORT AccessibleNode
private:
void SetStringProperty(AOMStringProperty, const AtomicString&);
+ void SetBooleanProperty(AOMBooleanProperty, bool value, bool is_null);
void NotifyAttributeChanged(const blink::QualifiedName&);
AXObjectCache* GetAXObjectCache();
Vector<std::pair<AOMStringProperty, AtomicString>> string_properties_;
+ Vector<std::pair<AOMBooleanProperty, bool>> boolean_properties_;
// This object's owner Element.
Member<Element> element_;

Powered by Google App Engine
This is Rietveld 408576698