| Index: third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp
|
| diff --git a/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp b/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp
|
| index c4065f5ccc0d6c3746400f963255e72dd503eb27..782178db4354487f3f18705b2545161845e4bc23 100644
|
| --- a/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp
|
| +++ b/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp
|
| @@ -177,8 +177,8 @@ static inline LayoutObject* EndOfContinuations(LayoutObject* layout_object) {
|
| return prev;
|
| }
|
|
|
| -static inline bool LastChildHasContinuation(LayoutObject* layout_object) {
|
| - LayoutObject* last_child = layout_object->SlowLastChild();
|
| +static inline bool LastChildHasContinuation(LayoutObject* layoutObject) {
|
| + LayoutObject* last_child = layoutObject->SlowLastChild();
|
| return last_child && IsInlineWithContinuation(last_child);
|
| }
|
|
|
| @@ -196,7 +196,7 @@ AXLayoutObject::AXLayoutObject(LayoutObject* layout_object,
|
| : AXNodeObject(layout_object->GetNode(), ax_object_cache),
|
| layout_object_(layout_object) {
|
| #if DCHECK_IS_ON()
|
| - layout_object_->SetHasAXObject(true);
|
| + m_layoutObject->setHasAXObject(true);
|
| #endif
|
| }
|
|
|
| @@ -316,8 +316,8 @@ void AXLayoutObject::Detach() {
|
| DetachRemoteSVGRoot();
|
|
|
| #if DCHECK_IS_ON()
|
| - if (layout_object_)
|
| - layout_object_->SetHasAXObject(false);
|
| + if (m_layoutObject)
|
| + m_layoutObject->setHasAXObject(false);
|
| #endif
|
| layout_object_ = 0;
|
| }
|
| @@ -458,8 +458,7 @@ bool AXLayoutObject::IsSelected() const {
|
| if (!GetLayoutObject() || !GetNode())
|
| return false;
|
|
|
| - const AtomicString& aria_selected = GetAttribute(aria_selectedAttr);
|
| - if (EqualIgnoringASCIICase(aria_selected, "true"))
|
| + if (AOMPropertyOrARIAAttributeIsTrue(AOMBooleanProperty::kSelected))
|
| return true;
|
|
|
| AXObject* focused_object = AxObjectCache().FocusedObject();
|
| @@ -492,7 +491,7 @@ AXObjectInclusion AXLayoutObject::DefaultObjectInclusion(
|
| if (layout_object_->Style()->Visibility() != EVisibility::kVisible) {
|
| // aria-hidden is meant to override visibility as the determinant in AX
|
| // hierarchy inclusion.
|
| - if (EqualIgnoringASCIICase(GetAttribute(aria_hiddenAttr), "false"))
|
| + if (AOMPropertyOrARIAAttributeIsFalse(AOMBooleanProperty::kHidden))
|
| return kDefaultBehavior;
|
|
|
| if (ignored_reasons)
|
| @@ -504,9 +503,9 @@ AXObjectInclusion AXLayoutObject::DefaultObjectInclusion(
|
| }
|
|
|
| bool AXLayoutObject::ComputeAccessibilityIsIgnored(
|
| - IgnoredReasons* ignored_reasons) const {
|
| + IgnoredReasons* ignoredReasons) const {
|
| #if DCHECK_IS_ON()
|
| - DCHECK(initialized_);
|
| + DCHECK(m_initialized);
|
| #endif
|
|
|
| if (!layout_object_)
|
| @@ -515,7 +514,7 @@ bool AXLayoutObject::ComputeAccessibilityIsIgnored(
|
| // Check first if any of the common reasons cause this element to be ignored.
|
| // Then process other use cases that need to be applied to all the various
|
| // roles that AXLayoutObjects take on.
|
| - AXObjectInclusion decision = DefaultObjectInclusion(ignored_reasons);
|
| + AXObjectInclusion decision = DefaultObjectInclusion(ignoredReasons);
|
| if (decision == kIncludeObject)
|
| return false;
|
| if (decision == kIgnoreObject)
|
| @@ -527,25 +526,25 @@ bool AXLayoutObject::ComputeAccessibilityIsIgnored(
|
| // If this element is within a parent that cannot have children, it should not
|
| // be exposed.
|
| if (IsDescendantOfLeafNode()) {
|
| - if (ignored_reasons)
|
| - ignored_reasons->push_back(
|
| + if (ignoredReasons)
|
| + ignoredReasons->push_back(
|
| IgnoredReason(kAXAncestorIsLeafNode, LeafNodeAncestor()));
|
| return true;
|
| }
|
|
|
| if (RoleValue() == kIgnoredRole) {
|
| - if (ignored_reasons)
|
| - ignored_reasons->push_back(IgnoredReason(kAXUninteresting));
|
| + if (ignoredReasons)
|
| + ignoredReasons->push_back(IgnoredReason(kAXUninteresting));
|
| return true;
|
| }
|
|
|
| if (HasInheritedPresentationalRole()) {
|
| - if (ignored_reasons) {
|
| + if (ignoredReasons) {
|
| const AXObject* inherits_from = InheritsPresentationalRoleFrom();
|
| if (inherits_from == this)
|
| - ignored_reasons->push_back(IgnoredReason(kAXPresentationalRole));
|
| + ignoredReasons->push_back(IgnoredReason(kAXPresentationalRole));
|
| else
|
| - ignored_reasons->push_back(
|
| + ignoredReasons->push_back(
|
| IgnoredReason(kAXInheritsPresentation, inherits_from));
|
| }
|
| return true;
|
| @@ -553,8 +552,8 @@ bool AXLayoutObject::ComputeAccessibilityIsIgnored(
|
|
|
| // An ARIA tree can only have tree items and static text as children.
|
| if (AXObject* tree_ancestor = TreeAncestorDisallowingChild()) {
|
| - if (ignored_reasons)
|
| - ignored_reasons->push_back(
|
| + if (ignoredReasons)
|
| + ignoredReasons->push_back(
|
| IgnoredReason(kAXAncestorDisallowsChild, tree_ancestor));
|
| return true;
|
| }
|
| @@ -574,15 +573,15 @@ bool AXLayoutObject::ComputeAccessibilityIsIgnored(
|
| AXObject* control_object = CorrespondingControlForLabelElement();
|
| if (control_object && control_object->IsCheckboxOrRadio() &&
|
| control_object->NameFromLabelElement()) {
|
| - if (ignored_reasons) {
|
| + if (ignoredReasons) {
|
| HTMLLabelElement* label = LabelElementContainer();
|
| if (label && label != GetNode()) {
|
| AXObject* label_ax_object = AxObjectCache().GetOrCreate(label);
|
| - ignored_reasons->push_back(
|
| + ignoredReasons->push_back(
|
| IgnoredReason(kAXLabelContainer, label_ax_object));
|
| }
|
|
|
| - ignored_reasons->push_back(IgnoredReason(kAXLabelFor, control_object));
|
| + ignoredReasons->push_back(IgnoredReason(kAXLabelFor, control_object));
|
| }
|
| return true;
|
| }
|
| @@ -602,15 +601,15 @@ bool AXLayoutObject::ComputeAccessibilityIsIgnored(
|
| AXObject* parent = ParentObjectUnignored();
|
| if (parent && (parent->AriaRoleAttribute() == kMenuItemRole ||
|
| parent->AriaRoleAttribute() == kMenuButtonRole)) {
|
| - if (ignored_reasons)
|
| - ignored_reasons->push_back(
|
| + if (ignoredReasons)
|
| + ignoredReasons->push_back(
|
| IgnoredReason(kAXStaticTextUsedAsNameFor, parent));
|
| return true;
|
| }
|
| LayoutText* layout_text = ToLayoutText(layout_object_);
|
| if (!layout_text->HasTextBoxes()) {
|
| - if (ignored_reasons)
|
| - ignored_reasons->push_back(IgnoredReason(kAXEmptyText));
|
| + if (ignoredReasons)
|
| + ignoredReasons->push_back(IgnoredReason(kAXEmptyText));
|
| return true;
|
| }
|
|
|
| @@ -625,8 +624,8 @@ bool AXLayoutObject::ComputeAccessibilityIsIgnored(
|
| // FIXME(dmazzoni): we probably shouldn't ignore this if the style is 'pre',
|
| // or similar...
|
| if (layout_text->GetText().Impl()->ContainsOnlyWhitespace()) {
|
| - if (ignored_reasons)
|
| - ignored_reasons->push_back(IgnoredReason(kAXEmptyText));
|
| + if (ignoredReasons)
|
| + ignoredReasons->push_back(IgnoredReason(kAXEmptyText));
|
| return true;
|
| }
|
| return false;
|
| @@ -717,8 +716,8 @@ bool AXLayoutObject::ComputeAccessibilityIsIgnored(
|
| // This is especially problematic for platforms which have distinct roles for
|
| // textual block elements.
|
| if (isHTMLSpanElement(node)) {
|
| - if (ignored_reasons)
|
| - ignored_reasons->push_back(IgnoredReason(kAXUninteresting));
|
| + if (ignoredReasons)
|
| + ignoredReasons->push_back(IgnoredReason(kAXUninteresting));
|
| return true;
|
| }
|
|
|
| @@ -730,8 +729,8 @@ bool AXLayoutObject::ComputeAccessibilityIsIgnored(
|
| return false;
|
| LayoutHTMLCanvas* canvas = ToLayoutHTMLCanvas(layout_object_);
|
| if (canvas->Size().Height() <= 1 || canvas->Size().Width() <= 1) {
|
| - if (ignored_reasons)
|
| - ignored_reasons->push_back(IgnoredReason(kAXProbablyPresentational));
|
| + if (ignoredReasons)
|
| + ignoredReasons->push_back(IgnoredReason(kAXProbablyPresentational));
|
| return true;
|
| }
|
| // Otherwise fall through; use presence of help text, title, or description
|
| @@ -775,15 +774,15 @@ bool AXLayoutObject::ComputeAccessibilityIsIgnored(
|
| if (has_any_text || MouseButtonListener())
|
| return false;
|
|
|
| - if (ignored_reasons)
|
| - ignored_reasons->push_back(IgnoredReason(kAXUninteresting));
|
| + if (ignoredReasons)
|
| + ignoredReasons->push_back(IgnoredReason(kAXUninteresting));
|
| return true;
|
| }
|
|
|
| // By default, objects should be ignored so that the AX hierarchy is not
|
| // filled with unnecessary items.
|
| - if (ignored_reasons)
|
| - ignored_reasons->push_back(IgnoredReason(kAXUninteresting));
|
| + if (ignoredReasons)
|
| + ignoredReasons->push_back(IgnoredReason(kAXUninteresting));
|
| return true;
|
| }
|
|
|
| @@ -1372,17 +1371,17 @@ const AtomicString& AXLayoutObject::LiveRegionRelevant() const {
|
| }
|
|
|
| bool AXLayoutObject::LiveRegionAtomic() const {
|
| + bool atomic = false;
|
| + if (HasAOMPropertyOrARIAAttribute(AOMBooleanProperty::kAtomic, atomic))
|
| + return atomic;
|
| +
|
| // ARIA roles "alert" and "status" should have an implicit aria-atomic value
|
| // of true.
|
| - if (GetAttribute(aria_atomicAttr).IsEmpty() &&
|
| - (RoleValue() == kAlertRole || RoleValue() == kStatusRole)) {
|
| - return true;
|
| - }
|
| - return ElementAttributeValue(aria_atomicAttr);
|
| + return RoleValue() == kAlertRole || RoleValue() == kStatusRole;
|
| }
|
|
|
| bool AXLayoutObject::LiveRegionBusy() const {
|
| - return ElementAttributeValue(aria_busyAttr);
|
| + return AOMPropertyOrARIAAttributeIsTrue(AOMBooleanProperty::kBusy);
|
| }
|
|
|
| //
|
| @@ -2015,12 +2014,12 @@ void AXLayoutObject::SetSelection(const AXRange& selection) {
|
| .Build());
|
| }
|
|
|
| -bool AXLayoutObject::IsValidSelectionBound(const AXObject* bound_object) const {
|
| - return GetLayoutObject() && bound_object && !bound_object->IsDetached() &&
|
| - bound_object->IsAXLayoutObject() && bound_object->GetLayoutObject() &&
|
| - bound_object->GetLayoutObject()->GetFrame() ==
|
| +bool AXLayoutObject::IsValidSelectionBound(const AXObject* boundObject) const {
|
| + return GetLayoutObject() && boundObject && !boundObject->IsDetached() &&
|
| + boundObject->IsAXLayoutObject() && boundObject->GetLayoutObject() &&
|
| + boundObject->GetLayoutObject()->GetFrame() ==
|
| GetLayoutObject()->GetFrame() &&
|
| - &bound_object->AxObjectCache() == &AxObjectCache();
|
| + &boundObject->AxObjectCache() == &AxObjectCache();
|
| }
|
|
|
| void AXLayoutObject::SetValue(const String& string) {
|
| @@ -2510,11 +2509,11 @@ void AXLayoutObject::AddRemoteSVGChildren() {
|
| }
|
|
|
| bool AXLayoutObject::ElementAttributeValue(
|
| - const QualifiedName& attribute_name) const {
|
| + const QualifiedName& attributeName) const {
|
| if (!layout_object_)
|
| return false;
|
|
|
| - return EqualIgnoringASCIICase(GetAttribute(attribute_name), "true");
|
| + return EqualIgnoringASCIICase(GetAttribute(attributeName), "true");
|
| }
|
|
|
| } // namespace blink
|
|
|