Bug 56659

Summary: [GTK] Expose menu items and menus as children of a menu bar
Product: WebKit Reporter: Mario Sanchez Prada <mario>
Component: AccessibilityAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: jdiggs, mrobinson
Priority: P2 Keywords: Gtk
Version: 528+ (Nightly build)   
Hardware: PC   
OS: Linux   
Bug Depends on:    
Bug Blocks: 30796    
Attachments:
Description Flags
Patch proposal + Layout test cfleizach: review+

Description Mario Sanchez Prada 2011-03-18 10:43:01 PDT
In the following example:
http://test.cita.illinois.edu/aria/menubar/menubar1.php

Theres some WAI-ARIA compliant HTML exposing a menu bar with 4 menu items, where each of them pop out a menu when activated, showing some more menu items in those menus. That is, the typical menubar -> menuitems -> menu (for each menu item) -> menu item (for each menu) layout :-)

Problem is that WebKitGTK should be exposing something like this (as for roles):

  Menubar
   |---> menu item
   |      `---> menu
   |             |---> menu item
   |             |---> menu item
   |             `---> menu item
   |---> menu item
   |      `---> menu
   |             |---> menu item
   |             |---> menu item
   |             `---> menu item
   |---> menu item
   |      `---> menu
   |             |---> menu item
   |             |---> menu item
   |             `---> menu item
   `---> menu item
          `---> menu
                 |---> menu item
                 |---> menu item
                 `---> menu item

However, what is currently exposing is the following:
  Menubar
   |---> panel
   |---> panel
   |---> panel
   `---> panel

...which is obviously wrong, preventing ATs from checking the contents of those menus
Comment 1 Mario Sanchez Prada 2011-04-11 09:32:16 PDT
Created attachment 89015 [details]
Patch proposal + Layout test

Attaching simple patch to fix this along with a cross platform test (needs adding new results for other platforms, say, Mac and Win)
Comment 2 chris fleizach 2011-04-12 08:50:44 PDT
Comment on attachment 89015 [details]
Patch proposal + Layout test

View in context: https://bugs.webkit.org/attachment.cgi?id=89015&action=review

otherwise looks good. r=me

> Source/WebCore/accessibility/AccessibilityRenderObject.cpp:2968
>              return MenuItemRole;

It looks like we're calling parentObjectUnignored()->ariaRoleAttribute() potentially three times. I think that value should be stored local. parentObjectUnignored() can be little expensive.
Comment 3 Mario Sanchez Prada 2011-04-12 09:51:01 PDT
(In reply to comment #2)
> (From update of attachment 89015 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=89015&action=review
> 
> otherwise looks good. r=me
> 
> > Source/WebCore/accessibility/AccessibilityRenderObject.cpp:2968
> >              return MenuItemRole;
> 
> It looks like we're calling parentObjectUnignored()->ariaRoleAttribute() potentially three times. I think that value should be stored local. parentObjectUnignored() can be little expensive.

I'll fix that right before committing.

Thanks!
Comment 4 Mario Sanchez Prada 2011-04-12 10:35:53 PDT
Committed r83606: <http://trac.webkit.org/changeset/83606>