Support explicit DIR attributes on HTML elements.

Change-Id: I47a80f153de18242ded0553c73afc160f972285f