Skip to content

Commit

Permalink
Reland of name AXObject to AXObjectImpl in modules/ and web/ (patchse…
Browse files Browse the repository at this point in the history
…t #1 id:1 of https://codereview.chromium.org/2883203002/ )

Reason for revert:
Lots of breakage across all CQ builders e.g. https://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_ng/builds/454351

Looks like the revert is missing a BUILD.gn update at least

Original issue's description:
> Revert of Rename AXObject to AXObjectImpl in modules/ and web/ (patchset chromium#9 id:160001 of https://codereview.chromium.org/2858493002/ )
>
> Reason for revert:
> Landed wrong patchset.
>
> Original issue's description:
> > Rename AXObject to AXObjectImpl in modules/ and web/
> >
> > Rename AXObject to AXObjectImpl in modules/ and web/, and introduce an
> > empty abstract parent class in core/. This is pre-work to remove usages
> > of AXObjectImpl from web/, which will use AXObject instead.
> >
> > This patch does not rename the usages in core/ since these should use
> > the new abstract object.
> >
> > BUG=715382
> >
> > Review-Url: https://codereview.chromium.org/2858493002
> > Cr-Commit-Position: refs/heads/master@{#471663}
> > Committed: https://chromium.googlesource.com/chromium/src/+/234813ae8d52f622a1664e11365642751e8f26ba
>
> [email protected],[email protected],[email protected],[email protected],[email protected]
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=715382
>
> Review-Url: https://codereview.chromium.org/2883203002
> Cr-Commit-Position: refs/heads/master@{#471975}
> Committed: https://chromium.googlesource.com/chromium/src/+/b88633c21b9db5ffcb316d744452625ccb5061e9

[email protected],[email protected],[email protected],[email protected],[email protected],[email protected]
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=715382

Review-Url: https://codereview.chromium.org/2883813005
Cr-Commit-Position: refs/heads/master@{#471980}
  • Loading branch information
krockot authored and Commit bot committed May 16, 2017
1 parent 2b4cf1f commit f393a79
Show file tree
Hide file tree
Showing 59 changed files with 669 additions and 631 deletions.
10 changes: 5 additions & 5 deletions docs/accessibility/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -411,15 +411,15 @@ means an ID that's globally unique.
## Blink

Blink constructs an accessibility tree (a hierarchy of [WebAXObject]s) from the
page it is rendering. WebAXObject is the public API wrapper around [AXObject],
which is the core class of Blink's accessibility tree. AXObject is an abstract
page it is rendering. WebAXObject is the public API wrapper around [AXObjectImpl],
which is the core class of Blink's accessibility tree. AXObjectImpl is an abstract
class; the most commonly used concrete subclass of it is [AXNodeObject], which
wraps a [Node]. In turn, most AXNodeObjects are actually [AXLayoutObject]s,
which wrap both a [Node] and a [LayoutObject]. Access to the LayoutObject is
important because some elements are only in the AXObject tree depending on their
important because some elements are only in the AXObjectImpl tree depending on their
visibility, geometry, linewrapping, and so on. There are some subclasses of
AXLayoutObject that implement special-case logic for specific types of Node.
There are also other subclasses of AXObject, which are mostly used for testing.
There are also other subclasses of AXObjectImpl, which are mostly used for testing.

Note that not all AXLayoutObjects correspond to actual Nodes; some are synthetic
layout objects which group related inline elements or similar.
Expand Down Expand Up @@ -493,7 +493,7 @@ is defined by [automation.idl], which must be kept synchronized with
[AXContentNodeData]: https://cs.chromium.org/chromium/src/content/common/ax_content_node_data.h
[AXLayoutObject]: https://cs.chromium.org/chromium/src/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.h
[AXNodeObject]: https://cs.chromium.org/chromium/src/third_party/WebKit/Source/modules/accessibility/AXNodeObject.h
[AXObject]: https://cs.chromium.org/chromium/src/third_party/WebKit/Source/modules/accessibility/AXObject.h
[AXObjectImpl]: https://cs.chromium.org/chromium/src/third_party/WebKit/Source/modules/accessibility/AXObjectImpl.h
[AXObjectCacheImpl]: https://cs.chromium.org/chromium/src/third_party/WebKit/Source/modules/accessibility/AXObjectCacheImpl.h
[AXPlatformNode]: https://cs.chromium.org/chromium/src/ui/accessibility/platform/ax_platform_node.h
[AXTreeSerializer]: https://cs.chromium.org/chromium/src/ui/accessibility/ax_tree_serializer.h
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Make sure that a debug assert is not triggered when a call to LayoutBlockFlow::deleteLineBoxTree calls AccessibilityRenderObject::accessibilityIsIgnored which may require the AXObject for a node that is being deleted.
Make sure that a debug assert is not triggered when a call to LayoutBlockFlow::deleteLineBoxTree calls AccessibilityRenderObject::accessibilityIsIgnored which may require the AXObjectImpl for a node that is being deleted.

On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<div id="console"></div>

<script>
description("Make sure that a debug assert is not triggered when a call to LayoutBlockFlow::deleteLineBoxTree calls AccessibilityRenderObject::accessibilityIsIgnored which may require the AXObject for a node that is being deleted.");
description("Make sure that a debug assert is not triggered when a call to LayoutBlockFlow::deleteLineBoxTree calls AccessibilityRenderObject::accessibilityIsIgnored which may require the AXObjectImpl for a node that is being deleted.");

var label = document.createElement('label');
label.style.position = 'fixed';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
test(function(t){
var axButton = accessibilityController.accessibleElementById("button");

// Get the AXObject for the label indirectly, even though it's display:none.
// Get the AXObjectImpl for the label indirectly, even though it's display:none.
// Ensure that it's valid.
var axLabel = axButton.nameElementAtIndex(0);
assert_equals(axLabel.isValid, true);
Expand All @@ -19,8 +19,8 @@
var label = document.getElementById('label');
label.style.display = "block";

// Ensure that the previous AXObject we had for the label is now invalid, but if
// we fetch an AXObject for it, we get a new valid object.
// Ensure that the previous AXObjectImpl we had for the label is now invalid, but if
// we fetch an AXObjectImpl for it, we get a new valid object.
var axLabel2 = axButton.nameElementAtIndex(0);
assert_equals(axLabel.isValid, false);
assert_equals(axLabel2.isValid, true);
Expand All @@ -30,8 +30,8 @@
// Now hide the label again.
label.style.display = "none";

// Check once more: the second AXObject is now invalid, but if we fetch
// an AXObject for the label a third time, we get a valid object again.
// Check once more: the second AXObjectImpl is now invalid, but if we fetch
// an AXObjectImpl for the label a third time, we get a valid object again.
var axLabel3 = axButton.nameElementAtIndex(0);
assert_equals(axLabel.isValid, false);
assert_equals(axLabel2.isValid, false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE


PASS containerNode.childrenCount is 8
PASS AXObject.role is 'AXRole: AXArticle'
PASS AXObject.role is 'AXRole: AXRegion'
PASS AXObject.role is 'AXRole: AXBanner'
PASS AXObject.role is 'AXRole: AXComplementary'
PASS AXObject.role is 'AXRole: AXContentInfo'
PASS AXObject.role is 'AXRole: AXFooter'
PASS AXObject.role is 'AXRole: AXMain'
PASS AXObject.role is 'AXRole: AXNavigation'
PASS AXObjectImpl.role is 'AXRole: AXArticle'
PASS AXObjectImpl.role is 'AXRole: AXRegion'
PASS AXObjectImpl.role is 'AXRole: AXBanner'
PASS AXObjectImpl.role is 'AXRole: AXComplementary'
PASS AXObjectImpl.role is 'AXRole: AXContentInfo'
PASS AXObjectImpl.role is 'AXRole: AXFooter'
PASS AXObjectImpl.role is 'AXRole: AXMain'
PASS AXObjectImpl.role is 'AXRole: AXNavigation'
PASS successfullyParsed is true

TEST COMPLETE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@
shouldBe("containerNode.childrenCount", "" + roles.length);

for (var i = 0; i < roles.length; i++) {
var AXObject = containerNode.childAtIndex(i);
shouldBe("AXObject.role", "'AXRole: " + roles[i] + "'");
var AXObjectImpl = containerNode.childAtIndex(i);
shouldBe("AXObjectImpl.role", "'AXRole: " + roles[i] + "'");
}
}
</script>
Expand Down
2 changes: 1 addition & 1 deletion third_party/WebKit/Source/core/dom/AXObjectCache.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ class CORE_EXPORT AXObjectCache
// changed.
virtual void TextChanged(LayoutObject*) = 0;
// Called when a node has just been attached, so we can make sure we have the
// right subclass of AXObject.
// right subclass of AXObjectImpl.
virtual void UpdateCacheAfterNodeIsAttached(Node*) = 0;

virtual void HandleAttributeChanged(const QualifiedName& attr_name,
Expand Down
4 changes: 2 additions & 2 deletions third_party/WebKit/Source/core/dom/Document.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4291,8 +4291,8 @@ bool Document::SetFocusedElement(Element* new_focused_element,
}

if (!focus_change_blocked && focused_element_) {
// Create the AXObject cache in a focus change because Chromium relies on
// it.
// Create the AXObjectImpl cache in a focus change because Chromium relies
// on it.
if (AXObjectCache* cache = AxObjectCache())
cache->HandleFocusedUIElementChanged(old_focused_element,
new_focused_element);
Expand Down
2 changes: 1 addition & 1 deletion third_party/WebKit/Source/core/frame/FrameView.h
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ class CORE_EXPORT FrameView final

bool IsActive() const override;

// Override scrollbar notifications to update the AXObject cache.
// Override scrollbar notifications to update the AXObjectImpl cache.
void DidAddScrollbar(Scrollbar&, ScrollbarOrientation) override;

// FIXME: This should probably be renamed as the 'inSubtreeLayout' parameter
Expand Down
2 changes: 1 addition & 1 deletion third_party/WebKit/Source/core/html/HTMLInputElement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1884,7 +1884,7 @@ void HTMLInputElement::DidNotifySubtreeInsertionsToDocument() {
ListAttributeTargetChanged();
}

AXObject* HTMLInputElement::PopupRootAXObject() {
AXObjectImpl* HTMLInputElement::PopupRootAXObject() {
return input_type_view_->PopupRootAXObject();
}

Expand Down
4 changes: 2 additions & 2 deletions third_party/WebKit/Source/core/html/HTMLInputElement.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

namespace blink {

class AXObject;
class AXObjectImpl;
class DragData;
class ExceptionState;
class FileList;
Expand Down Expand Up @@ -279,7 +279,7 @@ class CORE_EXPORT HTMLInputElement : public TextControlElement {

void SetShouldRevealPassword(bool value);
bool ShouldRevealPassword() const { return should_reveal_password_; }
AXObject* PopupRootAXObject();
AXObjectImpl* PopupRootAXObject();
void DidNotifySubtreeInsertionsToDocument() override;

virtual void EnsureFallbackContent();
Expand Down
6 changes: 3 additions & 3 deletions third_party/WebKit/Source/core/html/forms/ColorChooser.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

namespace blink {

class AXObject;
class AXObjectImpl;
class Color;

class CORE_EXPORT ColorChooser : public GarbageCollectedMixin {
Expand All @@ -46,8 +46,8 @@ class CORE_EXPORT ColorChooser : public GarbageCollectedMixin {

virtual void SetSelectedColor(const Color&) {}
virtual void EndChooser() {}
// Returns a root AXObject in the ColorChooser if it's available.
virtual AXObject* RootAXObject() = 0;
// Returns a root AXObjectImpl in the ColorChooser if it's available.
virtual AXObjectImpl* RootAXObject() = 0;
};

} // namespace blink
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ Vector<ColorSuggestion> ColorInputType::Suggestions() const {
return suggestions;
}

AXObject* ColorInputType::PopupRootAXObject() {
AXObjectImpl* ColorInputType::PopupRootAXObject() {
return chooser_ ? chooser_->RootAXObject() : nullptr;
}

Expand Down
2 changes: 1 addition & 1 deletion third_party/WebKit/Source/core/html/forms/ColorInputType.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class ColorInputType final : public InputType,
bool TypeMismatchFor(const String&) const override;
void WarnIfValueIsInvalid(const String&) const override;
void UpdateView() override;
AXObject* PopupRootAXObject() override;
AXObjectImpl* PopupRootAXObject() override;

Color ValueAsColor() const;
void EndColorChooser();
Expand Down
6 changes: 3 additions & 3 deletions third_party/WebKit/Source/core/html/forms/DateTimeChooser.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

namespace blink {

class AXObject;
class AXObjectImpl;

struct DateTimeSuggestion {
DISALLOW_NEW_EXCEPT_PLACEMENT_NEW();
Expand Down Expand Up @@ -73,8 +73,8 @@ class CORE_EXPORT DateTimeChooser
virtual ~DateTimeChooser();

virtual void EndChooser() = 0;
// Returns a root AXObject in the DateTimeChooser if it's available.
virtual AXObject* RootAXObject() = 0;
// Returns a root AXObjectImpl in the DateTimeChooser if it's available.
virtual AXObjectImpl* RootAXObject() = 0;

DEFINE_INLINE_VIRTUAL_TRACE() {}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ void InputTypeView::UpdateClearButtonVisibility() {}

void InputTypeView::UpdatePlaceholderText() {}

AXObject* InputTypeView::PopupRootAXObject() {
AXObjectImpl* InputTypeView::PopupRootAXObject() {
return nullptr;
}

Expand Down
4 changes: 2 additions & 2 deletions third_party/WebKit/Source/core/html/forms/InputTypeView.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@

namespace blink {

class AXObject;
class AXObjectImpl;
class BeforeTextInsertedEvent;
class Element;
class Event;
Expand Down Expand Up @@ -124,7 +124,7 @@ class CORE_EXPORT InputTypeView : public GarbageCollectedMixin {
virtual void ListAttributeTargetChanged();
virtual void UpdateClearButtonVisibility();
virtual void UpdatePlaceholderText();
virtual AXObject* PopupRootAXObject();
virtual AXObjectImpl* PopupRootAXObject();
virtual void EnsureFallbackContent() {}
virtual void EnsurePrimaryContent() {}
virtual bool HasFallbackContent() const { return false; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ TextDirection MultipleFieldsTemporalInputTypeView::ComputedTextDirection() {
: TextDirection::kLtr;
}

AXObject* MultipleFieldsTemporalInputTypeView::PopupRootAXObject() {
AXObjectImpl* MultipleFieldsTemporalInputTypeView::PopupRootAXObject() {
if (PickerIndicatorElement* picker = GetPickerIndicatorElement())
return picker->PopupRootAXObject();
return nullptr;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ class MultipleFieldsTemporalInputTypeView final
void ListAttributeTargetChanged() final;
void UpdateClearButtonVisibility() final;
TextDirection ComputedTextDirection() final;
AXObject* PopupRootAXObject() final;
AXObjectImpl* PopupRootAXObject() final;

DateTimeEditElement* GetDateTimeEditElement() const;
SpinButtonElement* GetSpinButtonElement() const;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ void PickerIndicatorElement::DetachLayoutTree(const AttachContext& context) {
HTMLDivElement::DetachLayoutTree(context);
}

AXObject* PickerIndicatorElement::PopupRootAXObject() const {
AXObjectImpl* PickerIndicatorElement::PopupRootAXObject() const {
return chooser_ ? chooser_->RootAXObject() : 0;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class PickerIndicatorElement final : public HTMLDivElement,
void ClosePopup();
bool WillRespondToMouseClickEvents() override;
void RemovePickerIndicatorOwner() { picker_indicator_owner_ = nullptr; }
AXObject* PopupRootAXObject() const;
AXObjectImpl* PopupRootAXObject() const;

// DateTimeChooserClient implementation.
Element& OwnerElement() const override;
Expand Down
4 changes: 2 additions & 2 deletions third_party/WebKit/Source/core/page/ChromeClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@

namespace blink {

class AXObject;
class AXObjectImpl;
class ColorChooser;
class ColorChooserClient;
class CompositorWorkerProxyClient;
Expand Down Expand Up @@ -287,7 +287,7 @@ class CORE_EXPORT ChromeClient : public PlatformChromeClient {
virtual void ClosePagePopup(PagePopup*) = 0;
virtual DOMWindow* PagePopupWindowForTesting() const = 0;

virtual void PostAccessibilityNotification(AXObject*,
virtual void PostAccessibilityNotification(AXObjectImpl*,
AXObjectCache::AXNotification) {}
virtual String AcceptLanguages() = 0;

Expand Down
4 changes: 2 additions & 2 deletions third_party/WebKit/Source/core/page/PagePopup.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@

namespace blink {

class AXObject;
class AXObjectImpl;
class IntRect;

// A PagePopup object is created by ChromeClient::openPagePopup(), and deleted
// by ChromeClient::closePagePopup().
class PagePopup {
public:
virtual AXObject* RootAXObject() = 0;
virtual AXObjectImpl* RootAXObject() = 0;
virtual void SetWindowRect(const IntRect&) = 0;
virtual void PostMessage(const String& message) = 0;

Expand Down
15 changes: 8 additions & 7 deletions third_party/WebKit/Source/modules/accessibility/AXARIAGrid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,10 @@ AXARIAGrid* AXARIAGrid::Create(LayoutObject* layout_object,
return new AXARIAGrid(layout_object, ax_object_cache);
}

bool AXARIAGrid::AddTableRowChild(AXObject* child,
HeapHashSet<Member<AXObject>>& appended_rows,
unsigned& column_count) {
bool AXARIAGrid::AddTableRowChild(
AXObjectImpl* child,
HeapHashSet<Member<AXObjectImpl>>& appended_rows,
unsigned& column_count) {
if (!child || child->RoleValue() != kRowRole)
return false;

Expand Down Expand Up @@ -89,16 +90,16 @@ void AXARIAGrid::AddChildren() {
if (!layout_object_)
return;

HeapVector<Member<AXObject>> children;
for (AXObject* child = RawFirstChild(); child;
HeapVector<Member<AXObjectImpl>> children;
for (AXObjectImpl* child = RawFirstChild(); child;
child = child->RawNextSibling())
children.push_back(child);
ComputeAriaOwnsChildren(children);

AXObjectCacheImpl& ax_cache = AxObjectCache();

// Only add children that are actually rows.
HeapHashSet<Member<AXObject>> appended_rows;
HeapHashSet<Member<AXObjectImpl>> appended_rows;
unsigned column_count = 0;
for (const auto& child : children) {
if (!AddTableRowChild(child, appended_rows, column_count)) {
Expand All @@ -125,7 +126,7 @@ void AXARIAGrid::AddChildren() {
children_.push_back(column);
}

AXObject* header_container_object = HeaderContainer();
AXObjectImpl* header_container_object = HeaderContainer();
if (header_container_object &&
!header_container_object->AccessibilityIsIgnored())
children_.push_back(header_container_object);
Expand Down
4 changes: 2 additions & 2 deletions third_party/WebKit/Source/modules/accessibility/AXARIAGrid.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ class AXARIAGrid final : public AXTable {
bool IsMultiSelectable() const override { return true; }
bool IsTableExposableThroughAccessibility() const override { return true; }

bool AddTableRowChild(AXObject*,
HeapHashSet<Member<AXObject>>& appended_rows,
bool AddTableRowChild(AXObjectImpl*,
HeapHashSet<Member<AXObjectImpl>>& appended_rows,
unsigned& column_count);
};

Expand Down
Loading

0 comments on commit f393a79

Please sign in to comment.