How Facebook built its legal defence against Yahoo