[webkit-reviews] review requested: [Bug 25678] [GTK] Implement ROLE_COMBO_BOX : [Attachment 74127] Patch proposal + Unit test
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Wed Nov 17 09:40:44 PST 2010
Mario Sanchez Prada <msanchez at igalia.com> has asked for review:
Bug 25678: [GTK] Implement ROLE_COMBO_BOX
https://bugs.webkit.org/show_bug.cgi?id=25678
Attachment 74127: Patch proposal + Unit test
https://bugs.webkit.org/attachment.cgi?id=74127&action=review
------- Additional Comments from Mario Sanchez Prada <msanchez at igalia.com>
(In reply to comment #5)
> [...]
> > WebCore/ChangeLog:23
> > + of that methor to an overriden version of stringValue(), which is
>
> methor -> method
Ooops! Fixed.
> > WebCore/accessibility/AccessibilityMenuListOption.cpp:113
> > +String AccessibilityMenuListOption::stringValue() const
>
> I'm not sure about the naming here. Maybe Chris can give the nod.
Well, the naming must be exactly that one ('stringValue') since what I want to
do is precisely to override the stringValue() method from the superclass
AccessibilityObject, so no more black magic is needed and everything works
without changing anything else :-)
> > WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.cpp:768
> > + const Vector<Element*> listItems = selectNode->listItems();
> >
> > - // TODO: Combo boxes
> > + if (selectedIndex < 0 || selectedIndex >= (int)listItems.size())
>
> Is it possible for the selectedIndex to be > listeItems.size()? It doesn't
look like it after staring at SelectElement::selectedIndex. If you still need
to cast to int, be sure to use a static_cast.
I thought of that as a nice sanity check, to explicitly make sure the returned
value for selectedIndex is actually between those two limits. But if you think
I'm being too paranoid I have no problems with removing that (which would also
remove the previous line, btw). For the time being I'll leave it as it is.
About the static_cast: sorry. Fixed!
> > WebCore/platform/gtk/PopupMenuGtk.cpp:65
> > - int x, y;
> > -
gdk_window_get_origin(gtk_widget_get_window(GTK_WIDGET(view->hostWindow()->plat
formPageClient())), &x, &y);
> > + int x = 0;
> > + int y = 0;
> > + GdkWindow* window =
gtk_widget_get_window(GTK_WIDGET(view->hostWindow()->platformPageClient()));
> > + if (window)
> > + gdk_window_get_origin(window, &x, &y);
>
> Is this change related?
Yes, it's related to this patch because without that extra null check the unit
test will crash with a segfault, since the gdk_window_get_origin() function
would be called over a NULL value, as returned from gtk_widget_get_window().
Now attaching a new patch.
More information about the webkit-reviews
mailing list