DoF and transparent/glossy materials

After some playtesting, I came to a nice result with depth of field and a reflective material:
http://www.pasteall.org/pic/show.php?id=74465

With the way I set it up I’m pretty sure it works too with glass materials.

The only downside is that it only works for full reflective/transparent materials.

The way I achieved it is by setting a duplicate of the scene, with everything on a custom “Z-depth” material, except the mirror.
Here is the node setup for the depth material:
http://www.pasteall.org/pic/show.php?id=74466
(The unconnected value of the Divide sets the furthest distance you can reach)

The idea was that the Z material was being reflected by the mirror (or transmitted through glass) into the camera, and the rendered image replaced the Z input of the first render.
In this image though I used the Bokeh blur node because it is much more realistic (I’m trying to find a way to make it work with the Camera’s focus settings btw, but have no luck) instead of the default Defocus filter.

It should work OK as a mist pass too, reacting with water properly (for those who doesn’t want to use the slow Volumetrics).

Here’s a download link to the blend: http://www.pasteall.org/blend/30618