Update frame metrics / viewport when orientation changes

Rebased functional changed from
https://github.com/tmeshkova/mozilla-central/pull/48

Namely commit: https://github.com/rainemak/mozilla-central/commit/08794bf7831f94a47c6b859a634feec0c844e64d

Some changes needed to be for apzc as there were diff between 29 and 26 engines.

In addition, some apzc logs ported (in another commit).