Bug 25769 - Fix accessibility warnings on GTK
Summary: Fix accessibility warnings on GTK
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Accessibility (show other bugs)
Version: 528+ (Nightly build)
Hardware: Macintosh OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
: 25838 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-05-13 17:04 PDT by chris fleizach
Modified: 2009-07-22 15:47 PDT (History)
1 user (show)

See Also:


Attachments
patch (1.91 KB, patch)
2009-05-13 17:13 PDT, chris fleizach
mrowe: review-
Details | Formatted Diff | Diff
patch (2.35 KB, patch)
2009-05-14 12:34 PDT, chris fleizach
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description chris fleizach 2009-05-13 17:04:44 PDT
here are the warnings this patch will try to fix

../../WebCore/page/AccessibilityTable.h:66: warning: type qualifiers ignored on function return type
../../WebCore/page/AccessibilityTable.h:67: warning: type qualifiers ignored on function return type
../../WebCore/page/AccessibilityRenderObject.cpp:2118: warning: ‘WebCore::createARIARoleMap()::RoleEntry’ declared with greater visibility than the type of its field ‘WebCore::createARIARoleMap()::RoleEntry::ariaRole’
../../WebCore/page/AccessibilityTable.h:66: warning: type qualifiers ignored on function return type
../../WebCore/page/AccessibilityTable.h:67: warning: type qualifiers ignored on function return type
../../WebCore/page/AccessibilityTable.cpp:353: warning: type qualifiers ignored on function return type
../../WebCore/page/AccessibilityTable.cpp:361: warning: type qualifiers ignored on function return type
../../WebCore/page/AccessibilityTable.h:66: warning: type qualifiers ignored on function return type
../../WebCore/page/AccessibilityTable.h:67: warning: type qualifiers ignored on function return type
../../WebCore/page/AccessibilityTable.h:66: warning: type qualifiers ignored on function return type
../../WebCore/page/AccessibilityTable.h:67: warning: type qualifiers ignored on function return type
Comment 1 chris fleizach 2009-05-13 17:13:36 PDT
Created attachment 30301 [details]
patch
Comment 2 Mark Rowe (bdash) 2009-05-13 19:47:31 PDT
Comment on attachment 30301 [details]
patch

This isn't correct.  The warnings are saying that it doesn't make sense for the return type of a function to be "const unsigned", such as in "const unsigned columnCount();".  Should that perhaps be "unsigned columnCount() const;"?
Comment 3 chris fleizach 2009-05-13 20:47:13 PDT
yes that sounds correct
Comment 4 chris fleizach 2009-05-14 12:34:29 PDT
Created attachment 30350 [details]
patch

updated patch based on review
can't make columnCount into

unsigned columnCount() const

because it needs to call addChildren(), which is not const
Comment 5 Holger Freyther 2009-05-14 20:43:09 PDT
Comment on attachment 30350 [details]
patch


> Index: WebCore/page/AccessibilityRenderObject.cpp
> ===================================================================
> --- WebCore/page/AccessibilityRenderObject.cpp	(revision 43716)
> +++ WebCore/page/AccessibilityRenderObject.cpp	(working copy)
> @@ -2116,6 +2116,7 @@ typedef HashMap<String, AccessibilityRol
>  static const ARIARoleMap& createARIARoleMap()
>  {
>      struct RoleEntry {
> +    public:


Isn't a struct public by default?
Comment 6 chris fleizach 2009-05-14 20:47:53 PDT
you'd think, but what does this warning mean then

‘WebCore::createARIARoleMap()::RoleEntry’ declared with greater visibility
than the type of its field
Comment 7 Mark Rowe (bdash) 2009-05-16 20:17:15 PDT
*** Bug 25838 has been marked as a duplicate of this bug. ***
Comment 8 Darin Adler 2009-05-16 20:35:59 PDT
Comment on attachment 30350 [details]
patch

>  {
>      struct RoleEntry {
> +    public:
>          String ariaRole;
>          AccessibilityRole webcoreRole;
>      };

This change does not make sense. In a struct, everything is public by default and this should have no effect. I have no idea why gcc is warning about this, but I do not think this is the fix.

> Index: WebCore/page/AccessibilityTable.cpp
> ===================================================================
> --- WebCore/page/AccessibilityTable.cpp	(revision 43716)
> +++ WebCore/page/AccessibilityTable.cpp	(working copy)
> @@ -350,7 +350,7 @@ void AccessibilityTable::cells(Accessibi
>      }
>  }
>      
> -const unsigned AccessibilityTable::columnCount()
> +unsigned AccessibilityTable::columnCount()
>  {
>      if (!hasChildren())
>          addChildren();
> @@ -358,7 +358,7 @@ const unsigned AccessibilityTable::colum
>      return m_columns.size();    
>  }
>      
> -const unsigned AccessibilityTable::rowCount()
> +unsigned AccessibilityTable::rowCount()
>  {
>      if (!hasChildren())
>          addChildren();
> Index: WebCore/page/AccessibilityTable.h
> ===================================================================
> --- WebCore/page/AccessibilityTable.h	(revision 43716)
> +++ WebCore/page/AccessibilityTable.h	(working copy)
> @@ -63,8 +63,8 @@ public:
>      AccessibilityChildrenVector& columns();
>      AccessibilityChildrenVector& rows();
>      
> -    const unsigned columnCount();
> -    const unsigned rowCount();
> +    unsigned columnCount();
> +    unsigned rowCount();
>      
>      virtual String title() const;

These changes are good.

I'm saying r=me, but don't land that "public:" change -- it should have no effect.
Comment 9 chris fleizach 2009-05-16 23:17:24 PDT
alright, i won't make the struct change, which makes no sense (as does the warning). someone who compiles gtk can fix that
Comment 10 Darin Adler 2009-05-17 09:49:45 PDT
(In reply to comment #9)
> alright, i won't make the struct change, which makes no sense (as does the
> warning).

I think that warning indicates a bug in the new gcc. Someone should investigate more and report the bug to the gcc maintainers.
Comment 11 Darin Adler 2009-05-17 09:50:35 PDT
http://trac.webkit.org/changeset/43810