Layers: fix Resource detection of measurement changes (#18553)
Layers: fix Resource detection of measurement changes (#18553)

Layers tries to eagerly remeasure whatever is necessary. In some cases, that means that we could remeasure a child element _before_ necessary, even though Resources will still think it needs remeasure.

In most cases, this would be fine. But, because we were using the latest value of `getPageLayoutBox`, it would fail to detect that measurements changed. Instead, we need to keep track of the last time we meausred, and compare against that.
danielrozenberg/amphtml,zhouyx/amphtml,media-net/amphtml,widespace-os/amphtml,lannka/amphtml,koshka/amphtml,media-net/amphtml,yandex-pcode/amphtml,zhouyx/amphtml,nexxtv/amphtml,jpettitt/amphtml,tlong2/amphtml,dotandads/amphtml,media-net/amphtml,jmadler/amphtml,lannka/amphtml,src-code/amphtml,jridgewell/amphtml,BenDz/amphtml,jmadler/amphtml,prateekbh/amphtml,honeybadgerdontcare/amphtml,src-code/amphtml,sharethrough/amphtml,jridgewell/amphtml,taboola/amphtml,kamtschatka/amphtml,techhtml/amphtml,yandex-pcode/amphtml,cory-work/amphtml,zhangsu/amphtml,rsimha-amp/amphtml,cvializ/amphtml,techhtml/amphtml,Gregable/amphtml,alanorozco/amphtml,adup-tech/amphtml,yieldbot/amphtml,widespace-os/amphtml,BenDz/amphtml,src-code/amphtml,jpettitt/amphtml,lannka/amphtml,alanorozco/amphtml,lannka/amphtml,sebastianbenz/amphtml,BenDz/amphtml,erwinmombay/amphtml,smartadserver/amphtml,cory-work/amphtml,smartadserver/amphtml,erwinmombay/amphtml,jridgewell/amphtml,mhc-gh/amphtml,koshka/amphtml,yieldbot/amphtml,pedjoni8/amphtml,jridgewell/amphtml,techhtml/amphtml,tlong2/amphtml,yieldbot/amphtml,zhouyx/amphtml,media-net/amphtml,honeybadgerdontcare/amphtml,jpettitt/amphtml,adup-tech/amphtml,taboola/amphtml,kamtschatka/amphtml,alanorozco/amphtml,Gregable/amphtml,taboola/amphtml,ampproject/amphtml,prateekbh/amphtml,techhtml/amphtml,jpettitt/amphtml,kamtschatka/amphtml,nexxtv/amphtml,cory-work/amphtml,cvializ/amphtml,smartadserver/amphtml,dotandads/amphtml,ampproject/amphtml,jpettitt/amphtml,adup-tech/amphtml,smartadserver/amphtml,ampproject/amphtml,media-net/amphtml,cory-work/amphtml,Gregable/amphtml,taboola/amphtml,sharethrough/amphtml,pedjoni8/amphtml,ampproject/amphtml,rsimha-amp/amphtml,media-net/amphtml,erwinmombay/amphtml,voyagegroup/amphtml,mhc-gh/amphtml,mhc-gh/amphtml,tlong2/amphtml,Gregable/amphtml,honeybadgerdontcare/amphtml,Gregable/amphtml,zhouyx/amphtml,voyagegroup/amphtml,Gregable/amphtml,widespace-os/amphtml,koshka/amphtml,dotandads/amphtml,tlong2/amphtml,ampproject/amphtml,yandex-pcode/amphtml,widespace-os/amphtml,rsimha-amp/amphtml,prateekbh/amphtml,taboola/amphtml,honeybadgerdontcare/amphtml,pedjoni8/amphtml,lannka/amphtml,yandex-pcode/amphtml,zhangsu/amphtml,prateekbh/amphtml,zhangsu/amphtml,alanorozco/amphtml,sharethrough/amphtml,cvializ/amphtml,BenDz/amphtml,pedjoni8/amphtml,danielrozenberg/amphtml,ampproject/amphtml,widespace-os/amphtml,danielrozenberg/amphtml,mhc-gh/amphtml,voyagegroup/amphtml,jpettitt/amphtml,techhtml/amphtml,zhangsu/amphtml,widespace-os/amphtml,erwinmombay/amphtml,laterpay/amphtml,erwinmombay/amphtml,tlong2/amphtml,danielrozenberg/amphtml,yandex-pcode/amphtml,koshka/amphtml,media-net/amphtml,kamtschatka/amphtml,adup-tech/amphtml,erwinmombay/amphtml,alanorozco/amphtml,cvializ/amphtml,pedjoni8/amphtml,taboola/amphtml,rsimha-amp/amphtml,jmadler/amphtml,nexxtv/amphtml,honeybadgerdontcare/amphtml,jmadler/amphtml,koshka/amphtml,taboola/amphtml,nexxtv/amphtml,voyagegroup/amphtml,cvializ/amphtml,zhangsu/amphtml,sebastianbenz/amphtml,media-net/amphtml,nexxtv/amphtml,yieldbot/amphtml,rsimha-amp/amphtml,honeybadgerdontcare/amphtml,BenDz/amphtml,jmadler/amphtml,danielrozenberg/amphtml,smartadserver/amphtml,laterpay/amphtml,jmadler/amphtml,cory-work/amphtml,src-code/amphtml,kamtschatka/amphtml,nexxtv/amphtml,danielrozenberg/amphtml,cory-work/amphtml,rsimha-amp/amphtml,dotandads/amphtml,jpettitt/amphtml,lannka/amphtml,Gregable/amphtml,tlong2/amphtml,adup-tech/amphtml,yandex-pcode/amphtml,honeybadgerdontcare/amphtml,zhangsu/amphtml,jridgewell/amphtml,sebastianbenz/amphtml,mhc-gh/amphtml,prateekbh/amphtml,nexxtv/amphtml,voyagegroup/amphtml,rsimha-amp/amphtml,dotandads/amphtml,voyagegroup/amphtml,sebastianbenz/amphtml,laterpay/amphtml,ampproject/amphtml,zhouyx/amphtml,koshka/amphtml,laterpay/amphtml,yieldbot/amphtml,mhc-gh/amphtml,dotandads/amphtml,danielrozenberg/amphtml,yandex-pcode/amphtml,prateekbh/amphtml,laterpay/amphtml,sharethrough/amphtml,pedjoni8/amphtml,zhouyx/amphtml,zhouyx/amphtml,BenDz/amphtml,ampproject/amphtml,src-code/amphtml,danielrozenberg/amphtml,jridgewell/amphtml,adup-tech/amphtml,alanorozco/amphtml,sebastianbenz/amphtml,cvializ/amphtml,laterpay/amphtml,mhc-gh/amphtml,sharethrough/amphtml,techhtml/amphtml,prateekbh/amphtml,cory-work/amphtml,jpettitt/amphtml,lannka/amphtml,sebastianbenz/amphtml,kamtschatka/amphtml,alanorozco/amphtml,sharethrough/amphtml,smartadserver/amphtml,yieldbot/amphtml,voyagegroup/amphtml,alanorozco/amphtml,mhc-gh/amphtml,Gregable/amphtml,src-code/amphtml,jridgewell/amphtml