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

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

Issue 2805493002: Boolean properties for Accessibility Object Model Phase 1 (Closed)
Patch Set: Address feedback Created 3 years, 8 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 07f59fb81c7c1c62078beab357a73ae38290b632..8d570b08293ca2a2ef6d186a7d5a72db6d50499c 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/
@@ -53,15 +68,36 @@ class CORE_EXPORT AccessibleNode
// otherwise returns the equivalent ARIA attribute.
static const AtomicString& GetProperty(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 GetProperty(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&);
@@ -74,21 +110,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&);
@@ -99,10 +153,12 @@ class CORE_EXPORT AccessibleNode
private:
void SetStringProperty(AOMStringProperty, const AtomicString&);
+ void SetBooleanProperty(AOMBooleanProperty, bool);
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