From ad030778e127da5bee8733ebf1c6b9ba0303550e Mon Sep 17 00:00:00 2001 From: dmazzoni Date: Sat, 18 Apr 2015 16:59:15 -0700 Subject: [PATCH] Fix accessibilityController.rootElement There was no need for a special case for the root, and it was buggy. Treat the root just like any other element. BUG=478307 Review URL: https://codereview.chromium.org/1098623005 Cr-Commit-Position: refs/heads/master@{#325794} --- .../shell/renderer/test_runner/accessibility_controller.cc | 2 +- content/shell/renderer/test_runner/web_ax_object_proxy.cc | 12 ------------ content/shell/renderer/test_runner/web_ax_object_proxy.h | 1 - 3 files changed, 1 insertion(+), 14 deletions(-) diff --git a/content/shell/renderer/test_runner/accessibility_controller.cc b/content/shell/renderer/test_runner/accessibility_controller.cc index 4538c78665d7..4aafbed48e73 100644 --- a/content/shell/renderer/test_runner/accessibility_controller.cc +++ b/content/shell/renderer/test_runner/accessibility_controller.cc @@ -239,7 +239,7 @@ v8::Handle AccessibilityController::FocusedElement() { v8::Handle AccessibilityController::RootElement() { if (root_element_.isNull()) root_element_ = web_view_->accessibilityObject(); - return elements_.CreateRoot(root_element_); + return elements_.GetOrCreate(root_element_); } v8::Handle diff --git a/content/shell/renderer/test_runner/web_ax_object_proxy.cc b/content/shell/renderer/test_runner/web_ax_object_proxy.cc index 43e1766ceb98..b0d6d66f56e1 100644 --- a/content/shell/renderer/test_runner/web_ax_object_proxy.cc +++ b/content/shell/renderer/test_runner/web_ax_object_proxy.cc @@ -1295,16 +1295,4 @@ v8::Handle WebAXObjectProxyList::GetOrCreate( return handle; } -v8::Handle WebAXObjectProxyList::CreateRoot( - const blink::WebAXObject& object) { - v8::Isolate* isolate = blink::mainThreadIsolate(); - v8::Handle value_handle = gin::CreateHandle( - isolate, new RootWebAXObjectProxy(object, this)).ToV8(); - if (value_handle.IsEmpty()) - return v8::Handle(); - v8::Handle handle = value_handle->ToObject(isolate); - elements_.Append(handle); - return handle; -} - } // namespace content diff --git a/content/shell/renderer/test_runner/web_ax_object_proxy.h b/content/shell/renderer/test_runner/web_ax_object_proxy.h index b73429609fed..0c1eea026706 100644 --- a/content/shell/renderer/test_runner/web_ax_object_proxy.h +++ b/content/shell/renderer/test_runner/web_ax_object_proxy.h @@ -178,7 +178,6 @@ class WebAXObjectProxyList : public WebAXObjectProxy::Factory { void Clear(); v8::Handle GetOrCreate(const blink::WebAXObject&) override; - v8::Handle CreateRoot(const blink::WebAXObject&); private: typedef v8::PersistentValueVector ElementList; -- 2.11.4.GIT