Handle whitespaces after DOCTYPE element

This change fixes a bug where a whitespace after DOCTYPE element
in a file would cause the file to be unparsable. It also adds
a regresion test.

bug: https://code.google.com/p/android/issues/detail?id=171828

Change-Id: I1036b17833c12bc275c058b835fb8f02665edfae
2 files changed