we switch to use the layout size. Otherwise it will first use the old dimension which can exceed the limit, which in turn causes the Browser to crash. Fix http://b/issue?id=2616263