Bug 988355 - Properly handle device rotation in DynamicPanel (r=margaret)