[TextAutosizer] Avoid unneccessary computations when loading new pages.
[TextAutosizer] Avoid unneccessary computations when loading new pages.

When loading a new web page in Chrome on Android
TextAutosizer.processSubtree() gets called while
the document is initially empty. This results in
multiple unnecessary calls to isAutosizingContainer(),
clusterMultiplier(), containerShouldBeAutosized() and
others. See trace in crbug.com/345304 for more details.
The issue happens on all tested pages.

To avoid autosizing empty pages this patch adds an early
return by checking the frame loader state.

BUG=345304

Review URL: https://codereview.chromium.org/174053005

git-svn-id: bf5cd6ccde378db821296732a091cfbcf5285fbd@167793 bbb929c8-8fbe-4397-9dbb-9b2b20218538

PeterWangIntel/blink-crosswalk,nwjs/blink,ondra-novak/blink,jtg-gg/blink,crosswalk-project/blink-crosswalk-efl,PeterWangIntel/blink-crosswalk,jtg-gg/blink,kurli/blink-crosswalk,hgl888/blink-crosswalk-efl,Bysmyyr/blink-crosswalk,PeterWangIntel/blink-crosswalk,PeterWangIntel/blink-crosswalk,modulexcite/blink,Pluto-tv/blink-crosswalk,XiaosongWei/blink-crosswalk,jtg-gg/blink,ondra-novak/blink,modulexcite/blink,modulexcite/blink,ondra-novak/blink,kurli/blink-crosswalk,Bysmyyr/blink-crosswalk,smishenk/blink-crosswalk,Pluto-tv/blink-crosswalk,Bysmyyr/blink-crosswalk,ondra-novak/blink,kurli/blink-crosswalk,nwjs/blink,crosswalk-project/blink-crosswalk-efl,jtg-gg/blink,kurli/blink-crosswalk,smishenk/blink-crosswalk,nwjs/blink,ondra-novak/blink,kurli/blink-crosswalk,hgl888/blink-crosswalk-efl,ondra-novak/blink,jtg-gg/blink,crosswalk-project/blink-crosswalk-efl,Pluto-tv/blink-crosswalk,ondra-novak/blink,XiaosongWei/blink-crosswalk,PeterWangIntel/blink-crosswalk,jtg-gg/blink,crosswalk-project/blink-crosswalk-efl,kurli/blink-crosswalk,modulexcite/blink,kurli/blink-crosswalk,jtg-gg/blink,crosswalk-project/blink-crosswalk-efl,hgl888/blink-crosswalk-efl,crosswalk-project/blink-crosswalk-efl,Pluto-tv/blink-crosswalk,kurli/blink-crosswalk,modulexcite/blink,nwjs/blink,jtg-gg/blink,smishenk/blink-crosswalk,hgl888/blink-crosswalk-efl,Bysmyyr/blink-crosswalk,Pluto-tv/blink-crosswalk,PeterWangIntel/blink-crosswalk,kurli/blink-crosswalk,modulexcite/blink,jtg-gg/blink,jtg-gg/blink,crosswalk-project/blink-crosswalk-efl,hgl888/blink-crosswalk-efl,smishenk/blink-crosswalk,crosswalk-project/blink-crosswalk-efl,XiaosongWei/blink-crosswalk,kurli/blink-crosswalk,ondra-novak/blink,hgl888/blink-crosswalk-efl,PeterWangIntel/blink-crosswalk,XiaosongWei/blink-crosswalk,Bysmyyr/blink-crosswalk,modulexcite/blink,modulexcite/blink,XiaosongWei/blink-crosswalk,smishenk/blink-crosswalk,Bysmyyr/blink-crosswalk,Bysmyyr/blink-crosswalk,Pluto-tv/blink-crosswalk,modulexcite/blink,smishenk/blink-crosswalk,smishenk/blink-crosswalk,nwjs/blink,XiaosongWei/blink-crosswalk,PeterWangIntel/blink-crosswalk,modulexcite/blink,XiaosongWei/blink-crosswalk,Bysmyyr/blink-crosswalk,nwjs/blink,XiaosongWei/blink-crosswalk,Pluto-tv/blink-crosswalk,nwjs/blink,ondra-novak/blink,XiaosongWei/blink-crosswalk,PeterWangIntel/blink-crosswalk,hgl888/blink-crosswalk-efl,smishenk/blink-crosswalk,smishenk/blink-crosswalk,Pluto-tv/blink-crosswalk,Bysmyyr/blink-crosswalk,hgl888/blink-crosswalk-efl,Pluto-tv/blink-crosswalk,crosswalk-project/blink-crosswalk-efl,hgl888/blink-crosswalk-efl,PeterWangIntel/blink-crosswalk,Pluto-tv/blink-crosswalk,smishenk/blink-crosswalk,hgl888/blink-crosswalk-efl,nwjs/blink,nwjs/blink,Bysmyyr/blink-crosswalk,XiaosongWei/blink-crosswalk,nwjs/blink