[Runtime] Add dir and span support for widget

We can get right value for text items which have dir
propertie or span element in it.

This festure according to
http://www.w3.org/TR/widgets/#the-dir-attribute
http://www.w3.org/TR/widgets/#the-span-element-and-its-attributes
Merge pull request #1958 from CooderIan/span_dir_support

[Runtime] Add dir and span support for widget