Comment 13 for bug 1296303

Created attachment 911963
v4 of patch

This is final patchset (same as given yesterday on irc).