WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
25989
[Gtk] Enable accessibility in Gtk DRT
https://bugs.webkit.org/show_bug.cgi?id=25989
Summary
[Gtk] Enable accessibility in Gtk DRT
Jan Alonzo
Reported
2009-05-24 02:04:59 PDT
We need to enable accessibility support in DRT Gtk so we can run the AX tests and hopefully be able to contribute more to these tests, esp. now that we're getting serious with implementing the necessary functionality to have the port accessibility-enabled.
Attachments
initial impl
(16.73 KB, patch)
2009-05-28 21:25 PDT
,
Jan Alonzo
no flags
Details
Formatted Diff
Diff
Add Accessibility support to GTK DRT
(25.92 KB, patch)
2009-06-08 01:29 PDT
,
Jan Alonzo
xan.lopez
: review-
Details
Formatted Diff
Diff
Updated patch based on xan's feedback
(25.77 KB, patch)
2009-06-09 08:53 PDT
,
Jan Alonzo
no flags
Details
Formatted Diff
Diff
updated 31/07/2009
(21.30 KB, patch)
2009-08-06 22:33 PDT
,
Jan Alonzo
no flags
Details
Formatted Diff
Diff
patch updated to ToT (r46888)
(21.69 KB, patch)
2009-08-07 00:25 PDT
,
Jan Alonzo
no flags
Details
Formatted Diff
Diff
patch with ChangeLog
(27.62 KB, patch)
2009-08-07 23:00 PDT
,
Jan Alonzo
xan.lopez
: review+
Details
Formatted Diff
Diff
Show Obsolete
(5)
View All
Add attachment
proposed patch, testcase, etc.
Jan Alonzo
Comment 1
2009-05-28 21:25:03 PDT
Created
attachment 30765
[details]
initial impl Initial support to enable these tests. Need to implement getting the focused element to make this useful as most of the tests rely on getting the "focused UI element" to determine whether the test passed or fail.
Jan Alonzo
Comment 2
2009-06-08 01:29:32 PDT
Created
attachment 31041
[details]
Add Accessibility support to GTK DRT This patch adds basic accessibility support to gtk DRT so we can get things going. Only four tests are passing at the moment and I've enabled them in this patch. Just an aside: A lot of the tests depend on an accessible element's attributes and I don't think we have that yet. Once we get that support, we should be able to enable more tests.
Xan Lopez
Comment 3
2009-06-08 02:40:31 PDT
Comment on
attachment 31041
[details]
Add Accessibility support to GTK DRT
> +AtkObject* webkit_accessible_get_focused_element(WebKitAccessible* accessible) > +{ > + if (!accessible->m_object) > + return 0; > + > + // FIXME: update the backing store once we have one. > + > + RefPtr<AccessibilityObject> focusedObj = accessible->m_object->focusedUIElement(); > + if (!focusedObj) > + return 0; > + > + return focusedObj->wrapper(); > +} > +
I can never decide if we should add new API in one patch and its usage in another, or everything in one patch.
> diff --git a/WebKitTools/DumpRenderTree/AccessibilityUIElement.cpp b/WebKitTools/DumpRenderTree/AccessibilityUIElement.cpp > index c78323e..48494c3 100644 > --- a/WebKitTools/DumpRenderTree/AccessibilityUIElement.cpp > +++ b/WebKitTools/DumpRenderTree/AccessibilityUIElement.cpp > @@ -28,6 +28,8 @@ > > #include <JavaScriptCore/JSRetainPtr.h> > > +#include <limits.h> > + > // Static Functions >
I would put this in a different patch.
> +AccessibilityUIElement AccessibilityUIElement::getChildAtIndex(unsigned index) > +{ > + Vector<AccessibilityUIElement> children; > + getChildrenWithRange(children, index, 1); > + > + if (children.size() == 1) > + return children.at(0); > + > + return 0; > +}
Mmm, why can't you just use atk_object_ref_accessible_child with index here?
> +AccessibilityUIElement AccessibilityUIElement::parentElement() > +{ > + g_assert(m_element);
I guess we should use either ASSERT or g_assert, and stick to that.
> + > +double AccessibilityUIElement::intValue() > +{ > + GValue value = { 0, { { 0 } } };
I suppose { 0, } like in C does not work in C++.
> + > + if (!ATK_IS_VALUE(m_element)) > + return 0.0f; > + > + atk_value_get_current_value(ATK_VALUE(m_element), &value); > + return g_value_get_double(&value);
How do we know the GValue has a double value? Shouldn't we do a G_VALUE_HOLDS_DOUBLE before?
> @@ -432,7 +434,10 @@ static void webViewWindowObjectCleared(WebKitWebView* view, WebKitWebFrame* fram > assert(gLayoutTestController); > > gLayoutTestController->makeWindowObject(context, windowObject, &exception); > - assert(!exception); > + ASSERT(!exception); > + > + accessibilityController->makeWindowObject(context, windowObject, &exception); > + ASSERT(!exception);
Stupid question, where is this created? :D The patch looks pretty good to me, but I'll mark it as r- while we work out the last details.
Jan Alonzo
Comment 4
2009-06-09 08:31:59 PDT
(In reply to
comment #3
)
> > +++ b/WebKitTools/DumpRenderTree/AccessibilityUIElement.cpp > > @@ -28,6 +28,8 @@ > > > > #include <JavaScriptCore/JSRetainPtr.h> > > > > +#include <limits.h> > > + > > // Static Functions > > > > I would put this in a different patch.
Ok.
> > > +AccessibilityUIElement AccessibilityUIElement::getChildAtIndex(unsigned index) > > +{ > > + Vector<AccessibilityUIElement> children; > > + getChildrenWithRange(children, index, 1); > > + > > + if (children.size() == 1) > > + return children.at(0); > > + > > + return 0; > > +} > > Mmm, why can't you just use atk_object_ref_accessible_child with index here?
I could but I think I wanted to exercise the function and so we don't have repeated atk_object_ref_accessible_child calls in the getChild... functions. I can change it if that makes more sense.
> > > +AccessibilityUIElement AccessibilityUIElement::parentElement() > > +{ > > + g_assert(m_element); > > I guess we should use either ASSERT or g_assert, and stick to that.
ok.
> > > + > > +double AccessibilityUIElement::intValue() > > +{ > > + GValue value = { 0, { { 0 } } }; > > I suppose { 0, } like in C does not work in C++.
ok.
> > > + > > + if (!ATK_IS_VALUE(m_element)) > > + return 0.0f; > > + > > + atk_value_get_current_value(ATK_VALUE(m_element), &value); > > + return g_value_get_double(&value); > > How do we know the GValue has a double value? Shouldn't we do a > G_VALUE_HOLDS_DOUBLE before?
Ok. Should I check for G_VALUE_HOLDS_INT too and return 0 if both fail?
> > > @@ -432,7 +434,10 @@ static void webViewWindowObjectCleared(WebKitWebView* view, WebKitWebFrame* fram > > assert(gLayoutTestController); > > > > gLayoutTestController->makeWindowObject(context, windowObject, &exception); > > - assert(!exception); > > + ASSERT(!exception); > > + > > + accessibilityController->makeWindowObject(context, windowObject, &exception); > > + ASSERT(!exception); > > Stupid question, where is this created? :D
Oops. Weird, it worked even without creating it! :-\ I'll fix it and make sure the results are still the same.
> > The patch looks pretty good to me, but I'll mark it as r- while we work out the > last details.
Thanks a lot for the review. Sorry took a while to respond.
>
Jan Alonzo
Comment 5
2009-06-09 08:53:06 PDT
Created
attachment 31098
[details]
Updated patch based on xan's feedback
Xan Lopez
Comment 6
2009-06-09 09:07:09 PDT
Comment on
attachment 31098
[details]
Updated patch based on xan's feedback OK.
Jan Alonzo
Comment 7
2009-06-09 09:26:01 PDT
(In reply to
comment #6
)
> (From update of
attachment 31098
[details]
[review]) > OK. >
I forgot to add the Copyright Apple line to the new DRT files. ARe you OK with me adding that prior to committing? Thanks.
Xan Lopez
Comment 8
2009-06-09 09:44:34 PDT
(In reply to
comment #7
)
> (In reply to
comment #6
) > > (From update of
attachment 31098
[details]
[review] [review]) > > OK. > > > > I forgot to add the Copyright Apple line to the new DRT files. ARe you OK with > me adding that prior to committing? > > Thanks. >
Sure.
Jan Alonzo
Comment 9
2009-06-11 05:10:34 PDT
Our non-accessibility tests seems to be crashing with this patch. I'm holding off committing this one first until I figure out what's triggering the crashes.
Jan Alonzo
Comment 10
2009-06-12 15:09:40 PDT
Comment on
attachment 31098
[details]
Updated patch based on xan's feedback Clearing review for now until I can run the full testsuite with this patch. Thanks and apologies..
Jan Alonzo
Comment 11
2009-08-06 22:33:31 PDT
Created
attachment 34252
[details]
updated 31/07/2009
Jan Alonzo
Comment 12
2009-08-07 00:25:43 PDT
Created
attachment 34255
[details]
patch updated to ToT (
r46888
)
Jan Alonzo
Comment 13
2009-08-07 23:00:09 PDT
Created
attachment 34361
[details]
patch with ChangeLog
Xan Lopez
Comment 14
2009-08-08 00:19:00 PDT
Comment on
attachment 34361
[details]
patch with ChangeLog
> +AtkObject* webkit_accessible_get_focused_element(WebKitAccessible* accessible) > +{ > + if (!accessible->m_object) > + return 0; > + > + // FIXME: update the backing store once we have one.
I'm not sure what this is.
> +AtkObject* webkit_web_frame_get_focused_accessible_element(WebKitWebFrame* frame) > +{ > + g_return_val_if_fail(WEBKIT_IS_WEB_FRAME(frame), NULL); > + > +#if HAVE(ACCESSIBILITY) > + if (!AXObjectCache::accessibilityEnabled()) > + AXObjectCache::enableAccessibility(); > + > + WebKitWebFramePrivate* priv = frame->priv; > + if (!priv->coreFrame || !priv->coreFrame->document()) > + return NULL; > + > + RenderView* root = static_cast<RenderView *>(priv->coreFrame->document()->renderer());
I think you should use the new toRenderView methods introduced recently here.
> +double AccessibilityUIElement::intValue() > +{ > + GValue value = { 0, };
You should use the full initializer here ( GValue value = { 0, { { 0 } } }), otherwise I think you'll get compiler warnings. Looks good to me otherwise, please land with those things fixed.
Jan Alonzo
Comment 15
2009-08-08 00:55:40 PDT
Fixed. Landed as
http://trac.webkit.org/changeset/46952
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug