Cache length in ElementData::getAttributeItemIndex() for performance
Cache length in ElementData::getAttributeItemIndex() for performance

Cache length in ElementData::getAttributeItemIndex() for performance.
We should avoid to call ElementData::length() in a loop as it hides an
if check to see if the ElementData is unique or not.

I see a 2.8% improvement on Bindings/id-setter.html performance test on
Linux desktop. This minimizes the performance regression caused by
r157508.

R=arv, esprehn
BUG=293663

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

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

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