Fix http://bugs.jqueryui.com/ticket/9314 without slowdown.