reddit/reddit — pull request #947 by Sabenya (2014-01-10 17:59:37+00:00)
Title: Add "required" attribute to usertext text areas

This opens up some additional options for subreddits to style comment areas. The `:valid` and `:invalid` selectors can then be used to apply rules that depend on whether or not text is entered into the field.

This can help the implementation of one common pattern that puts subreddit rules inside comment areas as a background image, and hides them when the field is selected. Many subreddits (eg. /r/nosleep, /r/circlebroke, /r/cringe) currently use this pattern, but at the moment, if the user tabs away from the field after entering text, the background image pops back up again. Adding in this `required` attribute allows CSS authors to detect this case and work around it, again through the `:valid` and `:invalid` selectors.

This addition also makes semantic sense, as these fields do indeed require input in order for the form to be submitted.