[Webkit-unassigned] [Bug 139443] [GTK] Add API to set the web view editable into WebKit2 GTK+ API

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jan 19 02:37:42 PST 2015


https://bugs.webkit.org/show_bug.cgi?id=139443

--- Comment #14 from Carlos Garcia Campos <cgarcia at igalia.com> ---
Comment on attachment 244882
  --> https://bugs.webkit.org/attachment.cgi?id=244882
Patch

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

> Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestWebViewEditor.cpp:219
> +    test->loadHtml(selectedSpanHTML, 0);

Use nullptr instad of 0

> Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestWebViewEditor.cpp:237
> +    g_assert(test->isEditable());
> +    test->setEditable(false);
> +    g_assert(!test->isEditable());

The WebView is destroyed when the test finishes so we don't need to reset the state.

> Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestWebViewEditor.cpp:251
> +    test->loadHtml(selectedSpanHTML, 0);

nullptr.

> Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestWebViewEditor.cpp:272
> +}

There's too much code duplicated here, I think we could try to move the common code to a helper function. We could use a format string for the selectedSpanHTML since the only difference is the true/false. We could also add EditorTest::cutSelection() that returns the selected text. That method would include the asserts to check the CUT and PASTE editing commands can be executed, the call to custClipboard and then it would return gtk_clipboard_wait_for_text().

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20150119/7c3e15a9/attachment-0002.html>


More information about the webkit-unassigned mailing list