Incorrect rendering of Panel with undefined size in Firefox (#14631).

Copied the fix from Valo.

Change-Id: I677fc4cfb65a57211fd82d994d75743fd49a83a2