This behavior is applied to a text input and it shows a text
message inside the element if the user hasn't entered any text.
This is ported from http://go/labelinput.js
Known issue: Safari does not allow you get to the window object from a
document. We need that to listen to the onload event. For now we hard code
the window to the current window.
Known issue: We need to listen to the form submit event but we attach the
event only once (when created or when it is changed) so if you move the DOM
node to another form it will not be cleared correctly before submitting.