Unfortunately this is not just a UK thing. Every EU country is forced to do this.
A similar law was passed in Sweden just the other week and will come into effect on July 1, despite heavy criticism from pretty much everyone.
So how could they pass such a law? It's from an EU directive, more specifically 2009/136/EC [1]. A directive is something that every member state is _required_ to implement into national law, whether they like it or not. AFAIK every member state is supposed to have implemented this by now. Sigh.
Does this apply to all EU traffic?
OR does this only apply to websites hosted within the EU?
OR does only apply to EU companies?
Plus how on earth do they plan to enforce this?