[webkit-reviews] review granted: [Bug 58429] [GTK] Missing nullchecks in GTK's a11y wrapper : [Attachment 89363] Patch proposal

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Apr 13 08:22:48 PDT 2011


Martin Robinson <mrobinson at webkit.org> has granted Mario Sanchez Prada
<msanchez at igalia.com>'s request for review:
Bug 58429: [GTK] Missing nullchecks in GTK's a11y wrapper
https://bugs.webkit.org/show_bug.cgi?id=58429

Attachment 89363: Patch proposal
https://bugs.webkit.org/attachment.cgi?id=89363&action=review

------- Additional Comments from Martin Robinson <mrobinson at webkit.org>
View in context: https://bugs.webkit.org/attachment.cgi?id=89363&action=review

Looks good, but consider my comments before landing.

> Source/WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.cpp:1560
> +    Document* document = coreObject->document();
>      switch(coords) {
>      case ATK_XY_SCREEN:
> -	   extents = coreObject->document()->view()->contentsToScreen(extents);

> +	   if (document)
> +	       extents = document->view()->contentsToScreen(extents);
>	   break;

If you only use "document" in this if block you should probably do:

if (Document* document = coreObject->document())
    extents = document->view()->contentsToScreen(extents);

and remove the first declaration.

> Source/WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.cpp:1836
> +    Document* document = coreObject->document();
> +    if (!document)
> +	   return;
> +
> +    if (!document->frame())
>	   return;

Can't this just be:

if (!document || !document->frame())
    return;

> Source/WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.cpp:1867
> +    Document* document = coreObject->document();
> +    if (!document)
>	   return;
> +
> +    if (!document->frame())
> +	   return;
> +

Ditto.


More information about the webkit-reviews mailing list