Bug 972276: Cache window size on event to avoid reflows.

See: https://bugzilla.mozilla.org/show_bug.cgi?id=972276