Update HTMLElement.dir / Document.dir to return only known values

Update HTMLElement.dir / Document.dir to return only known values ('ltr',
'rtl', 'auto'), in their canonical form, as per the specification:
- http://www.whatwg.org/specs/web-apps/current-work/multipage/elements.html#dom-dir
- http://www.whatwg.org/specs/web-apps/current-work/multipage/common-dom-interfaces.html#limited-to-only-known-values

Previously, Chromium was returning the 'dir' value exactly as set, no matter if
it is a known value or not, and no matter its case.

The new behavior is consistent with Firefox 28. The behavior of IE11 is
slightly different:
- When setting an unknown 'dir' value, an exception will be thrown.
- Setting a known 'dir' value in a non-canonical case (e.g. "RTL"), the value
  will be directly converted to its canonical form (e.g. "rtl") before updating
  the DOM tree.

R=arv@chromium.org,tkent@chromium.org
BUG=363628
TEST=fast/dom/document-dir-property.html

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

git-svn-id: svn://svn.chromium.org/blink/trunk@171861 bbb929c8-8fbe-4397-9dbb-9b2b20218538