fix a bug and add a testcase to make sure we don't regress it in the future
fix a bug and add a testcase to make sure we don't regress it in the future

--HG--
extra : convert_revision : svn%3Aacbfec75-9323-0410-a652-858a13e371e0/trunk%40257

aredridel/html5,Chiens/html5