Bug 30998

Summary: [Gtk] Implement AtkDocument's locale support
Product: WebKit Reporter: Joanmarie Diggs (irc: joanie) <jdiggs>
Component: AccessibilityAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, xan.lopez
Priority: P2 Keywords: Gtk
Version: 528+ (Nightly build)   
Hardware: PC   
OS: Linux   
Bug Depends on:    
Bug Blocks: 25531    
Attachments:
Description Flags
proposed fix none

Description Joanmarie Diggs (irc: joanie) 2009-11-01 13:42:59 PST
Created attachment 42281 [details]
proposed fix

+++ This bug was initially created as a clone of Bug #30964 +++

We need to implement the AtkDocument interface.
http://library.gnome.org/devel/atk/unstable/AtkDocument.html
Comment 1 Jan Alonzo 2009-11-02 03:31:25 PST
Comment on attachment 42281 [details]
proposed fix

>  static const gchar* webkit_accessible_document_get_locale(AtkDocument* document)
>  {
> -    // FIXME: This needs to be implemented.
> -    notImplemented();
> +
> +    // TODO: Should we fall back on lang xml:lang when the following comes up empty?
> +    String language = static_cast<AccessibilityRenderObject*>(core(document))->language();
> +    if (!language.isEmpty())
> +        return returnString(language);

Should this return NULL if empty?
Comment 2 Joanmarie Diggs (irc: joanie) 2009-11-02 03:37:17 PST
(In reply to comment #1)
> (From update of attachment 42281 [details])
> >  static const gchar* webkit_accessible_document_get_locale(AtkDocument* document)
> >  {
> > -    // FIXME: This needs to be implemented.
> > -    notImplemented();
> > +
> > +    // TODO: Should we fall back on lang xml:lang when the following comes up empty?
> > +    String language = static_cast<AccessibilityRenderObject*>(core(document))->language();
> > +    if (!language.isEmpty())
> > +        return returnString(language);
> 
> Should this return NULL if empty?

I think so. Do you think otherwise? Or am I missing something?

-    // FIXME: This needs to be implemented.
-    notImplemented();
+
+    // TODO: Should we fall back on lang xml:lang when the following comes up empty?
+    String language = static_cast<AccessibilityRenderObject*>(core(document))->language();
+    if (!language.isEmpty())
+        return returnString(language);
+
     return 0;
     ^^^^^^^^^
Comment 3 Jan Alonzo 2009-11-02 03:44:28 PST
Comment on attachment 42281 [details]
proposed fix

>      return 0;

Yup, I missed it. :) r=me.
Comment 4 WebKit Commit Bot 2009-11-02 09:35:42 PST
Comment on attachment 42281 [details]
proposed fix

Clearing flags on attachment: 42281

Committed r50412: <http://trac.webkit.org/changeset/50412>
Comment 5 WebKit Commit Bot 2009-11-02 09:35:48 PST
All reviewed patches have been landed.  Closing bug.