From b498325ab6ea7c253b73d65eaf15de7c9bf073e9 Mon Sep 17 00:00:00 2001 From: sashab Date: Tue, 16 May 2017 18:18:46 -0700 Subject: [PATCH] Revert of Rename AXObject to AXObjectImpl in modules/ and web/ (patchset #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 TBR=aboxhall@chromium.org,dmazzoni@chromium.org,haraken@chromium.org,mkwst@chromium.org,slangley@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=715382 Review-Url: https://codereview.chromium.org/2887613002 Cr-Commit-Position: refs/heads/master@{#472281} --- docs/accessibility/overview.md | 10 +- ...ponding-control-deleted-crash-expected.txt | 2 +- .../corresponding-control-deleted-crash.html | 2 +- .../accessibility/display-none-change.html | 10 +- .../not-ignore-landmark-roles-expected.txt | 16 +- .../not-ignore-landmark-roles.html | 4 +- .../WebKit/Source/core/dom/AXObjectCache.h | 2 +- .../WebKit/Source/core/dom/Document.cpp | 4 +- .../WebKit/Source/core/frame/FrameView.h | 2 +- .../Source/core/html/HTMLInputElement.cpp | 2 +- .../Source/core/html/HTMLInputElement.h | 4 +- .../Source/core/html/forms/ColorChooser.h | 6 +- .../Source/core/html/forms/ColorInputType.cpp | 2 +- .../Source/core/html/forms/ColorInputType.h | 2 +- .../Source/core/html/forms/DateTimeChooser.h | 6 +- .../Source/core/html/forms/InputTypeView.cpp | 2 +- .../Source/core/html/forms/InputTypeView.h | 4 +- .../MultipleFieldsTemporalInputTypeView.cpp | 2 +- .../MultipleFieldsTemporalInputTypeView.h | 2 +- .../html/forms/PickerIndicatorElement.cpp | 2 +- .../core/html/forms/PickerIndicatorElement.h | 2 +- .../WebKit/Source/core/page/ChromeClient.h | 4 +- .../WebKit/Source/core/page/PagePopup.h | 4 +- .../modules/accessibility/AXARIAGrid.cpp | 15 +- .../Source/modules/accessibility/AXARIAGrid.h | 4 +- .../modules/accessibility/AXARIAGridCell.cpp | 8 +- .../modules/accessibility/AXARIAGridCell.h | 2 +- .../modules/accessibility/AXARIAGridRow.cpp | 2 +- .../modules/accessibility/AXImageMapLink.cpp | 6 +- .../modules/accessibility/AXImageMapLink.h | 4 +- .../modules/accessibility/AXInlineTextBox.cpp | 24 +- .../modules/accessibility/AXInlineTextBox.h | 14 +- .../modules/accessibility/AXLayoutObject.cpp | 133 ++++---- .../modules/accessibility/AXLayoutObject.h | 32 +- .../modules/accessibility/AXListBox.cpp | 2 +- .../Source/modules/accessibility/AXListBox.h | 2 +- .../modules/accessibility/AXListBoxOption.cpp | 2 +- .../modules/accessibility/AXMediaControls.cpp | 11 +- .../modules/accessibility/AXMediaControls.h | 8 +- .../modules/accessibility/AXMenuList.cpp | 2 +- .../accessibility/AXMenuListOption.cpp | 6 +- .../modules/accessibility/AXMenuListOption.h | 2 +- .../modules/accessibility/AXMenuListPopup.cpp | 8 +- .../modules/accessibility/AXMenuListPopup.h | 2 +- .../modules/accessibility/AXMockObject.cpp | 2 +- .../modules/accessibility/AXMockObject.h | 8 +- .../modules/accessibility/AXNodeObject.cpp | 166 +++++----- .../modules/accessibility/AXNodeObject.h | 34 +- .../{AXObjectImpl.cpp => AXObject.cpp} | 313 +++++++++--------- .../{AXObjectImpl.h => AXObject.h} | 111 +++---- .../accessibility/AXObjectCacheImpl.cpp | 173 +++++----- .../modules/accessibility/AXObjectCacheImpl.h | 62 ++-- .../modules/accessibility/AXObjectTest.cpp | 22 +- .../modules/accessibility/AXRadioInput.cpp | 9 +- .../modules/accessibility/AXSVGRoot.cpp | 4 +- .../Source/modules/accessibility/AXSVGRoot.h | 4 +- .../Source/modules/accessibility/AXSlider.cpp | 3 +- .../Source/modules/accessibility/AXSlider.h | 2 +- .../modules/accessibility/AXSpinButton.cpp | 6 +- .../modules/accessibility/AXSpinButton.h | 2 +- .../Source/modules/accessibility/AXTable.cpp | 20 +- .../Source/modules/accessibility/AXTable.h | 4 +- .../modules/accessibility/AXTableCell.cpp | 8 +- .../modules/accessibility/AXTableCell.h | 2 +- .../modules/accessibility/AXTableColumn.cpp | 6 +- .../modules/accessibility/AXTableColumn.h | 4 +- .../modules/accessibility/AXTableRow.cpp | 8 +- .../Source/modules/accessibility/AXTableRow.h | 4 +- .../Source/modules/accessibility/BUILD.gn | 4 +- .../InspectorAccessibilityAgent.cpp | 85 +++-- .../InspectorAccessibilityAgent.h | 28 +- .../InspectorTypeBuilderHelper.cpp | 16 +- .../InspectorTypeBuilderHelper.h | 6 +- .../testing/InternalsAccessibility.cpp | 4 +- .../CanvasRenderingContext2DAPITest.cpp | 8 +- ...vasRenderingContext2DUsageTrackingTest.cpp | 2 +- .../WebKit/Source/web/AssertMatchingEnums.cpp | 2 +- .../WebKit/Source/web/ChromeClientImpl.cpp | 4 +- .../WebKit/Source/web/ChromeClientImpl.h | 2 +- .../web/ColorChooserPopupUIController.cpp | 2 +- .../web/ColorChooserPopupUIController.h | 2 +- .../Source/web/ColorChooserUIController.cpp | 2 +- .../Source/web/ColorChooserUIController.h | 2 +- .../WebKit/Source/web/DateTimeChooserImpl.cpp | 2 +- .../WebKit/Source/web/DateTimeChooserImpl.h | 2 +- .../Source/web/ExternalDateTimeChooser.cpp | 2 +- .../Source/web/ExternalDateTimeChooser.h | 2 +- third_party/WebKit/Source/web/TextFinder.cpp | 7 +- third_party/WebKit/Source/web/WebAXObject.cpp | 59 ++-- third_party/WebKit/Source/web/WebDocument.cpp | 2 +- third_party/WebKit/Source/web/WebNode.cpp | 4 +- .../WebKit/Source/web/WebPagePopupImpl.cpp | 6 +- .../WebKit/Source/web/WebPagePopupImpl.h | 2 +- third_party/WebKit/Source/web/WebViewImpl.cpp | 2 +- third_party/WebKit/public/web/WebAXObject.h | 12 +- 95 files changed, 795 insertions(+), 838 deletions(-) rename third_party/WebKit/Source/modules/accessibility/{AXObjectImpl.cpp => AXObject.cpp} (86%) rename third_party/WebKit/Source/modules/accessibility/{AXObjectImpl.h => AXObject.h} (93%) diff --git a/docs/accessibility/overview.md b/docs/accessibility/overview.md index d052cec43b6bc6..c0c57797e44864 100644 --- a/docs/accessibility/overview.md +++ b/docs/accessibility/overview.md @@ -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 [AXObjectImpl], -which is the core class of Blink's accessibility tree. AXObjectImpl is an abstract +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 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 AXObjectImpl tree depending on their +important because some elements are only in the AXObject 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 AXObjectImpl, which are mostly used for testing. +There are also other subclasses of AXObject, 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. @@ -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 -[AXObjectImpl]: https://cs.chromium.org/chromium/src/third_party/WebKit/Source/modules/accessibility/AXObjectImpl.h +[AXObject]: https://cs.chromium.org/chromium/src/third_party/WebKit/Source/modules/accessibility/AXObject.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 diff --git a/third_party/WebKit/LayoutTests/accessibility/corresponding-control-deleted-crash-expected.txt b/third_party/WebKit/LayoutTests/accessibility/corresponding-control-deleted-crash-expected.txt index fc064511717792..3b68714c095923 100644 --- a/third_party/WebKit/LayoutTests/accessibility/corresponding-control-deleted-crash-expected.txt +++ b/third_party/WebKit/LayoutTests/accessibility/corresponding-control-deleted-crash-expected.txt @@ -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 AXObjectImpl 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 AXObject for a node that is being deleted. On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". diff --git a/third_party/WebKit/LayoutTests/accessibility/corresponding-control-deleted-crash.html b/third_party/WebKit/LayoutTests/accessibility/corresponding-control-deleted-crash.html index 53300740aec2b1..b35c787be971ef 100644 --- a/third_party/WebKit/LayoutTests/accessibility/corresponding-control-deleted-crash.html +++ b/third_party/WebKit/LayoutTests/accessibility/corresponding-control-deleted-crash.html @@ -10,7 +10,7 @@
diff --git a/third_party/WebKit/Source/core/dom/AXObjectCache.h b/third_party/WebKit/Source/core/dom/AXObjectCache.h index b9b7a62cfc9059..3456531426ef46 100644 --- a/third_party/WebKit/Source/core/dom/AXObjectCache.h +++ b/third_party/WebKit/Source/core/dom/AXObjectCache.h @@ -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 AXObjectImpl. + // right subclass of AXObject. virtual void UpdateCacheAfterNodeIsAttached(Node*) = 0; virtual void HandleAttributeChanged(const QualifiedName& attr_name, diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp index 4c5698d9b2f75e..ecf025f9b8bbdf 100644 --- a/third_party/WebKit/Source/core/dom/Document.cpp +++ b/third_party/WebKit/Source/core/dom/Document.cpp @@ -4291,8 +4291,8 @@ bool Document::SetFocusedElement(Element* new_focused_element, } if (!focus_change_blocked && focused_element_) { - // Create the AXObjectImpl cache in a focus change because Chromium relies - // on it. + // Create the AXObject cache in a focus change because Chromium relies on + // it. if (AXObjectCache* cache = AxObjectCache()) cache->HandleFocusedUIElementChanged(old_focused_element, new_focused_element); diff --git a/third_party/WebKit/Source/core/frame/FrameView.h b/third_party/WebKit/Source/core/frame/FrameView.h index 066e466fadd389..826d0875039b5a 100644 --- a/third_party/WebKit/Source/core/frame/FrameView.h +++ b/third_party/WebKit/Source/core/frame/FrameView.h @@ -425,7 +425,7 @@ class CORE_EXPORT FrameView final bool IsActive() const override; - // Override scrollbar notifications to update the AXObjectImpl cache. + // Override scrollbar notifications to update the AXObject cache. void DidAddScrollbar(Scrollbar&, ScrollbarOrientation) override; // FIXME: This should probably be renamed as the 'inSubtreeLayout' parameter diff --git a/third_party/WebKit/Source/core/html/HTMLInputElement.cpp b/third_party/WebKit/Source/core/html/HTMLInputElement.cpp index efe430d5208e92..1165419271c1f0 100644 --- a/third_party/WebKit/Source/core/html/HTMLInputElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLInputElement.cpp @@ -1884,7 +1884,7 @@ void HTMLInputElement::DidNotifySubtreeInsertionsToDocument() { ListAttributeTargetChanged(); } -AXObjectImpl* HTMLInputElement::PopupRootAXObject() { +AXObject* HTMLInputElement::PopupRootAXObject() { return input_type_view_->PopupRootAXObject(); } diff --git a/third_party/WebKit/Source/core/html/HTMLInputElement.h b/third_party/WebKit/Source/core/html/HTMLInputElement.h index ae31b68c8575b8..0d29aa42872078 100644 --- a/third_party/WebKit/Source/core/html/HTMLInputElement.h +++ b/third_party/WebKit/Source/core/html/HTMLInputElement.h @@ -33,7 +33,7 @@ namespace blink { -class AXObjectImpl; +class AXObject; class DragData; class ExceptionState; class FileList; @@ -279,7 +279,7 @@ class CORE_EXPORT HTMLInputElement : public TextControlElement { void SetShouldRevealPassword(bool value); bool ShouldRevealPassword() const { return should_reveal_password_; } - AXObjectImpl* PopupRootAXObject(); + AXObject* PopupRootAXObject(); void DidNotifySubtreeInsertionsToDocument() override; virtual void EnsureFallbackContent(); diff --git a/third_party/WebKit/Source/core/html/forms/ColorChooser.h b/third_party/WebKit/Source/core/html/forms/ColorChooser.h index c3054a6ce7ba18..6e289954248d40 100644 --- a/third_party/WebKit/Source/core/html/forms/ColorChooser.h +++ b/third_party/WebKit/Source/core/html/forms/ColorChooser.h @@ -35,7 +35,7 @@ namespace blink { -class AXObjectImpl; +class AXObject; class Color; class CORE_EXPORT ColorChooser : public GarbageCollectedMixin { @@ -46,8 +46,8 @@ class CORE_EXPORT ColorChooser : public GarbageCollectedMixin { virtual void SetSelectedColor(const Color&) {} virtual void EndChooser() {} - // Returns a root AXObjectImpl in the ColorChooser if it's available. - virtual AXObjectImpl* RootAXObject() = 0; + // Returns a root AXObject in the ColorChooser if it's available. + virtual AXObject* RootAXObject() = 0; }; } // namespace blink diff --git a/third_party/WebKit/Source/core/html/forms/ColorInputType.cpp b/third_party/WebKit/Source/core/html/forms/ColorInputType.cpp index 086d84c40bd651..50e53b418cf2d4 100644 --- a/third_party/WebKit/Source/core/html/forms/ColorInputType.cpp +++ b/third_party/WebKit/Source/core/html/forms/ColorInputType.cpp @@ -262,7 +262,7 @@ Vector ColorInputType::Suggestions() const { return suggestions; } -AXObjectImpl* ColorInputType::PopupRootAXObject() { +AXObject* ColorInputType::PopupRootAXObject() { return chooser_ ? chooser_->RootAXObject() : nullptr; } diff --git a/third_party/WebKit/Source/core/html/forms/ColorInputType.h b/third_party/WebKit/Source/core/html/forms/ColorInputType.h index a1633558608717..50ce410307deed 100644 --- a/third_party/WebKit/Source/core/html/forms/ColorInputType.h +++ b/third_party/WebKit/Source/core/html/forms/ColorInputType.h @@ -77,7 +77,7 @@ class ColorInputType final : public InputType, bool TypeMismatchFor(const String&) const override; void WarnIfValueIsInvalid(const String&) const override; void UpdateView() override; - AXObjectImpl* PopupRootAXObject() override; + AXObject* PopupRootAXObject() override; Color ValueAsColor() const; void EndColorChooser(); diff --git a/third_party/WebKit/Source/core/html/forms/DateTimeChooser.h b/third_party/WebKit/Source/core/html/forms/DateTimeChooser.h index 0fff433dc62afc..ed6dbe5cad08a8 100644 --- a/third_party/WebKit/Source/core/html/forms/DateTimeChooser.h +++ b/third_party/WebKit/Source/core/html/forms/DateTimeChooser.h @@ -39,7 +39,7 @@ namespace blink { -class AXObjectImpl; +class AXObject; struct DateTimeSuggestion { DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); @@ -73,8 +73,8 @@ class CORE_EXPORT DateTimeChooser virtual ~DateTimeChooser(); virtual void EndChooser() = 0; - // Returns a root AXObjectImpl in the DateTimeChooser if it's available. - virtual AXObjectImpl* RootAXObject() = 0; + // Returns a root AXObject in the DateTimeChooser if it's available. + virtual AXObject* RootAXObject() = 0; DEFINE_INLINE_VIRTUAL_TRACE() {} }; diff --git a/third_party/WebKit/Source/core/html/forms/InputTypeView.cpp b/third_party/WebKit/Source/core/html/forms/InputTypeView.cpp index da1763b7885aac..feaa3c959fc1ea 100644 --- a/third_party/WebKit/Source/core/html/forms/InputTypeView.cpp +++ b/third_party/WebKit/Source/core/html/forms/InputTypeView.cpp @@ -165,7 +165,7 @@ void InputTypeView::UpdateClearButtonVisibility() {} void InputTypeView::UpdatePlaceholderText() {} -AXObjectImpl* InputTypeView::PopupRootAXObject() { +AXObject* InputTypeView::PopupRootAXObject() { return nullptr; } diff --git a/third_party/WebKit/Source/core/html/forms/InputTypeView.h b/third_party/WebKit/Source/core/html/forms/InputTypeView.h index a3c0132ab47618..a11f1c1001176b 100644 --- a/third_party/WebKit/Source/core/html/forms/InputTypeView.h +++ b/third_party/WebKit/Source/core/html/forms/InputTypeView.h @@ -44,7 +44,7 @@ namespace blink { -class AXObjectImpl; +class AXObject; class BeforeTextInsertedEvent; class Element; class Event; @@ -124,7 +124,7 @@ class CORE_EXPORT InputTypeView : public GarbageCollectedMixin { virtual void ListAttributeTargetChanged(); virtual void UpdateClearButtonVisibility(); virtual void UpdatePlaceholderText(); - virtual AXObjectImpl* PopupRootAXObject(); + virtual AXObject* PopupRootAXObject(); virtual void EnsureFallbackContent() {} virtual void EnsurePrimaryContent() {} virtual bool HasFallbackContent() const { return false; } diff --git a/third_party/WebKit/Source/core/html/forms/MultipleFieldsTemporalInputTypeView.cpp b/third_party/WebKit/Source/core/html/forms/MultipleFieldsTemporalInputTypeView.cpp index 81d810e65c2648..9424aeececfd71 100644 --- a/third_party/WebKit/Source/core/html/forms/MultipleFieldsTemporalInputTypeView.cpp +++ b/third_party/WebKit/Source/core/html/forms/MultipleFieldsTemporalInputTypeView.cpp @@ -635,7 +635,7 @@ TextDirection MultipleFieldsTemporalInputTypeView::ComputedTextDirection() { : TextDirection::kLtr; } -AXObjectImpl* MultipleFieldsTemporalInputTypeView::PopupRootAXObject() { +AXObject* MultipleFieldsTemporalInputTypeView::PopupRootAXObject() { if (PickerIndicatorElement* picker = GetPickerIndicatorElement()) return picker->PopupRootAXObject(); return nullptr; diff --git a/third_party/WebKit/Source/core/html/forms/MultipleFieldsTemporalInputTypeView.h b/third_party/WebKit/Source/core/html/forms/MultipleFieldsTemporalInputTypeView.h index 06aad5ca01e535..28c3110dae2105 100644 --- a/third_party/WebKit/Source/core/html/forms/MultipleFieldsTemporalInputTypeView.h +++ b/third_party/WebKit/Source/core/html/forms/MultipleFieldsTemporalInputTypeView.h @@ -118,7 +118,7 @@ class MultipleFieldsTemporalInputTypeView final void ListAttributeTargetChanged() final; void UpdateClearButtonVisibility() final; TextDirection ComputedTextDirection() final; - AXObjectImpl* PopupRootAXObject() final; + AXObject* PopupRootAXObject() final; DateTimeEditElement* GetDateTimeEditElement() const; SpinButtonElement* GetSpinButtonElement() const; diff --git a/third_party/WebKit/Source/core/html/forms/PickerIndicatorElement.cpp b/third_party/WebKit/Source/core/html/forms/PickerIndicatorElement.cpp index 071229be789506..ea87cf392ae675 100644 --- a/third_party/WebKit/Source/core/html/forms/PickerIndicatorElement.cpp +++ b/third_party/WebKit/Source/core/html/forms/PickerIndicatorElement.cpp @@ -143,7 +143,7 @@ void PickerIndicatorElement::DetachLayoutTree(const AttachContext& context) { HTMLDivElement::DetachLayoutTree(context); } -AXObjectImpl* PickerIndicatorElement::PopupRootAXObject() const { +AXObject* PickerIndicatorElement::PopupRootAXObject() const { return chooser_ ? chooser_->RootAXObject() : 0; } diff --git a/third_party/WebKit/Source/core/html/forms/PickerIndicatorElement.h b/third_party/WebKit/Source/core/html/forms/PickerIndicatorElement.h index 6fe4b4200f149a..1261d5e9a3731f 100644 --- a/third_party/WebKit/Source/core/html/forms/PickerIndicatorElement.h +++ b/third_party/WebKit/Source/core/html/forms/PickerIndicatorElement.h @@ -65,7 +65,7 @@ class PickerIndicatorElement final : public HTMLDivElement, void ClosePopup(); bool WillRespondToMouseClickEvents() override; void RemovePickerIndicatorOwner() { picker_indicator_owner_ = nullptr; } - AXObjectImpl* PopupRootAXObject() const; + AXObject* PopupRootAXObject() const; // DateTimeChooserClient implementation. Element& OwnerElement() const override; diff --git a/third_party/WebKit/Source/core/page/ChromeClient.h b/third_party/WebKit/Source/core/page/ChromeClient.h index 8b07c8622ce214..7117ae9371c0f1 100644 --- a/third_party/WebKit/Source/core/page/ChromeClient.h +++ b/third_party/WebKit/Source/core/page/ChromeClient.h @@ -51,7 +51,7 @@ namespace blink { -class AXObjectImpl; +class AXObject; class ColorChooser; class ColorChooserClient; class CompositorWorkerProxyClient; @@ -287,7 +287,7 @@ class CORE_EXPORT ChromeClient : public PlatformChromeClient { virtual void ClosePagePopup(PagePopup*) = 0; virtual DOMWindow* PagePopupWindowForTesting() const = 0; - virtual void PostAccessibilityNotification(AXObjectImpl*, + virtual void PostAccessibilityNotification(AXObject*, AXObjectCache::AXNotification) {} virtual String AcceptLanguages() = 0; diff --git a/third_party/WebKit/Source/core/page/PagePopup.h b/third_party/WebKit/Source/core/page/PagePopup.h index 1ae1a5b4bf1e56..2a07f514110820 100644 --- a/third_party/WebKit/Source/core/page/PagePopup.h +++ b/third_party/WebKit/Source/core/page/PagePopup.h @@ -38,14 +38,14 @@ namespace blink { -class AXObjectImpl; +class AXObject; class IntRect; // A PagePopup object is created by ChromeClient::openPagePopup(), and deleted // by ChromeClient::closePagePopup(). class PagePopup { public: - virtual AXObjectImpl* RootAXObject() = 0; + virtual AXObject* RootAXObject() = 0; virtual void SetWindowRect(const IntRect&) = 0; virtual void PostMessage(const String& message) = 0; diff --git a/third_party/WebKit/Source/modules/accessibility/AXARIAGrid.cpp b/third_party/WebKit/Source/modules/accessibility/AXARIAGrid.cpp index b0f9208bb4569d..4bb9d3daff3cf1 100644 --- a/third_party/WebKit/Source/modules/accessibility/AXARIAGrid.cpp +++ b/third_party/WebKit/Source/modules/accessibility/AXARIAGrid.cpp @@ -45,10 +45,9 @@ AXARIAGrid* AXARIAGrid::Create(LayoutObject* layout_object, return new AXARIAGrid(layout_object, ax_object_cache); } -bool AXARIAGrid::AddTableRowChild( - AXObjectImpl* child, - HeapHashSet>& appended_rows, - unsigned& column_count) { +bool AXARIAGrid::AddTableRowChild(AXObject* child, + HeapHashSet>& appended_rows, + unsigned& column_count) { if (!child || child->RoleValue() != kRowRole) return false; @@ -90,8 +89,8 @@ void AXARIAGrid::AddChildren() { if (!layout_object_) return; - HeapVector> children; - for (AXObjectImpl* child = RawFirstChild(); child; + HeapVector> children; + for (AXObject* child = RawFirstChild(); child; child = child->RawNextSibling()) children.push_back(child); ComputeAriaOwnsChildren(children); @@ -99,7 +98,7 @@ void AXARIAGrid::AddChildren() { AXObjectCacheImpl& ax_cache = AxObjectCache(); // Only add children that are actually rows. - HeapHashSet> appended_rows; + HeapHashSet> appended_rows; unsigned column_count = 0; for (const auto& child : children) { if (!AddTableRowChild(child, appended_rows, column_count)) { @@ -126,7 +125,7 @@ void AXARIAGrid::AddChildren() { children_.push_back(column); } - AXObjectImpl* header_container_object = HeaderContainer(); + AXObject* header_container_object = HeaderContainer(); if (header_container_object && !header_container_object->AccessibilityIsIgnored()) children_.push_back(header_container_object); diff --git a/third_party/WebKit/Source/modules/accessibility/AXARIAGrid.h b/third_party/WebKit/Source/modules/accessibility/AXARIAGrid.h index 523abbfe00bd16..f21c07cc162ac5 100644 --- a/third_party/WebKit/Source/modules/accessibility/AXARIAGrid.h +++ b/third_party/WebKit/Source/modules/accessibility/AXARIAGrid.h @@ -60,8 +60,8 @@ class AXARIAGrid final : public AXTable { bool IsMultiSelectable() const override { return true; } bool IsTableExposableThroughAccessibility() const override { return true; } - bool AddTableRowChild(AXObjectImpl*, - HeapHashSet>& appended_rows, + bool AddTableRowChild(AXObject*, + HeapHashSet>& appended_rows, unsigned& column_count); }; diff --git a/third_party/WebKit/Source/modules/accessibility/AXARIAGridCell.cpp b/third_party/WebKit/Source/modules/accessibility/AXARIAGridCell.cpp index 2a37099382793a..21fe2a9458da93 100644 --- a/third_party/WebKit/Source/modules/accessibility/AXARIAGridCell.cpp +++ b/third_party/WebKit/Source/modules/accessibility/AXARIAGridCell.cpp @@ -55,8 +55,8 @@ bool AXARIAGridCell::IsAriaRowHeader() const { return EqualIgnoringASCIICase(role, "rowheader"); } -AXObjectImpl* AXARIAGridCell::ParentTable() const { - AXObjectImpl* parent = ParentObjectUnignored(); +AXObject* AXARIAGridCell::ParentTable() const { + AXObject* parent = ParentObjectUnignored(); if (!parent) return 0; @@ -74,7 +74,7 @@ AXObjectImpl* AXARIAGridCell::ParentTable() const { } void AXARIAGridCell::RowIndexRange(std::pair& row_range) { - AXObjectImpl* parent = ParentObjectUnignored(); + AXObject* parent = ParentObjectUnignored(); if (!parent) return; @@ -104,7 +104,7 @@ void AXARIAGridCell::RowIndexRange(std::pair& row_range) { void AXARIAGridCell::ColumnIndexRange( std::pair& column_range) { - AXObjectImpl* parent = ParentObjectUnignored(); + AXObject* parent = ParentObjectUnignored(); if (!parent) return; diff --git a/third_party/WebKit/Source/modules/accessibility/AXARIAGridCell.h b/third_party/WebKit/Source/modules/accessibility/AXARIAGridCell.h index c1214a508614b3..71eff9860ac6f4 100644 --- a/third_party/WebKit/Source/modules/accessibility/AXARIAGridCell.h +++ b/third_party/WebKit/Source/modules/accessibility/AXARIAGridCell.h @@ -54,7 +54,7 @@ class AXARIAGridCell final : public AXTableCell { protected: bool IsAriaColumnHeader() const; bool IsAriaRowHeader() const; - AXObjectImpl* ParentTable() const override; + AXObject* ParentTable() const override; }; } // namespace blink diff --git a/third_party/WebKit/Source/modules/accessibility/AXARIAGridRow.cpp b/third_party/WebKit/Source/modules/accessibility/AXARIAGridRow.cpp index 75b59061c0613a..092adf80c44d66 100644 --- a/third_party/WebKit/Source/modules/accessibility/AXARIAGridRow.cpp +++ b/third_party/WebKit/Source/modules/accessibility/AXARIAGridRow.cpp @@ -45,7 +45,7 @@ AXARIAGridRow* AXARIAGridRow::Create(LayoutObject* layout_object, } bool AXARIAGridRow::IsARIATreeGridRow() const { - AXObjectImpl* parent = ParentTable(); + AXObject* parent = ParentTable(); if (!parent) return false; diff --git a/third_party/WebKit/Source/modules/accessibility/AXImageMapLink.cpp b/third_party/WebKit/Source/modules/accessibility/AXImageMapLink.cpp index fcfa4ab73e95cc..b8bca55ac86555 100644 --- a/third_party/WebKit/Source/modules/accessibility/AXImageMapLink.cpp +++ b/third_party/WebKit/Source/modules/accessibility/AXImageMapLink.cpp @@ -57,7 +57,7 @@ HTMLMapElement* AXImageMapLink::MapElement() const { return Traversal::FirstAncestor(*area); } -AXObjectImpl* AXImageMapLink::ComputeParent() const { +AXObject* AXImageMapLink::ComputeParent() const { DCHECK(!IsDetached()); if (parent_) return parent_; @@ -72,7 +72,7 @@ AccessibilityRole AXImageMapLink::RoleValue() const { const AtomicString& aria_role = GetAOMPropertyOrARIAAttribute(AOMStringProperty::kRole); if (!aria_role.IsEmpty()) - return AXObjectImpl::AriaRoleToWebCoreRole(aria_role); + return AXObject::AriaRoleToWebCoreRole(aria_role); return kLinkRole; } @@ -98,7 +98,7 @@ KURL AXImageMapLink::Url() const { } void AXImageMapLink::GetRelativeBounds( - AXObjectImpl** out_container, + AXObject** out_container, FloatRect& out_bounds_in_container, SkMatrix44& out_container_transform) const { *out_container = nullptr; diff --git a/third_party/WebKit/Source/modules/accessibility/AXImageMapLink.h b/third_party/WebKit/Source/modules/accessibility/AXImageMapLink.h index cf7b9dfaf24d7f..a52ba7071f605e 100644 --- a/third_party/WebKit/Source/modules/accessibility/AXImageMapLink.h +++ b/third_party/WebKit/Source/modules/accessibility/AXImageMapLink.h @@ -61,8 +61,8 @@ class AXImageMapLink final : public AXNodeObject { KURL Url() const override; bool IsLink() const override { return true; } bool IsLinked() const override { return true; } - AXObjectImpl* ComputeParent() const override; - void GetRelativeBounds(AXObjectImpl** out_container, + AXObject* ComputeParent() const override; + void GetRelativeBounds(AXObject** out_container, FloatRect& out_bounds_in_container, SkMatrix44& out_container_transform) const override; diff --git a/third_party/WebKit/Source/modules/accessibility/AXInlineTextBox.cpp b/third_party/WebKit/Source/modules/accessibility/AXInlineTextBox.cpp index 305dfbc8c7b761..068a1d7b27b3a6 100644 --- a/third_party/WebKit/Source/modules/accessibility/AXInlineTextBox.cpp +++ b/third_party/WebKit/Source/modules/accessibility/AXInlineTextBox.cpp @@ -41,8 +41,7 @@ using namespace HTMLNames; AXInlineTextBox::AXInlineTextBox( PassRefPtr inline_text_box, AXObjectCacheImpl& ax_object_cache) - : AXObjectImpl(ax_object_cache), - inline_text_box_(std::move(inline_text_box)) {} + : AXObject(ax_object_cache), inline_text_box_(std::move(inline_text_box)) {} AXInlineTextBox* AXInlineTextBox::Create( PassRefPtr inline_text_box, @@ -53,12 +52,12 @@ AXInlineTextBox* AXInlineTextBox::Create( void AXInlineTextBox::Init() {} void AXInlineTextBox::Detach() { - AXObjectImpl::Detach(); + AXObject::Detach(); inline_text_box_ = nullptr; } void AXInlineTextBox::GetRelativeBounds( - AXObjectImpl** out_container, + AXObject** out_container, FloatRect& out_bounds_in_container, SkMatrix44& out_container_transform) const { *out_container = nullptr; @@ -82,7 +81,7 @@ void AXInlineTextBox::GetRelativeBounds( bool AXInlineTextBox::ComputeAccessibilityIsIgnored( IgnoredReasons* ignored_reasons) const { - AXObjectImpl* parent = ParentObject(); + AXObject* parent = ParentObject(); if (!parent) return false; @@ -124,9 +123,8 @@ void AXInlineTextBox::GetWordBoundaries(Vector& words) const { AXRange(word_boundaries[i].start_index, word_boundaries[i].end_index); } -String AXInlineTextBox::GetName( - AXNameFrom& name_from, - AXObjectImpl::AXObjectVector* name_objects) const { +String AXInlineTextBox::GetName(AXNameFrom& name_from, + AXObject::AXObjectVector* name_objects) const { if (!inline_text_box_) return String(); @@ -134,7 +132,7 @@ String AXInlineTextBox::GetName( return inline_text_box_->GetText(); } -AXObjectImpl* AXInlineTextBox::ComputeParent() const { +AXObject* AXInlineTextBox::ComputeParent() const { DCHECK(!IsDetached()); if (!inline_text_box_ || !ax_object_cache_) return 0; @@ -148,7 +146,7 @@ AXObjectImpl* AXInlineTextBox::ComputeParent() const { // top to bottom and bottom to top via the CSS writing-mode property. AccessibilityTextDirection AXInlineTextBox::GetTextDirection() const { if (!inline_text_box_) - return AXObjectImpl::GetTextDirection(); + return AXObject::GetTextDirection(); switch (inline_text_box_->GetDirection()) { case AbstractInlineTextBox::kLeftToRight: @@ -161,10 +159,10 @@ AccessibilityTextDirection AXInlineTextBox::GetTextDirection() const { return kAccessibilityTextDirectionBTT; } - return AXObjectImpl::GetTextDirection(); + return AXObject::GetTextDirection(); } -AXObjectImpl* AXInlineTextBox::NextOnLine() const { +AXObject* AXInlineTextBox::NextOnLine() const { RefPtr next_on_line = inline_text_box_->NextOnLine(); if (next_on_line) return ax_object_cache_->GetOrCreate(next_on_line.Get()); @@ -175,7 +173,7 @@ AXObjectImpl* AXInlineTextBox::NextOnLine() const { return ParentObject()->NextOnLine(); } -AXObjectImpl* AXInlineTextBox::PreviousOnLine() const { +AXObject* AXInlineTextBox::PreviousOnLine() const { RefPtr previous_on_line = inline_text_box_->PreviousOnLine(); if (previous_on_line) diff --git a/third_party/WebKit/Source/modules/accessibility/AXInlineTextBox.h b/third_party/WebKit/Source/modules/accessibility/AXInlineTextBox.h index ca75ce53764b19..923cbcf2640518 100644 --- a/third_party/WebKit/Source/modules/accessibility/AXInlineTextBox.h +++ b/third_party/WebKit/Source/modules/accessibility/AXInlineTextBox.h @@ -30,14 +30,14 @@ #define AXInlineTextBox_h #include "core/layout/line/AbstractInlineTextBox.h" -#include "modules/accessibility/AXObjectImpl.h" +#include "modules/accessibility/AXObject.h" namespace blink { class Node; class AXObjectCacheImpl; -class AXInlineTextBox final : public AXObjectImpl { +class AXInlineTextBox final : public AXObject { WTF_MAKE_NONCOPYABLE(AXInlineTextBox); private: @@ -56,17 +56,17 @@ class AXInlineTextBox final : public AXObjectImpl { public: AccessibilityRole RoleValue() const override { return kInlineTextBoxRole; } String GetName(AXNameFrom&, - AXObjectImpl::AXObjectVector* name_objects) const override; + AXObject::AXObjectVector* name_objects) const override; void TextCharacterOffsets(Vector&) const override; void GetWordBoundaries(Vector&) const override; - void GetRelativeBounds(AXObjectImpl** out_container, + void GetRelativeBounds(AXObject** out_container, FloatRect& out_bounds_in_container, SkMatrix44& out_container_transform) const override; - AXObjectImpl* ComputeParent() const override; + AXObject* ComputeParent() const override; AccessibilityTextDirection GetTextDirection() const override; Node* GetNode() const override { return inline_text_box_->GetNode(); } - AXObjectImpl* NextOnLine() const override; - AXObjectImpl* PreviousOnLine() const override; + AXObject* NextOnLine() const override; + AXObject* PreviousOnLine() const override; private: RefPtr inline_text_box_; diff --git a/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp b/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp index ac570e60d31949..2e73fd5e2def1b 100644 --- a/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp +++ b/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp @@ -327,7 +327,7 @@ void AXLayoutObject::Detach() { // Check object role or purpose. // -static bool IsLinkable(const AXObjectImpl& object) { +static bool IsLinkable(const AXObject& object) { if (!object.GetLayoutObject()) return false; @@ -350,7 +350,7 @@ bool AXLayoutObject::IsEditable() const { Document& document = GetLayoutObject()->GetDocument(); HTMLElement* body = document.body(); if (body && HasEditableStyle(*body)) { - AXObjectImpl* ax_body = AxObjectCache().GetOrCreate(body); + AXObject* ax_body = AxObjectCache().GetOrCreate(body); return ax_body && ax_body != ax_body->AriaHiddenRoot(); } @@ -370,7 +370,7 @@ bool AXLayoutObject::IsRichlyEditable() const { Document& document = layout_object_->GetDocument(); HTMLElement* body = document.body(); if (body && HasRichlyEditableStyle(*body)) { - AXObjectImpl* ax_body = AxObjectCache().GetOrCreate(body); + AXObject* ax_body = AxObjectCache().GetOrCreate(body); return ax_body && ax_body != ax_body->AriaHiddenRoot(); } @@ -412,7 +412,7 @@ bool AXLayoutObject::IsReadOnly() const { Document& document = layout_object_->GetDocument(); HTMLElement* body = document.body(); if (body && HasEditableStyle(*body)) { - AXObjectImpl* ax_body = AxObjectCache().GetOrCreate(body); + AXObject* ax_body = AxObjectCache().GetOrCreate(body); return !ax_body || ax_body == ax_body->AriaHiddenRoot(); } @@ -441,7 +441,7 @@ bool AXLayoutObject::IsFocused() const { Element* focused_element = GetDocument()->FocusedElement(); if (!focused_element) return false; - AXObjectImpl* focused_object = AxObjectCache().GetOrCreate(focused_element); + AXObject* focused_object = AxObjectCache().GetOrCreate(focused_element); if (!focused_object || !focused_object->IsAXLayoutObject()) return false; @@ -463,7 +463,7 @@ bool AXLayoutObject::IsSelected() const { if (EqualIgnoringASCIICase(aria_selected, "true")) return true; - AXObjectImpl* focused_object = AxObjectCache().FocusedObject(); + AXObject* focused_object = AxObjectCache().FocusedObject(); if (AriaRoleAttribute() == kListBoxOptionRole && focused_object && focused_object->ActiveDescendant() == this) { return true; @@ -501,7 +501,7 @@ AXObjectInclusion AXLayoutObject::DefaultObjectInclusion( return kIgnoreObject; } - return AXObjectImpl::DefaultObjectInclusion(ignored_reasons); + return AXObject::DefaultObjectInclusion(ignored_reasons); } bool AXLayoutObject::ComputeAccessibilityIsIgnored( @@ -542,7 +542,7 @@ bool AXLayoutObject::ComputeAccessibilityIsIgnored( if (HasInheritedPresentationalRole()) { if (ignored_reasons) { - const AXObjectImpl* inherits_from = InheritsPresentationalRoleFrom(); + const AXObject* inherits_from = InheritsPresentationalRoleFrom(); if (inherits_from == this) ignored_reasons->push_back(IgnoredReason(kAXPresentationalRole)); else @@ -553,7 +553,7 @@ bool AXLayoutObject::ComputeAccessibilityIsIgnored( } // An ARIA tree can only have tree items and static text as children. - if (AXObjectImpl* tree_ancestor = TreeAncestorDisallowingChild()) { + if (AXObject* tree_ancestor = TreeAncestorDisallowingChild()) { if (ignored_reasons) ignored_reasons->push_back( IgnoredReason(kAXAncestorDisallowsChild, tree_ancestor)); @@ -572,13 +572,13 @@ bool AXLayoutObject::ComputeAccessibilityIsIgnored( // Find out if this element is inside of a label element. If so, it may be // ignored because it's the label for a checkbox or radio button. - AXObjectImpl* control_object = CorrespondingControlForLabelElement(); + AXObject* control_object = CorrespondingControlForLabelElement(); if (control_object && control_object->IsCheckboxOrRadio() && control_object->NameFromLabelElement()) { if (ignored_reasons) { HTMLLabelElement* label = LabelElementContainer(); if (label && label != GetNode()) { - AXObjectImpl* label_ax_object = AxObjectCache().GetOrCreate(label); + AXObject* label_ax_object = AxObjectCache().GetOrCreate(label); ignored_reasons->push_back( IgnoredReason(kAXLabelContainer, label_ax_object)); } @@ -600,7 +600,7 @@ bool AXLayoutObject::ComputeAccessibilityIsIgnored( if (layout_object_->IsText()) { // Static text beneath MenuItems and MenuButtons are just reported along // with the menu item, so it's ignored on an individual level. - AXObjectImpl* parent = ParentObjectUnignored(); + AXObject* parent = ParentObjectUnignored(); if (parent && (parent->AriaRoleAttribute() == kMenuItemRole || parent->AriaRoleAttribute() == kMenuButtonRole)) { if (ignored_reasons) @@ -616,7 +616,7 @@ bool AXLayoutObject::ComputeAccessibilityIsIgnored( } // Don't ignore static text in editable text controls. - for (AXObjectImpl* parent = ParentObject(); parent; + for (AXObject* parent = ParentObject(); parent; parent = parent->ParentObject()) { if (parent->RoleValue() == kTextFieldRole) return false; @@ -809,7 +809,7 @@ RGBA32 AXLayoutObject::ComputeBackgroundColor() const { // Color::blend should be called like this: background.blend(foreground). for (LayoutObject* layout_object = GetLayoutObject(); layout_object; layout_object = layout_object->Parent()) { - const AXObjectImpl* ax_parent = AxObjectCache().GetOrCreate(layout_object); + const AXObject* ax_parent = AxObjectCache().GetOrCreate(layout_object); if (ax_parent && ax_parent != this) { Color parent_color = ax_parent->BackgroundColor(); blended_color = parent_color.Blend(blended_color); @@ -1080,13 +1080,13 @@ void AXLayoutObject::LoadInlineTextBoxes() { } } -AXObjectImpl* AXLayoutObject::NextOnLine() const { +AXObject* AXLayoutObject::NextOnLine() const { if (!GetLayoutObject()) return nullptr; - AXObjectImpl* result = nullptr; + AXObject* result = nullptr; if (GetLayoutObject()->IsListMarker()) { - AXObjectImpl* next_sibling = RawNextSibling(); + AXObject* next_sibling = RawNextSibling(); if (!next_sibling || !next_sibling->Children().size()) return nullptr; result = next_sibling->Children()[0].Get(); @@ -1119,7 +1119,7 @@ AXObjectImpl* AXLayoutObject::NextOnLine() const { return result; } -AXObjectImpl* AXLayoutObject::PreviousOnLine() const { +AXObject* AXLayoutObject::PreviousOnLine() const { if (!GetLayoutObject()) return nullptr; @@ -1132,7 +1132,7 @@ AXObjectImpl* AXLayoutObject::PreviousOnLine() const { if (!inline_box) return nullptr; - AXObjectImpl* result = nullptr; + AXObject* result = nullptr; for (InlineBox* prev = inline_box->PrevOnLine(); prev; prev = prev->PrevOnLine()) { LayoutObject* layout_object = @@ -1291,10 +1291,9 @@ bool AXLayoutObject::AriaRoleHasPresentationalChildren() const { } } -AXObjectImpl* AXLayoutObject::AncestorForWhichThisIsAPresentationalChild() - const { +AXObject* AXLayoutObject::AncestorForWhichThisIsAPresentationalChild() const { // Walk the parent chain looking for a parent that has presentational children - AXObjectImpl* parent = ParentObjectIfExists(); + AXObject* parent = ParentObjectIfExists(); while (parent) { if (parent->AriaRoleHasPresentationalChildren()) break; @@ -1398,8 +1397,7 @@ bool AXLayoutObject::LiveRegionBusy() const { // Hit testing. // -AXObjectImpl* AXLayoutObject::AccessibilityHitTest( - const IntPoint& point) const { +AXObject* AXLayoutObject::AccessibilityHitTest(const IntPoint& point) const { if (!layout_object_ || !layout_object_->HasLayer()) return nullptr; @@ -1426,7 +1424,7 @@ AXObjectImpl* AXLayoutObject::AccessibilityHitTest( if (!obj) return nullptr; - AXObjectImpl* result = AxObjectCache().GetOrCreate(obj); + AXObject* result = AxObjectCache().GetOrCreate(obj); result->UpdateChildrenIfNecessary(); // Allow the element to perform any hit-testing it might need to do to reach @@ -1436,7 +1434,7 @@ AXObjectImpl* AXLayoutObject::AccessibilityHitTest( // If this element is the label of a control, a hit test should return the // control. if (result->IsAXLayoutObject()) { - AXObjectImpl* control_object = + AXObject* control_object = ToAXLayoutObject(result)->CorrespondingControlForLabelElement(); if (control_object && control_object->NameFromLabelElement()) return control_object; @@ -1448,19 +1446,19 @@ AXObjectImpl* AXLayoutObject::AccessibilityHitTest( return result; } -AXObjectImpl* AXLayoutObject::ElementAccessibilityHitTest( +AXObject* AXLayoutObject::ElementAccessibilityHitTest( const IntPoint& point) const { if (IsSVGImage()) return RemoteSVGElementHitTest(point); - return AXObjectImpl::ElementAccessibilityHitTest(point); + return AXObject::ElementAccessibilityHitTest(point); } // // High-level accessibility tree access. // -AXObjectImpl* AXLayoutObject::ComputeParent() const { +AXObject* AXLayoutObject::ComputeParent() const { DCHECK(!IsDetached()); if (!layout_object_) return 0; @@ -1471,7 +1469,7 @@ AXObjectImpl* AXLayoutObject::ComputeParent() const { // menuButton and its corresponding menu are DOM siblings, but Accessibility // needs them to be parent/child. if (AriaRoleAttribute() == kMenuRole) { - AXObjectImpl* parent = MenuButtonForMenu(); + AXObject* parent = MenuButtonForMenu(); if (parent) return parent; } @@ -1489,7 +1487,7 @@ AXObjectImpl* AXLayoutObject::ComputeParent() const { return 0; } -AXObjectImpl* AXLayoutObject::ComputeParentIfExists() const { +AXObject* AXLayoutObject::ComputeParentIfExists() const { if (!layout_object_) return 0; @@ -1499,7 +1497,7 @@ AXObjectImpl* AXLayoutObject::ComputeParentIfExists() const { // menuButton and its corresponding menu are DOM siblings, but Accessibility // needs them to be parent/child. if (AriaRoleAttribute() == kMenuRole) { - AXObjectImpl* parent = MenuButtonForMenu(); + AXObject* parent = MenuButtonForMenu(); if (parent) return parent; } @@ -1522,7 +1520,7 @@ AXObjectImpl* AXLayoutObject::ComputeParentIfExists() const { // accessibility module. // -AXObjectImpl* AXLayoutObject::RawFirstChild() const { +AXObject* AXLayoutObject::RawFirstChild() const { if (!layout_object_) return 0; @@ -1534,7 +1532,7 @@ AXObjectImpl* AXLayoutObject::RawFirstChild() const { return AxObjectCache().GetOrCreate(first_child); } -AXObjectImpl* AXLayoutObject::RawNextSibling() const { +AXObject* AXLayoutObject::RawNextSibling() const { if (!layout_object_) return 0; @@ -1602,10 +1600,10 @@ void AXLayoutObject::AddChildren() { if (!CanHaveChildren()) return; - HeapVector> owned_children; + HeapVector> owned_children; ComputeAriaOwnsChildren(owned_children); - for (AXObjectImpl* obj = RawFirstChild(); obj; obj = obj->RawNextSibling()) { + for (AXObject* obj = RawFirstChild(); obj; obj = obj->RawNextSibling()) { if (!AxObjectCache().IsAriaOwned(obj)) { obj->SetParent(this); AddChild(obj); @@ -1640,11 +1638,11 @@ void AXLayoutObject::UpdateChildrenIfNecessary() { if (NeedsToUpdateChildren()) ClearChildren(); - AXObjectImpl::UpdateChildrenIfNecessary(); + AXObject::UpdateChildrenIfNecessary(); } void AXLayoutObject::ClearChildren() { - AXObjectImpl::ClearChildren(); + AXObject::ClearChildren(); children_dirty_ = false; } @@ -1731,7 +1729,7 @@ Element* AXLayoutObject::AnchorElement() const { // Functions that retrieve the current selection. // -AXObjectImpl::AXRange AXLayoutObject::Selection() const { +AXObject::AXRange AXLayoutObject::Selection() const { AXRange text_selection = TextControlSelection(); if (text_selection.IsValid()) return text_selection; @@ -1758,7 +1756,7 @@ AXObjectImpl::AXRange AXLayoutObject::Selection() const { DCHECK(anchor_node); AXLayoutObject* anchor_object = nullptr; - // Find the closest node that has a corresponding AXObjectImpl. + // Find the closest node that has a corresponding AXObject. // This is because some nodes may be aria hidden or might not even have // a layout object if they are part of the shadow DOM. while (anchor_node) { @@ -1801,7 +1799,7 @@ AXObjectImpl::AXRange AXLayoutObject::Selection() const { // Gets only the start and end offsets of the selection computed using the // current object as the starting point. Returns a null selection if there is // no selection in the subtree rooted at this object. -AXObjectImpl::AXRange AXLayoutObject::SelectionUnderObject() const { +AXObject::AXRange AXLayoutObject::SelectionUnderObject() const { AXRange text_selection = TextControlSelection(); if (text_selection.IsValid()) return text_selection; @@ -1835,7 +1833,7 @@ AXObjectImpl::AXRange AXLayoutObject::SelectionUnderObject() const { return AXRange(start, end); } -AXObjectImpl::AXRange AXLayoutObject::TextControlSelection() const { +AXObject::AXRange AXLayoutObject::TextControlSelection() const { if (!GetLayoutObject()) return AXRange(); @@ -1852,7 +1850,7 @@ AXObjectImpl::AXRange AXLayoutObject::TextControlSelection() const { if (!layout) return AXRange(); - AXObjectImpl* ax_object = AxObjectCache().GetOrCreate(layout); + AXObject* ax_object = AxObjectCache().GetOrCreate(layout); if (!ax_object || !ax_object->IsAXLayoutObject()) return AXRange(); @@ -1897,7 +1895,7 @@ AXLayoutObject* AXLayoutObject::GetUnignoredObjectFromNode(Node& node) const { if (IsDetached()) return nullptr; - AXObjectImpl* ax_object = AxObjectCache().GetOrCreate(&node); + AXObject* ax_object = AxObjectCache().GetOrCreate(&node); if (!ax_object) return nullptr; @@ -1912,7 +1910,7 @@ AXLayoutObject* AXLayoutObject::GetUnignoredObjectFromNode(Node& node) const { // // Convert from an accessible object and offset to a VisiblePosition. -static VisiblePosition ToVisiblePosition(AXObjectImpl* obj, int offset) { +static VisiblePosition ToVisiblePosition(AXObject* obj, int offset) { if (!obj->GetNode()) return VisiblePosition(); @@ -1938,7 +1936,7 @@ static VisiblePosition ToVisiblePosition(AXObjectImpl* obj, int offset) { static_cast(offset) > (obj->Children().size() - 1) ? offset - 1 : offset; - AXObjectImpl* child_obj = obj->Children()[clamped_offset]; + AXObject* child_obj = obj->Children()[clamped_offset]; Node* child_node = child_obj->GetNode(); if (!child_node || !child_node->parentNode()) return VisiblePosition(); @@ -1971,9 +1969,9 @@ void AXLayoutObject::SetSelection(const AXRange& selection) { if (!GetLayoutObject() || !selection.IsValid()) return; - AXObjectImpl* anchor_object = + AXObject* anchor_object = selection.anchor_object ? selection.anchor_object.Get() : this; - AXObjectImpl* focus_object = + AXObject* focus_object = selection.focus_object ? selection.focus_object.Get() : this; if (!IsValidSelectionBound(anchor_object) || @@ -2025,8 +2023,7 @@ void AXLayoutObject::SetSelection(const AXRange& selection) { .Build()); } -bool AXLayoutObject::IsValidSelectionBound( - const AXObjectImpl* bound_object) const { +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() == @@ -2057,7 +2054,7 @@ void AXLayoutObject::HandleActiveDescendantChanged() { if (!GetLayoutObject()) return; - AXObjectImpl* focused_object = AxObjectCache().FocusedObject(); + AXObject* focused_object = AxObjectCache().FocusedObject(); if (focused_object == this && SupportsActiveDescendant()) { AxObjectCache().PostNotification( GetLayoutObject(), AXObjectCacheImpl::kAXActiveDescendantChanged); @@ -2066,7 +2063,7 @@ void AXLayoutObject::HandleActiveDescendantChanged() { void AXLayoutObject::HandleAriaExpandedChanged() { // Find if a parent of this object should handle aria-expanded changes. - AXObjectImpl* container_parent = this->ParentObject(); + AXObject* container_parent = this->ParentObject(); while (container_parent) { bool found_parent = false; @@ -2186,7 +2183,7 @@ void AXLayoutObject::AddInlineTextBoxChildren(bool force) { for (RefPtr box = layout_text->FirstAbstractInlineTextBox(); box.Get(); box = box->NextInlineTextBox()) { - AXObjectImpl* ax_object = AxObjectCache().GetOrCreate(box.Get()); + AXObject* ax_object = AxObjectCache().GetOrCreate(box.Get()); if (!ax_object->AccessibilityIsIgnored()) children_.push_back(ax_object); } @@ -2219,11 +2216,11 @@ void AXLayoutObject::LineBreaks(Vector& line_breaks) const { // Private. // -AXObjectImpl* AXLayoutObject::TreeAncestorDisallowingChild() const { +AXObject* AXLayoutObject::TreeAncestorDisallowingChild() const { // Determine if this is in a tree. If so, we apply special behavior to make it // work like an AXOutline. - AXObjectImpl* ax_obj = ParentObject(); - AXObjectImpl* tree_ancestor = 0; + AXObject* ax_obj = ParentObject(); + AXObject* tree_ancestor = 0; while (ax_obj) { if (ax_obj->IsTree()) { tree_ancestor = ax_obj; @@ -2253,7 +2250,7 @@ bool AXLayoutObject::IsTabItemSelected() const { // The ARIA spec says a tab item can also be selected if it is aria-labeled by // a tabpanel that has keyboard focus inside of it, or if a tabpanel in its // aria-controls list has KB focus inside of it. - AXObjectImpl* focused_element = AxObjectCache().FocusedObject(); + AXObject* focused_element = AxObjectCache().FocusedObject(); if (!focused_element) return false; @@ -2261,13 +2258,13 @@ bool AXLayoutObject::IsTabItemSelected() const { ElementsFromAttribute(elements, aria_controlsAttr); for (const auto& element : elements) { - AXObjectImpl* tab_panel = AxObjectCache().GetOrCreate(element); + AXObject* tab_panel = AxObjectCache().GetOrCreate(element); // A tab item should only control tab panels. if (!tab_panel || tab_panel->RoleValue() != kTabPanelRole) continue; - AXObjectImpl* check_focus_element = focused_element; + AXObject* check_focus_element = focused_element; // Check if the focused element is a descendant of the element controlled by // the tab item. while (check_focus_element) { @@ -2280,13 +2277,13 @@ bool AXLayoutObject::IsTabItemSelected() const { return false; } -AXObjectImpl* AXLayoutObject::AccessibilityImageMapHitTest( +AXObject* AXLayoutObject::AccessibilityImageMapHitTest( HTMLAreaElement* area, const IntPoint& point) const { if (!area) return 0; - AXObjectImpl* parent = AxObjectCache().GetOrCreate(area->ImageElement()); + AXObject* parent = AxObjectCache().GetOrCreate(area->ImageElement()); if (!parent) return 0; @@ -2364,9 +2361,8 @@ AXSVGRoot* AXLayoutObject::RemoteSVGRootElement() const { return 0; } -AXObjectImpl* AXLayoutObject::RemoteSVGElementHitTest( - const IntPoint& point) const { - AXObjectImpl* remote = RemoteSVGRootElement(); +AXObject* AXLayoutObject::RemoteSVGElementHitTest(const IntPoint& point) const { + AXObject* remote = RemoteSVGRootElement(); if (!remote) return 0; @@ -2380,7 +2376,7 @@ AXObjectImpl* AXLayoutObject::RemoteSVGElementHitTest( // coordinates only. void AXLayoutObject::OffsetBoundingBoxForRemoteSVGElement( LayoutRect& rect) const { - for (AXObjectImpl* parent = ParentObject(); parent; + for (AXObject* parent = ParentObject(); parent; parent = parent->ParentObject()) { if (parent->IsAXSVGRoot()) { rect.MoveBy( @@ -2419,7 +2415,7 @@ void AXLayoutObject::AddHiddenChildren() { for (Node& child : NodeTraversal::ChildrenOf(*node)) { if (child.GetLayoutObject()) { // Find out where the last layout sibling is located within m_children. - if (AXObjectImpl* child_object = + if (AXObject* child_object = AxObjectCache().Get(child.GetLayoutObject())) { if (child_object->AccessibilityIsIgnored()) { const auto& children = child_object->Children(); @@ -2474,7 +2470,7 @@ void AXLayoutObject::AddImageMapChildren() { for (HTMLAreaElement& area : Traversal::DescendantsOf(*map)) { // add an element for this child if it has a link - AXObjectImpl* obj = AxObjectCache().GetOrCreate(&area); + AXObject* obj = AxObjectCache().GetOrCreate(&area); if (obj) { AXImageMapLink* area_object = ToAXImageMapLink(obj); area_object->SetParent(this); @@ -2502,8 +2498,7 @@ void AXLayoutObject::AddCanvasChildren() { void AXLayoutObject::AddPopupChildren() { if (!isHTMLInputElement(GetNode())) return; - if (AXObjectImpl* ax_popup = - toHTMLInputElement(GetNode())->PopupRootAXObject()) + if (AXObject* ax_popup = toHTMLInputElement(GetNode())->PopupRootAXObject()) children_.push_back(ax_popup); } diff --git a/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.h b/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.h index 817a9769fb7b85..66a5f3e413872a 100644 --- a/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.h +++ b/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.h @@ -54,7 +54,7 @@ class MODULES_EXPORT AXLayoutObject : public AXNodeObject { static AXLayoutObject* Create(LayoutObject*, AXObjectCacheImpl&); ~AXLayoutObject() override; - // Public, overridden from AXObjectImpl. + // Public, overridden from AXObject. LayoutObject* GetLayoutObject() const final { return layout_object_; } LayoutBoxModelObject* GetLayoutBoxModelObject() const; ScrollableArea* GetScrollableAreaIfScrollable() const final; @@ -69,7 +69,7 @@ class MODULES_EXPORT AXLayoutObject : public AXNodeObject { } // - // Overridden from AXObjectImpl. + // Overridden from AXObject. // void Init() override; @@ -111,8 +111,8 @@ class MODULES_EXPORT AXLayoutObject : public AXNodeObject { // Inline text boxes. void LoadInlineTextBoxes() override; - AXObjectImpl* NextOnLine() const override; - AXObjectImpl* PreviousOnLine() const override; + AXObject* NextOnLine() const override; + AXObject* PreviousOnLine() const override; // Properties of interactive elements. String StringValue() const override; @@ -124,7 +124,7 @@ class MODULES_EXPORT AXLayoutObject : public AXNodeObject { bool AriaHasPopup() const override; bool AriaRoleHasPresentationalChildren() const override; - AXObjectImpl* AncestorForWhichThisIsAPresentationalChild() const override; + AXObject* AncestorForWhichThisIsAPresentationalChild() const override; bool SupportsARIADragging() const override; bool SupportsARIADropping() const override; bool SupportsARIAFlowTo() const override; @@ -151,18 +151,18 @@ class MODULES_EXPORT AXLayoutObject : public AXNodeObject { void SetSelection(const AXRange&) override; // Hit testing. - AXObjectImpl* AccessibilityHitTest(const IntPoint&) const override; - AXObjectImpl* ElementAccessibilityHitTest(const IntPoint&) const override; + AXObject* AccessibilityHitTest(const IntPoint&) const override; + AXObject* ElementAccessibilityHitTest(const IntPoint&) const override; // High-level accessibility tree access. Other modules should only use these // functions. - AXObjectImpl* ComputeParent() const override; - AXObjectImpl* ComputeParentIfExists() const override; + AXObject* ComputeParent() const override; + AXObject* ComputeParentIfExists() const override; // Low-level accessibility tree exploration, only for use within the // accessibility module. - AXObjectImpl* RawFirstChild() const override; - AXObjectImpl* RawNextSibling() const override; + AXObject* RawFirstChild() const override; + AXObject* RawNextSibling() const override; void AddChildren() override; bool CanHaveChildren() const override; void UpdateChildrenIfNecessary() override; @@ -192,16 +192,16 @@ class MODULES_EXPORT AXLayoutObject : public AXNodeObject { void LineBreaks(Vector&) const final; private: - AXObjectImpl* TreeAncestorDisallowingChild() const; + AXObject* TreeAncestorDisallowingChild() const; bool IsTabItemSelected() const; - bool IsValidSelectionBound(const AXObjectImpl*) const; - AXObjectImpl* AccessibilityImageMapHitTest(HTMLAreaElement*, - const IntPoint&) const; + bool IsValidSelectionBound(const AXObject*) const; + AXObject* AccessibilityImageMapHitTest(HTMLAreaElement*, + const IntPoint&) const; LayoutObject* LayoutParentObject() const; bool IsSVGImage() const; void DetachRemoteSVGRoot(); AXSVGRoot* RemoteSVGRootElement() const; - AXObjectImpl* RemoteSVGElementHitTest(const IntPoint&) const; + AXObject* RemoteSVGElementHitTest(const IntPoint&) const; void OffsetBoundingBoxForRemoteSVGElement(LayoutRect&) const; void AddHiddenChildren(); void AddTextFieldChildren(); diff --git a/third_party/WebKit/Source/modules/accessibility/AXListBox.cpp b/third_party/WebKit/Source/modules/accessibility/AXListBox.cpp index 763a72fb58dba9..af73e43d0da5a3 100644 --- a/third_party/WebKit/Source/modules/accessibility/AXListBox.cpp +++ b/third_party/WebKit/Source/modules/accessibility/AXListBox.cpp @@ -57,7 +57,7 @@ AccessibilityRole AXListBox::DetermineAccessibilityRole() { return kListBoxRole; } -AXObjectImpl* AXListBox::ActiveDescendant() { +AXObject* AXListBox::ActiveDescendant() { if (!isHTMLSelectElement(GetNode())) return nullptr; diff --git a/third_party/WebKit/Source/modules/accessibility/AXListBox.h b/third_party/WebKit/Source/modules/accessibility/AXListBox.h index d40e283f80d095..d2853e9ca11494 100644 --- a/third_party/WebKit/Source/modules/accessibility/AXListBox.h +++ b/third_party/WebKit/Source/modules/accessibility/AXListBox.h @@ -47,7 +47,7 @@ class AXListBox final : public AXLayoutObject { AccessibilityRole DetermineAccessibilityRole() final; bool IsAXListBox() const override { return true; } - AXObjectImpl* ActiveDescendant() final; + AXObject* ActiveDescendant() final; void ActiveIndexChanged(); diff --git a/third_party/WebKit/Source/modules/accessibility/AXListBoxOption.cpp b/third_party/WebKit/Source/modules/accessibility/AXListBoxOption.cpp index aea93ad7247a43..a1524f98aaf8e9 100644 --- a/third_party/WebKit/Source/modules/accessibility/AXListBoxOption.cpp +++ b/third_party/WebKit/Source/modules/accessibility/AXListBoxOption.cpp @@ -64,7 +64,7 @@ AccessibilityRole AXListBoxOption::DetermineAccessibilityRole() { } bool AXListBoxOption::IsParentPresentationalRole() const { - AXObjectImpl* parent = ParentObject(); + AXObject* parent = ParentObject(); if (!parent) return false; diff --git a/third_party/WebKit/Source/modules/accessibility/AXMediaControls.cpp b/third_party/WebKit/Source/modules/accessibility/AXMediaControls.cpp index 70c0bad4de7fd0..d00ae6c1a38582 100644 --- a/third_party/WebKit/Source/modules/accessibility/AXMediaControls.cpp +++ b/third_party/WebKit/Source/modules/accessibility/AXMediaControls.cpp @@ -46,7 +46,7 @@ AccessibilityMediaControl::AccessibilityMediaControl( AXObjectCacheImpl& ax_object_cache) : AXLayoutObject(layout_object, ax_object_cache) {} -AXObjectImpl* AccessibilityMediaControl::Create( +AXObject* AccessibilityMediaControl::Create( LayoutObject* layout_object, AXObjectCacheImpl& ax_object_cache) { DCHECK(layout_object->GetNode()); @@ -276,9 +276,8 @@ AXMediaControlsContainer::AXMediaControlsContainer( AXObjectCacheImpl& ax_object_cache) : AccessibilityMediaControl(layout_object, ax_object_cache) {} -AXObjectImpl* AXMediaControlsContainer::Create( - LayoutObject* layout_object, - AXObjectCacheImpl& ax_object_cache) { +AXObject* AXMediaControlsContainer::Create(LayoutObject* layout_object, + AXObjectCacheImpl& ax_object_cache) { return new AXMediaControlsContainer(layout_object, ax_object_cache); } @@ -322,7 +321,7 @@ AccessibilityMediaTimeline::AccessibilityMediaTimeline( AXObjectCacheImpl& ax_object_cache) : AXSlider(layout_object, ax_object_cache) {} -AXObjectImpl* AccessibilityMediaTimeline::Create( +AXObject* AccessibilityMediaTimeline::Create( LayoutObject* layout_object, AXObjectCacheImpl& ax_object_cache) { return new AccessibilityMediaTimeline(layout_object, ax_object_cache); @@ -354,7 +353,7 @@ AccessibilityMediaTimeDisplay::AccessibilityMediaTimeDisplay( AXObjectCacheImpl& ax_object_cache) : AccessibilityMediaControl(layout_object, ax_object_cache) {} -AXObjectImpl* AccessibilityMediaTimeDisplay::Create( +AXObject* AccessibilityMediaTimeDisplay::Create( LayoutObject* layout_object, AXObjectCacheImpl& ax_object_cache) { return new AccessibilityMediaTimeDisplay(layout_object, ax_object_cache); diff --git a/third_party/WebKit/Source/modules/accessibility/AXMediaControls.h b/third_party/WebKit/Source/modules/accessibility/AXMediaControls.h index 353aec4406e261..07b70bf5be6842 100644 --- a/third_party/WebKit/Source/modules/accessibility/AXMediaControls.h +++ b/third_party/WebKit/Source/modules/accessibility/AXMediaControls.h @@ -40,7 +40,7 @@ class AccessibilityMediaControl : public AXLayoutObject { WTF_MAKE_NONCOPYABLE(AccessibilityMediaControl); public: - static AXObjectImpl* Create(LayoutObject*, AXObjectCacheImpl&); + static AXObject* Create(LayoutObject*, AXObjectCacheImpl&); ~AccessibilityMediaControl() override {} AccessibilityRole RoleValue() const override; @@ -65,7 +65,7 @@ class AccessibilityMediaTimeline final : public AXSlider { WTF_MAKE_NONCOPYABLE(AccessibilityMediaTimeline); public: - static AXObjectImpl* Create(LayoutObject*, AXObjectCacheImpl&); + static AXObject* Create(LayoutObject*, AXObjectCacheImpl&); ~AccessibilityMediaTimeline() override {} String Description(AXNameFrom, @@ -81,7 +81,7 @@ class AXMediaControlsContainer final : public AccessibilityMediaControl { WTF_MAKE_NONCOPYABLE(AXMediaControlsContainer); public: - static AXObjectImpl* Create(LayoutObject*, AXObjectCacheImpl&); + static AXObject* Create(LayoutObject*, AXObjectCacheImpl&); ~AXMediaControlsContainer() override {} AccessibilityRole RoleValue() const override { return kToolbarRole; } @@ -105,7 +105,7 @@ class AccessibilityMediaTimeDisplay final : public AccessibilityMediaControl { WTF_MAKE_NONCOPYABLE(AccessibilityMediaTimeDisplay); public: - static AXObjectImpl* Create(LayoutObject*, AXObjectCacheImpl&); + static AXObject* Create(LayoutObject*, AXObjectCacheImpl&); ~AccessibilityMediaTimeDisplay() override {} AccessibilityRole RoleValue() const override { return kStaticTextRole; } diff --git a/third_party/WebKit/Source/modules/accessibility/AXMenuList.cpp b/third_party/WebKit/Source/modules/accessibility/AXMenuList.cpp index c2b966eed7a2b5..96477a55aea5f6 100644 --- a/third_party/WebKit/Source/modules/accessibility/AXMenuList.cpp +++ b/third_party/WebKit/Source/modules/accessibility/AXMenuList.cpp @@ -82,7 +82,7 @@ void AXMenuList::AddChildren() { AXObjectCacheImpl& cache = AxObjectCache(); - AXObjectImpl* list = cache.GetOrCreate(kMenuListPopupRole); + AXObject* list = cache.GetOrCreate(kMenuListPopupRole); if (!list) return; diff --git a/third_party/WebKit/Source/modules/accessibility/AXMenuListOption.cpp b/third_party/WebKit/Source/modules/accessibility/AXMenuListOption.cpp index 43739e3bac6286..9676ad9ddce2b7 100644 --- a/third_party/WebKit/Source/modules/accessibility/AXMenuListOption.cpp +++ b/third_party/WebKit/Source/modules/accessibility/AXMenuListOption.cpp @@ -107,19 +107,19 @@ bool AXMenuListOption::ComputeAccessibilityIsIgnored( } void AXMenuListOption::GetRelativeBounds( - AXObjectImpl** out_container, + AXObject** out_container, FloatRect& out_bounds_in_container, SkMatrix44& out_container_transform) const { *out_container = nullptr; out_bounds_in_container = FloatRect(); out_container_transform.setIdentity(); - AXObjectImpl* parent = ParentObject(); + AXObject* parent = ParentObject(); if (!parent) return; DCHECK(parent->IsMenuListPopup()); - AXObjectImpl* grandparent = parent->ParentObject(); + AXObject* grandparent = parent->ParentObject(); if (!grandparent) return; DCHECK(grandparent->IsMenuList()); diff --git a/third_party/WebKit/Source/modules/accessibility/AXMenuListOption.h b/third_party/WebKit/Source/modules/accessibility/AXMenuListOption.h index 3447fee4fbce6d..76c954a3b4aa5a 100644 --- a/third_party/WebKit/Source/modules/accessibility/AXMenuListOption.h +++ b/third_party/WebKit/Source/modules/accessibility/AXMenuListOption.h @@ -62,7 +62,7 @@ class AXMenuListOption final : public AXMockObject { bool IsSelected() const override; void SetSelected(bool) override; bool CanSetSelectedAttribute() const override; - void GetRelativeBounds(AXObjectImpl** out_container, + void GetRelativeBounds(AXObject** out_container, FloatRect& out_bounds_in_container, SkMatrix44& out_container_transform) const override; String TextAlternative(bool recursive, diff --git a/third_party/WebKit/Source/modules/accessibility/AXMenuListPopup.cpp b/third_party/WebKit/Source/modules/accessibility/AXMenuListPopup.cpp index 7ef8e0e8ba2061..713c4e5c42bba3 100644 --- a/third_party/WebKit/Source/modules/accessibility/AXMenuListPopup.cpp +++ b/third_party/WebKit/Source/modules/accessibility/AXMenuListPopup.cpp @@ -65,7 +65,7 @@ AXMenuListOption* AXMenuListPopup::MenuListOptionAXObject( if (!isHTMLOptionElement(*element)) return 0; - AXObjectImpl* object = AxObjectCache().GetOrCreate(element); + AXObject* object = AxObjectCache().GetOrCreate(element); if (!object || !object->IsMenuListOption()) return 0; @@ -130,13 +130,13 @@ void AXMenuListPopup::DidUpdateActiveOption(int option_index) { AXObjectCacheImpl& cache = AxObjectCache(); if (active_index_ != option_index && active_index_ >= 0 && active_index_ < static_cast(children_.size())) { - AXObjectImpl* previous_child = children_[active_index_].Get(); + AXObject* previous_child = children_[active_index_].Get(); cache.PostNotification(previous_child, AXObjectCacheImpl::kAXMenuListItemUnselected); } if (option_index >= 0 && option_index < static_cast(children_.size())) { - AXObjectImpl* child = children_[option_index].Get(); + AXObject* child = children_[option_index].Get(); cache.PostNotification(this, AXObjectCacheImpl::kAXActiveDescendantChanged); cache.PostNotification(child, AXObjectCacheImpl::kAXMenuListItemSelected); } @@ -167,7 +167,7 @@ void AXMenuListPopup::DidShow() { AXObjectCacheImpl::kAXFocusedUIElementChanged); } -AXObjectImpl* AXMenuListPopup::ActiveDescendant() { +AXObject* AXMenuListPopup::ActiveDescendant() { if (active_index_ < 0 || active_index_ >= static_cast(Children().size())) return nullptr; diff --git a/third_party/WebKit/Source/modules/accessibility/AXMenuListPopup.h b/third_party/WebKit/Source/modules/accessibility/AXMenuListPopup.h index 7eaee49968094f..0db27902e24e96 100644 --- a/third_party/WebKit/Source/modules/accessibility/AXMenuListPopup.h +++ b/third_party/WebKit/Source/modules/accessibility/AXMenuListPopup.h @@ -48,7 +48,7 @@ class AXMenuListPopup final : public AXMockObject { void DidUpdateActiveOption(int option_index); void DidShow(); void DidHide(); - AXObjectImpl* ActiveDescendant() final; + AXObject* ActiveDescendant() final; private: explicit AXMenuListPopup(AXObjectCacheImpl&); diff --git a/third_party/WebKit/Source/modules/accessibility/AXMockObject.cpp b/third_party/WebKit/Source/modules/accessibility/AXMockObject.cpp index bb2adde356df0f..1c46fa2c28689f 100644 --- a/third_party/WebKit/Source/modules/accessibility/AXMockObject.cpp +++ b/third_party/WebKit/Source/modules/accessibility/AXMockObject.cpp @@ -30,7 +30,7 @@ namespace blink { AXMockObject::AXMockObject(AXObjectCacheImpl& ax_object_cache) - : AXObjectImpl(ax_object_cache) {} + : AXObject(ax_object_cache) {} AXMockObject::~AXMockObject() {} diff --git a/third_party/WebKit/Source/modules/accessibility/AXMockObject.h b/third_party/WebKit/Source/modules/accessibility/AXMockObject.h index 29afc406deabe8..e83ff1a619f2fb 100644 --- a/third_party/WebKit/Source/modules/accessibility/AXMockObject.h +++ b/third_party/WebKit/Source/modules/accessibility/AXMockObject.h @@ -27,13 +27,13 @@ #define AXMockObject_h #include "modules/ModulesExport.h" -#include "modules/accessibility/AXObjectImpl.h" +#include "modules/accessibility/AXObject.h" namespace blink { class AXObjectCacheImpl; -class MODULES_EXPORT AXMockObject : public AXObjectImpl { +class MODULES_EXPORT AXMockObject : public AXObject { WTF_MAKE_NONCOPYABLE(AXMockObject); protected: @@ -42,8 +42,8 @@ class MODULES_EXPORT AXMockObject : public AXObjectImpl { public: ~AXMockObject() override; - // AXObjectImpl overrides. - AXObjectImpl* ComputeParent() const override { return parent_; } + // AXObject overrides. + AXObject* ComputeParent() const override { return parent_; } bool IsEnabled() const override { return true; } private: diff --git a/third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp b/third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp index 55b2fbcefa4cb0..8ac8fb39133b09 100644 --- a/third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp +++ b/third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp @@ -80,7 +80,7 @@ class SparseAttributeSetter { USING_FAST_MALLOC(SparseAttributeSetter); public: - virtual void Run(const AXObjectImpl&, + virtual void Run(const AXObject&, AXSparseAttributeClient&, const AtomicString& value) = 0; }; @@ -92,7 +92,7 @@ class BoolAttributeSetter : public SparseAttributeSetter { private: AXBoolAttribute attribute_; - void Run(const AXObjectImpl& obj, + void Run(const AXObject& obj, AXSparseAttributeClient& attribute_map, const AtomicString& value) override { attribute_map.AddBoolAttribute(attribute_, @@ -107,7 +107,7 @@ class StringAttributeSetter : public SparseAttributeSetter { private: AXStringAttribute attribute_; - void Run(const AXObjectImpl& obj, + void Run(const AXObject& obj, AXSparseAttributeClient& attribute_map, const AtomicString& value) override { attribute_map.AddStringAttribute(attribute_, value); @@ -121,7 +121,7 @@ class ObjectAttributeSetter : public SparseAttributeSetter { private: AXObjectAttribute attribute_; - void Run(const AXObjectImpl& obj, + void Run(const AXObject& obj, AXSparseAttributeClient& attribute_map, const AtomicString& value) override { if (value.IsNull() || value.IsEmpty()) @@ -133,7 +133,7 @@ class ObjectAttributeSetter : public SparseAttributeSetter { Element* target = ToElement(node)->GetTreeScope().getElementById(value); if (!target) return; - AXObjectImpl* ax_target = obj.AxObjectCache().GetOrCreate(target); + AXObject* ax_target = obj.AxObjectCache().GetOrCreate(target); if (ax_target) attribute_map.AddObjectAttribute(attribute_, *ax_target); } @@ -147,7 +147,7 @@ class ObjectVectorAttributeSetter : public SparseAttributeSetter { private: AXObjectVectorAttribute attribute_; - void Run(const AXObjectImpl& obj, + void Run(const AXObject& obj, AXSparseAttributeClient& attribute_map, const AtomicString& value) override { Node* node = obj.GetNode(); @@ -164,12 +164,11 @@ class ObjectVectorAttributeSetter : public SparseAttributeSetter { if (ids.IsEmpty()) return; - HeapVector> objects; + HeapVector> objects; TreeScope& scope = node->GetTreeScope(); for (const auto& id : ids) { if (Element* id_element = scope.getElementById(AtomicString(id))) { - AXObjectImpl* ax_id_element = - obj.AxObjectCache().GetOrCreate(id_element); + AXObject* ax_id_element = obj.AxObjectCache().GetOrCreate(id_element); if (ax_id_element && !ax_id_element->AccessibilityIsIgnored()) objects.push_back(ax_id_element); } @@ -216,7 +215,7 @@ static AXSparseAttributeSetterMap& GetSparseAttributeSetterMap() { } AXNodeObject::AXNodeObject(Node* node, AXObjectCacheImpl& ax_object_cache) - : AXObjectImpl(ax_object_cache), + : AXObject(ax_object_cache), aria_role_(kUnknownRole), children_dirty_(false), node_(node) {} @@ -244,7 +243,7 @@ void AXNodeObject::AlterSliderValue(bool increase) { AXObjectCacheImpl::kAXValueChanged); } -AXObjectImpl* AXNodeObject::ActiveDescendant() { +AXObject* AXNodeObject::ActiveDescendant() { if (!node_ || !node_->IsElementNode()) return nullptr; @@ -259,14 +258,14 @@ AXObjectImpl* AXNodeObject::ActiveDescendant() { if (!descendant) return nullptr; - AXObjectImpl* ax_descendant = AxObjectCache().GetOrCreate(descendant); + AXObject* ax_descendant = AxObjectCache().GetOrCreate(descendant); return ax_descendant; } bool AXNodeObject::ComputeAccessibilityIsIgnored( IgnoredReasons* ignored_reasons) const { #if DCHECK_IS_ON() - // Double-check that an AXObjectImpl is never accessed before + // Double-check that an AXObject is never accessed before // it's been initialized. DCHECK(initialized_); #endif @@ -281,13 +280,13 @@ bool AXNodeObject::ComputeAccessibilityIsIgnored( } // Ignore labels that are already referenced by a control. - AXObjectImpl* control_object = CorrespondingControlForLabelElement(); + AXObject* control_object = CorrespondingControlForLabelElement(); if (control_object && control_object->IsCheckboxOrRadio() && control_object->NameFromLabelElement()) { if (ignored_reasons) { HTMLLabelElement* label = LabelElementContainer(); if (label && label != GetNode()) { - AXObjectImpl* label_ax_object = AxObjectCache().GetOrCreate(label); + AXObject* label_ax_object = AxObjectCache().GetOrCreate(label); ignored_reasons->push_back( IgnoredReason(kAXLabelContainer, label_ax_object)); } @@ -319,7 +318,7 @@ static bool IsListElement(Node* node) { isHTMLDListElement(*node); } -static bool IsPresentationalInTable(AXObjectImpl* parent, +static bool IsPresentationalInTable(AXObject* parent, HTMLElement* current_element) { if (!current_element) return false; @@ -346,7 +345,7 @@ static bool IsPresentationalInTable(AXObjectImpl* parent, IsHTMLTableSectionElement(ToHTMLElement(*parent_node))) { // Because TableSections have ignored role, presentation should be checked // with its parent node. - AXObjectImpl* table_object = parent->ParentObject(); + AXObject* table_object = parent->ParentObject(); Node* table_node = table_object ? table_object->GetNode() : 0; return isHTMLTableElement(table_node) && table_object->HasInheritedPresentationalRole(); @@ -354,7 +353,7 @@ static bool IsPresentationalInTable(AXObjectImpl* parent, return false; } -static bool IsRequiredOwnedElement(AXObjectImpl* parent, +static bool IsRequiredOwnedElement(AXObject* parent, AccessibilityRole current_role, HTMLElement* current_element) { Node* parent_node = parent->GetNode(); @@ -384,7 +383,7 @@ static bool IsRequiredOwnedElement(AXObjectImpl* parent, return false; } -const AXObjectImpl* AXNodeObject::InheritsPresentationalRoleFrom() const { +const AXObject* AXNodeObject::InheritsPresentationalRoleFrom() const { // ARIA states if an item can get focus, it should not be presentational. if (CanSetFocusAttribute()) return 0; @@ -399,7 +398,7 @@ const AXObjectImpl* AXNodeObject::InheritsPresentationalRoleFrom() const { if (AriaRoleAttribute() != kUnknownRole) return 0; - AXObjectImpl* parent = ParentObject(); + AXObject* parent = ParentObject(); if (!parent) return 0; @@ -724,13 +723,13 @@ AccessibilityRole AXNodeObject::DetermineAriaRoleAttribute() const { void AXNodeObject::AccessibilityChildrenFromAttribute( QualifiedName attr, - AXObjectImpl::AXObjectVector& children) const { + AXObject::AXObjectVector& children) const { HeapVector> elements; ElementsFromAttribute(elements, attr); AXObjectCacheImpl& cache = AxObjectCache(); for (const auto& element : elements) { - if (AXObjectImpl* child = cache.GetOrCreate(element)) { + if (AXObject* child = cache.GetOrCreate(element)) { // Only aria-labelledby and aria-describedby can target hidden elements. if (child->AccessibilityIsIgnored() && attr != aria_labelledbyAttr && attr != aria_labeledbyAttr && attr != aria_describedbyAttr) { @@ -804,13 +803,13 @@ bool AXNodeObject::IsGenericFocusableElement() const { return true; } -AXObjectImpl* AXNodeObject::MenuButtonForMenu() const { +AXObject* AXNodeObject::MenuButtonForMenu() const { Element* menu_item = MenuItemElementForMenu(); if (menu_item) { // ARIA just has generic menu items. AppKit needs to know if this is a top // level items like MenuBarButton or MenuBarItem - AXObjectImpl* menu_item_ax = AxObjectCache().GetOrCreate(menu_item); + AXObject* menu_item_ax = AxObjectCache().GetOrCreate(menu_item); if (menu_item_ax && menu_item_ax->IsMenuButton()) return menu_item_ax; } @@ -880,7 +879,7 @@ AccessibilityRole AXNodeObject::RemapAriaRoleDueToParent( if (role != kListBoxOptionRole && role != kMenuItemRole) return role; - for (AXObjectImpl* parent = ParentObject(); + for (AXObject* parent = ParentObject(); parent && !parent->AccessibilityIsIgnored(); parent = parent->ParentObject()) { AccessibilityRole parent_aria_role = parent->AriaRoleAttribute(); @@ -912,7 +911,7 @@ void AXNodeObject::Init() { } void AXNodeObject::Detach() { - AXObjectImpl::Detach(); + AXObject::Detach(); node_ = nullptr; } @@ -960,7 +959,7 @@ bool AXNodeObject::IsControl() const { return false; return ((node->IsElementNode() && ToElement(node)->IsFormControlElement()) || - AXObjectImpl::IsARIAControl(AriaRoleAttribute())); + AXObject::IsARIAControl(AriaRoleAttribute())); } bool AXNodeObject::IsControllingVideoElement() const { @@ -1161,7 +1160,7 @@ bool AXNodeObject::IsClickable() const { return true; } - return AXObjectImpl::IsClickable(); + return AXObject::IsClickable(); } bool AXNodeObject::IsEnabled() const { @@ -1304,7 +1303,7 @@ bool AXNodeObject::CanSetSelectedAttribute() const { if (AriaRoleAttribute() == kListBoxOptionRole && AncestorExposesActiveDescendant()) return true; - return AXObjectImpl::CanSetSelectedAttribute(); + return AXObject::CanSetSelectedAttribute(); } bool AXNodeObject::CanvasHasFallbackContent() const { @@ -1380,7 +1379,7 @@ unsigned AXNodeObject::HierarchicalLevel() const { // Hierarchy leveling starts at 1, to match the aria-level spec. // We measure tree hierarchy by the number of groups that the item is within. unsigned level = 1; - for (AXObjectImpl* parent = ParentObject(); parent; + for (AXObject* parent = ParentObject(); parent; parent = parent->ParentObject()) { AccessibilityRole parent_role = parent->RoleValue(); if (parent_role == kGroupRole) @@ -1431,29 +1430,29 @@ void AXNodeObject::Markers(Vector& marker_types, } } -AXObjectImpl* AXNodeObject::InPageLinkTarget() const { +AXObject* AXNodeObject::InPageLinkTarget() const { if (!node_ || !isHTMLAnchorElement(node_) || !GetDocument()) - return AXObjectImpl::InPageLinkTarget(); + return AXObject::InPageLinkTarget(); HTMLAnchorElement* anchor = toHTMLAnchorElement(node_); DCHECK(anchor); KURL link_url = anchor->Href(); if (!link_url.IsValid()) - return AXObjectImpl::InPageLinkTarget(); + return AXObject::InPageLinkTarget(); String fragment = link_url.FragmentIdentifier(); if (fragment.IsEmpty()) - return AXObjectImpl::InPageLinkTarget(); + return AXObject::InPageLinkTarget(); KURL document_url = GetDocument()->Url(); if (!document_url.IsValid() || !EqualIgnoringFragmentIdentifier(document_url, link_url)) { - return AXObjectImpl::InPageLinkTarget(); + return AXObject::InPageLinkTarget(); } TreeScope& tree_scope = anchor->GetTreeScope(); Element* target = tree_scope.FindAnchor(fragment); if (!target) - return AXObjectImpl::InPageLinkTarget(); + return AXObject::InPageLinkTarget(); // If the target is not in the accessibility tree, get the first unignored // sibling. return AxObjectCache().FirstAccessibleObjectFromNode(target); @@ -1491,11 +1490,11 @@ AccessibilityOrientation AXNodeObject::Orientation() const { case kTreeGridRole: return orientation; default: - return AXObjectImpl::Orientation(); + return AXObject::Orientation(); } } -AXObjectImpl::AXObjectVector AXNodeObject::RadioButtonsInGroup() const { +AXObject::AXObjectVector AXNodeObject::RadioButtonsInGroup() const { AXObjectVector radio_buttons; if (!node_ || RoleValue() != kRadioButtonRole) return radio_buttons; @@ -1505,7 +1504,7 @@ AXObjectImpl::AXObjectVector AXNodeObject::RadioButtonsInGroup() const { HeapVector> html_radio_buttons = FindAllRadioButtonsWithSameName(radio_button); for (size_t i = 0; i < html_radio_buttons.size(); ++i) { - AXObjectImpl* ax_radio_button = + AXObject* ax_radio_button = AxObjectCache().GetOrCreate(html_radio_buttons[i]); if (ax_radio_button) radio_buttons.push_back(ax_radio_button); @@ -1515,10 +1514,10 @@ AXObjectImpl::AXObjectVector AXNodeObject::RadioButtonsInGroup() const { // If the immediate parent is a radio group, return all its children that are // radio buttons. - AXObjectImpl* parent = ParentObject(); + AXObject* parent = ParentObject(); if (parent && parent->RoleValue() == kRadioGroupRole) { for (size_t i = 0; i < parent->Children().size(); ++i) { - AXObjectImpl* child = parent->Children()[i]; + AXObject* child = parent->Children()[i]; DCHECK(child); if (child->RoleValue() == kRadioButtonRole && !child->AccessibilityIsIgnored()) { @@ -1580,12 +1579,12 @@ String AXNodeObject::GetText() const { RGBA32 AXNodeObject::ColorValue() const { if (!isHTMLInputElement(GetNode()) || !IsColorWell()) - return AXObjectImpl::ColorValue(); + return AXObject::ColorValue(); HTMLInputElement* input = toHTMLInputElement(GetNode()); const AtomicString& type = input->getAttribute(typeAttr); if (!EqualIgnoringASCIICase(type, "color")) - return AXObjectImpl::ColorValue(); + return AXObject::ColorValue(); // HTMLInputElement::value always returns a string parseable by Color. Color color; @@ -1618,7 +1617,7 @@ AriaCurrentState AXNodeObject::GetAriaCurrentState() const { if (!attribute_value.IsEmpty()) return kAriaCurrentStateTrue; - return AXObjectImpl::GetAriaCurrentState(); + return AXObject::GetAriaCurrentState(); } InvalidState AXNodeObject::GetInvalidState() const { @@ -1645,7 +1644,7 @@ InvalidState AXNodeObject::GetInvalidState() const { return is_invalid ? kInvalidStateTrue : kInvalidStateFalse; } - return AXObjectImpl::GetInvalidState(); + return AXObject::GetInvalidState(); } int AXNodeObject::PosInSet() const { @@ -1658,7 +1657,7 @@ int AXNodeObject::PosInSet() const { return 1; } - return AXObjectImpl::IndexInParent() + 1; + return AXObject::IndexInParent() + 1; } return 0; @@ -1937,20 +1936,20 @@ String AXNodeObject::TextFromDescendants(AXObjectSet& visited, return String(); StringBuilder accumulated_text; - AXObjectImpl* previous = nullptr; + AXObject* previous = nullptr; AXObjectVector children; - HeapVector> owned_children; + HeapVector> owned_children; ComputeAriaOwnsChildren(owned_children); - for (AXObjectImpl* obj = RawFirstChild(); obj; obj = obj->RawNextSibling()) { + for (AXObject* obj = RawFirstChild(); obj; obj = obj->RawNextSibling()) { if (!AxObjectCache().IsAriaOwned(obj)) children.push_back(obj); } for (const auto& owned_child : owned_children) children.push_back(owned_child); - for (AXObjectImpl* child : children) { + for (AXObject* child : children) { // Don't recurse into children that are explicitly marked as aria-hidden. // Note that we don't call isInertOrAriaHidden because that would return // true if any ancestor is hidden, but we need to be able to compute the @@ -2027,23 +2026,23 @@ bool AXNodeObject::NameFromLabelElement() const { bool AXNodeObject::NameFromContents() const { Node* node = GetNode(); if (!node || !node->IsElementNode()) - return AXObjectImpl::NameFromContents(); - // AXObjectImpl::nameFromContents determines whether an element should take - // its name from its descendant contents based on role. However, is a // special case, as unlike a typical pop-up button it contains its own pop-up // menu's contents, which should not be used as the name. if (isHTMLSelectElement(node)) return false; - return AXObjectImpl::NameFromContents(); + return AXObject::NameFromContents(); } void AXNodeObject::GetRelativeBounds( - AXObjectImpl** out_container, + AXObject** out_container, FloatRect& out_bounds_in_container, SkMatrix44& out_container_transform) const { if (LayoutObjectForRelativeBounds()) { - AXObjectImpl::GetRelativeBounds(out_container, out_bounds_in_container, - out_container_transform); + AXObject::GetRelativeBounds(out_container, out_bounds_in_container, + out_container_transform); return; } @@ -2069,8 +2068,8 @@ void AXNodeObject::GetRelativeBounds( Vector rects; for (Node& child : NodeTraversal::ChildrenOf(*GetNode())) { if (child.IsHTMLElement()) { - if (AXObjectImpl* obj = AxObjectCache().Get(&child)) { - AXObjectImpl* container; + if (AXObject* obj = AxObjectCache().Get(&child)) { + AXObject* container; FloatRect bounds; obj->GetRelativeBounds(&container, bounds, out_container_transform); if (container) { @@ -2091,7 +2090,7 @@ void AXNodeObject::GetRelativeBounds( // children, for now, let's return the position of the ancestor that does have // a position, and make it the width of that parent, and about the height of a // line of text, so that it's clear the object is a child of the parent. - for (AXObjectImpl* position_provider = ParentObject(); position_provider; + for (AXObject* position_provider = ParentObject(); position_provider; position_provider = position_provider->ParentObject()) { if (position_provider->IsAXLayoutObject()) { position_provider->GetRelativeBounds( @@ -2122,7 +2121,7 @@ static Node* GetParentNodeForComputeParent(Node* node) { return parent_node; } -AXObjectImpl* AXNodeObject::ComputeParent() const { +AXObject* AXNodeObject::ComputeParent() const { DCHECK(!IsDetached()); if (Node* parent_node = GetParentNodeForComputeParent(GetNode())) return AxObjectCache().GetOrCreate(parent_node); @@ -2130,14 +2129,14 @@ AXObjectImpl* AXNodeObject::ComputeParent() const { return nullptr; } -AXObjectImpl* AXNodeObject::ComputeParentIfExists() const { +AXObject* AXNodeObject::ComputeParentIfExists() const { if (Node* parent_node = GetParentNodeForComputeParent(GetNode())) return AxObjectCache().Get(parent_node); return nullptr; } -AXObjectImpl* AXNodeObject::RawFirstChild() const { +AXObject* AXNodeObject::RawFirstChild() const { if (!GetNode()) return 0; @@ -2149,7 +2148,7 @@ AXObjectImpl* AXNodeObject::RawFirstChild() const { return AxObjectCache().GetOrCreate(first_child); } -AXObjectImpl* AXNodeObject::RawNextSibling() const { +AXObject* AXNodeObject::RawNextSibling() const { if (!GetNode()) return 0; @@ -2177,11 +2176,11 @@ void AXNodeObject::AddChildren() { if (GetLayoutObject() && !isHTMLCanvasElement(*node_)) return; - HeapVector> owned_children; + HeapVector> owned_children; ComputeAriaOwnsChildren(owned_children); for (Node& child : NodeTraversal::ChildrenOf(*node_)) { - AXObjectImpl* child_obj = AxObjectCache().GetOrCreate(&child); + AXObject* child_obj = AxObjectCache().GetOrCreate(&child); if (child_obj && !AxObjectCache().IsAriaOwned(child_obj)) AddChild(child_obj); } @@ -2193,11 +2192,11 @@ void AXNodeObject::AddChildren() { child->SetParent(this); } -void AXNodeObject::AddChild(AXObjectImpl* child) { +void AXNodeObject::AddChild(AXObject* child) { InsertChild(child, children_.size()); } -void AXNodeObject::InsertChild(AXObjectImpl* child, unsigned index) { +void AXNodeObject::InsertChild(AXObject* child, unsigned index) { if (!child) return; @@ -2273,7 +2272,7 @@ Element* AXNodeObject::ActionElement() const { return ToElement(node); } - if (AXObjectImpl::IsARIAInput(AriaRoleAttribute())) + if (AXObject::IsARIAInput(AriaRoleAttribute())) return ToElement(node); if (IsImageButton()) @@ -2332,7 +2331,7 @@ void AXNodeObject::SetNode(Node* node) { node_ = node; } -AXObjectImpl* AXNodeObject::CorrespondingControlForLabelElement() const { +AXObject* AXNodeObject::CorrespondingControlForLabelElement() const { HTMLLabelElement* label_element = LabelElementContainer(); if (!label_element) return 0; @@ -2431,7 +2430,7 @@ void AXNodeObject::ChildrenChanged() { // If AX elements are created now, they could interrogate the layout tree // while it's in a funky state. At the same time, process ARIA live region // changes. - for (AXObjectImpl* parent = this; parent; + for (AXObject* parent = this; parent; parent = parent->ParentObjectIfExists()) { parent->SetNeedsToUpdateChildren(); @@ -2463,13 +2462,12 @@ void AXNodeObject::SelectionChanged() { AxObjectCache().PostNotification(this, AXObjectCacheImpl::kAXSelectedTextChanged); if (GetDocument()) { - AXObjectImpl* document_object = - AxObjectCache().GetOrCreate(GetDocument()); + AXObject* document_object = AxObjectCache().GetOrCreate(GetDocument()); AxObjectCache().PostNotification( document_object, AXObjectCacheImpl::kAXDocumentSelectionChanged); } } else { - AXObjectImpl::SelectionChanged(); // Calls selectionChanged on parent. + AXObject::SelectionChanged(); // Calls selectionChanged on parent. } } @@ -2479,7 +2477,7 @@ void AXNodeObject::TextChanged() { AXObjectCacheImpl& cache = AxObjectCache(); for (Node* parent_node = GetNode(); parent_node; parent_node = parent_node->parentNode()) { - AXObjectImpl* parent = cache.Get(parent_node); + AXObject* parent = cache.Get(parent_node); if (!parent) continue; @@ -2506,7 +2504,7 @@ void AXNodeObject::UpdateAccessibilityRole() { } void AXNodeObject::ComputeAriaOwnsChildren( - HeapVector>& owned_children) const { + HeapVector>& owned_children) const { if (!HasAttribute(aria_ownsAttr)) return; @@ -2758,8 +2756,7 @@ String AXNodeObject::NativeTextAlternative( } } if (figcaption) { - AXObjectImpl* figcaption_ax_object = - AxObjectCache().GetOrCreate(figcaption); + AXObject* figcaption_ax_object = AxObjectCache().GetOrCreate(figcaption); if (figcaption_ax_object) { text_alternative = RecursiveTextAlternative(*figcaption_ax_object, false, visited); @@ -2823,7 +2820,7 @@ String AXNodeObject::NativeTextAlternative( } HTMLTableCaptionElement* caption = table_element->caption(); if (caption) { - AXObjectImpl* caption_ax_object = AxObjectCache().GetOrCreate(caption); + AXObject* caption_ax_object = AxObjectCache().GetOrCreate(caption); if (caption_ax_object) { text_alternative = RecursiveTextAlternative(*caption_ax_object, false, visited); @@ -2880,7 +2877,7 @@ String AXNodeObject::NativeTextAlternative( ToContainerNode(*(GetNode())), HasTagName(SVGNames::titleTag)); if (title) { - AXObjectImpl* title_ax_object = AxObjectCache().GetOrCreate(title); + AXObject* title_ax_object = AxObjectCache().GetOrCreate(title); if (title_ax_object && !visited.Contains(title_ax_object)) { text_alternative = RecursiveTextAlternative(*title_ax_object, false, visited); @@ -2912,7 +2909,7 @@ String AXNodeObject::NativeTextAlternative( } HTMLElement* legend = toHTMLFieldSetElement(GetNode())->Legend(); if (legend) { - AXObjectImpl* legend_ax_object = AxObjectCache().GetOrCreate(legend); + AXObject* legend_ax_object = AxObjectCache().GetOrCreate(legend); // Avoid an infinite loop if (legend_ax_object && !visited.Contains(legend_ax_object)) { text_alternative = @@ -2974,8 +2971,7 @@ String AXNodeObject::NativeTextAlternative( text_alternative = document->title(); Element* title_element = document->TitleElement(); - AXObjectImpl* title_ax_object = - AxObjectCache().GetOrCreate(title_element); + AXObject* title_ax_object = AxObjectCache().GetOrCreate(title_element); if (title_ax_object) { if (related_objects) { local_related_objects.push_back( @@ -3102,7 +3098,7 @@ String AXNodeObject::Description(AXNameFrom name_from, } HTMLTableCaptionElement* caption = table_element->caption(); if (caption) { - AXObjectImpl* caption_ax_object = AxObjectCache().GetOrCreate(caption); + AXObject* caption_ax_object = AxObjectCache().GetOrCreate(caption); if (caption_ax_object) { AXObjectSet visited; description = @@ -3233,7 +3229,7 @@ String AXNodeObject::PlaceholderFromNativeAttribute() const { DEFINE_TRACE(AXNodeObject) { visitor->Trace(node_); - AXObjectImpl::Trace(visitor); + AXObject::Trace(visitor); } } // namespace blink diff --git a/third_party/WebKit/Source/modules/accessibility/AXNodeObject.h b/third_party/WebKit/Source/modules/accessibility/AXNodeObject.h index 8ecc92e9e52a10..3a27ceecf3c364 100644 --- a/third_party/WebKit/Source/modules/accessibility/AXNodeObject.h +++ b/third_party/WebKit/Source/modules/accessibility/AXNodeObject.h @@ -30,7 +30,7 @@ #define AXNodeObject_h #include "modules/ModulesExport.h" -#include "modules/accessibility/AXObjectImpl.h" +#include "modules/accessibility/AXObject.h" #include "platform/wtf/Forward.h" namespace blink { @@ -40,7 +40,7 @@ class Element; class HTMLLabelElement; class Node; -class MODULES_EXPORT AXNodeObject : public AXObjectImpl { +class MODULES_EXPORT AXNodeObject : public AXObject { WTF_MAKE_NONCOPYABLE(AXNodeObject); protected: @@ -60,35 +60,35 @@ class MODULES_EXPORT AXNodeObject : public AXObjectImpl { #endif bool ComputeAccessibilityIsIgnored(IgnoredReasons* = nullptr) const override; - const AXObjectImpl* InheritsPresentationalRoleFrom() const override; + const AXObject* InheritsPresentationalRoleFrom() const override; virtual AccessibilityRole DetermineAccessibilityRole(); virtual AccessibilityRole NativeAccessibilityRoleIgnoringAria() const; String AccessibilityDescriptionForElements( HeapVector>& elements) const; void AlterSliderValue(bool increase); - AXObjectImpl* ActiveDescendant() override; + AXObject* ActiveDescendant() override; String AriaAccessibilityDescription() const; String AriaAutoComplete() const; AccessibilityRole DetermineAriaRoleAttribute() const; void AccessibilityChildrenFromAttribute(QualifiedName attr, - AXObjectImpl::AXObjectVector&) const; + AXObject::AXObjectVector&) const; bool HasContentEditableAttributeSet() const; bool IsTextControl() const override; // This returns true if it's focusable but it's not content editable and it's // not a control or ARIA control. bool IsGenericFocusableElement() const; - AXObjectImpl* MenuButtonForMenu() const; + AXObject* MenuButtonForMenu() const; Element* MenuItemElementForMenu() const; Element* MouseButtonListener() const; AccessibilityRole RemapAriaRoleDueToParent(AccessibilityRole) const; bool IsNativeCheckboxOrRadio() const; void SetNode(Node*); - AXObjectImpl* CorrespondingControlForLabelElement() const; + AXObject* CorrespondingControlForLabelElement() const; HTMLLabelElement* LabelElementContainer() const; // - // Overridden from AXObjectImpl. + // Overridden from AXObject. // void Init() override; @@ -146,7 +146,7 @@ class MODULES_EXPORT AXNodeObject : public AXObjectImpl { unsigned HierarchicalLevel() const final; void Markers(Vector&, Vector&) const override; - AXObjectImpl* InPageLinkTarget() const override; + AXObject* InPageLinkTarget() const override; AccessibilityOrientation Orientation() const override; AXObjectVector RadioButtonsInGroup() const override; static HeapVector> FindAllRadioButtonsWithSameName( @@ -186,21 +186,21 @@ class MODULES_EXPORT AXNodeObject : public AXObjectImpl { bool NameFromContents() const override; // Location - void GetRelativeBounds(AXObjectImpl** out_container, + void GetRelativeBounds(AXObject** out_container, FloatRect& out_bounds_in_container, SkMatrix44& out_container_transform) const override; // High-level accessibility tree access. - AXObjectImpl* ComputeParent() const override; - AXObjectImpl* ComputeParentIfExists() const override; + AXObject* ComputeParent() const override; + AXObject* ComputeParentIfExists() const override; // Low-level accessibility tree exploration. - AXObjectImpl* RawFirstChild() const override; - AXObjectImpl* RawNextSibling() const override; + AXObject* RawFirstChild() const override; + AXObject* RawNextSibling() const override; void AddChildren() override; bool CanHaveChildren() const override; - void AddChild(AXObjectImpl*); - void InsertChild(AXObjectImpl*, unsigned index); + void AddChild(AXObject*); + void InsertChild(AXObject*, unsigned index); // DOM and Render tree access. Element* ActionElement() const override; @@ -226,7 +226,7 @@ class MODULES_EXPORT AXNodeObject : public AXObjectImpl { // Aria-owns. void ComputeAriaOwnsChildren( - HeapVector>& owned_children) const; + HeapVector>& owned_children) const; private: Member node_; diff --git a/third_party/WebKit/Source/modules/accessibility/AXObjectImpl.cpp b/third_party/WebKit/Source/modules/accessibility/AXObject.cpp similarity index 86% rename from third_party/WebKit/Source/modules/accessibility/AXObjectImpl.cpp rename to third_party/WebKit/Source/modules/accessibility/AXObject.cpp index 39bfb8dde2daae..2cae448cea5924 100644 --- a/third_party/WebKit/Source/modules/accessibility/AXObjectImpl.cpp +++ b/third_party/WebKit/Source/modules/accessibility/AXObject.cpp @@ -26,7 +26,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "modules/accessibility/AXObjectImpl.h" +#include "modules/accessibility/AXObject.h" #include "SkMatrix44.h" #include "core/InputTypeNames.h" @@ -291,15 +291,13 @@ static Vector* CreateRoleNameVector() { for (int i = 0; i < kNumRoles; i++) (*role_name_vector)[i] = g_null_atom; - for (size_t i = 0; i < WTF_ARRAY_LENGTH(kRoles); ++i) { + for (size_t i = 0; i < WTF_ARRAY_LENGTH(kRoles); ++i) (*role_name_vector)[kRoles[i].webcore_role] = AtomicString(kRoles[i].aria_role); - } - for (size_t i = 0; i < WTF_ARRAY_LENGTH(kReverseRoles); ++i) { + for (size_t i = 0; i < WTF_ARRAY_LENGTH(kReverseRoles); ++i) (*role_name_vector)[kReverseRoles[i].webcore_role] = AtomicString(kReverseRoles[i].aria_role); - } return role_name_vector; } @@ -307,10 +305,9 @@ static Vector* CreateRoleNameVector() { static Vector* CreateInternalRoleNameVector() { Vector* internal_role_name_vector = new Vector(kNumRoles); - for (size_t i = 0; i < WTF_ARRAY_LENGTH(kInternalRoles); i++) { + for (size_t i = 0; i < WTF_ARRAY_LENGTH(kInternalRoles); i++) (*internal_role_name_vector)[kInternalRoles[i].webcore_role] = AtomicString(kInternalRoles[i].internal_role_name); - } return internal_role_name_vector; } @@ -347,9 +344,9 @@ HTMLDialogElement* GetActiveDialogElement(Node* node) { } // namespace -unsigned AXObjectImpl::number_of_live_ax_objects_ = 0; +unsigned AXObject::number_of_live_ax_objects_ = 0; -AXObjectImpl::AXObjectImpl(AXObjectCacheImpl& ax_object_cache) +AXObject::AXObject(AXObjectCacheImpl& ax_object_cache) : id_(0), have_children_(false), role_(kUnknownRole), @@ -369,12 +366,12 @@ AXObjectImpl::AXObjectImpl(AXObjectCacheImpl& ax_object_cache) ++number_of_live_ax_objects_; } -AXObjectImpl::~AXObjectImpl() { +AXObject::~AXObject() { DCHECK(IsDetached()); --number_of_live_ax_objects_; } -void AXObjectImpl::Detach() { +void AXObject::Detach() { // Clear any children and call detachFromParent on them so that // no children are left with dangling pointers to their parent. ClearChildren(); @@ -382,11 +379,11 @@ void AXObjectImpl::Detach() { ax_object_cache_ = nullptr; } -bool AXObjectImpl::IsDetached() const { +bool AXObject::IsDetached() const { return !ax_object_cache_; } -const AtomicString& AXObjectImpl::GetAOMPropertyOrARIAAttribute( +const AtomicString& AXObject::GetAOMPropertyOrARIAAttribute( AOMStringProperty property) const { Node* node = this->GetNode(); if (!node || !node->IsElementNode()) @@ -395,20 +392,20 @@ const AtomicString& AXObjectImpl::GetAOMPropertyOrARIAAttribute( return AccessibleNode::GetPropertyOrARIAAttribute(ToElement(node), property); } -bool AXObjectImpl::IsARIATextControl() const { +bool AXObject::IsARIATextControl() const { return AriaRoleAttribute() == kTextFieldRole || AriaRoleAttribute() == kSearchBoxRole || AriaRoleAttribute() == kComboBoxRole; } -bool AXObjectImpl::IsButton() const { +bool AXObject::IsButton() const { AccessibilityRole role = RoleValue(); return role == kButtonRole || role == kPopUpButtonRole || role == kToggleButtonRole; } -bool AXObjectImpl::IsCheckable() const { +bool AXObject::IsCheckable() const { switch (RoleValue()) { case kCheckBoxRole: case kMenuItemCheckBoxRole: @@ -425,7 +422,7 @@ bool AXObjectImpl::IsCheckable() const { // Because an AXMenuListOption (