[Webkit-unassigned] [Bug 55603] [GTK] Implement the next bit of the TextInputController (hasMarkedText and markedRange)

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Mar 3 00:09:41 PST 2011


--- Comment #2 from Carlos Garcia Campos <cgarcia at igalia.com>  2011-03-03 00:09:41 PST ---
(From update of attachment 84452)
View in context: https://bugs.webkit.org/attachment.cgi?id=84452&action=review

> Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.cpp:499
>      Frame* frame = core(webView)->focusController()->focusedOrMainFrame();
> -    if (!frame)
> -        return;
> +    g_return_if_fail(frame);
>      Editor* editor = frame->editor();
> -    if (!editor)
> -        return;
> -    if (!editor->canEdit() && !editor->hasComposition())
> -        return;
> +    g_return_if_fail(editor);
> +    g_return_if_fail(editor->canEdit() || editor->hasComposition());

I don't think using g_return_* macros everywhere is a good idea. Those macros are not just early returns, are more like an assert that doesn't abort, they log a critical warning, if you have ciriticals=fatal it will crash on an assertion. g_return_* macros are used to protect public methods checking the input and logging a critical message when something is not expected, to easily catch bugs. Since they are inefficient you can build glib with G_DISABLE_CHECKS (it's usually done in production builds for performance reasons) which makes those macros do nothing (#define g_return_if_fail(expr) (void)0;)

Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

More information about the webkit-unassigned mailing list