The line: g_return_val_if_fail(!surface, NULL); is incorrectly causing the method to fail if the surface is not null. The condition should be reversed. This causes problems loading custom cursors. For example, loading LayoutTests/fast/blockflow/broken-ideographic-font.html causes many CRITICAL GLib assertions when trying to select the vertically oriented text.
Created attachment 73910 [details] Patch for this issue
Comment on attachment 73910 [details] Patch for this issue LGTM.
Committed r72020: <http://trac.webkit.org/changeset/72020>