Attributes: Simplify the option val hook; backport a test from master

The hook is still defined; not using it could cause issues in IE<11.
Backport the test from the master branch.

Also, IE10 no longer throws when value not set but it still doesn't trim the
value. IE11 has all those issues fixed; support comments are updated.

(cherry-picked from f6302b0b53d61dfe1adbfaf6612be5cbced5bbc1)

Fixes gh-1902
Closes gh-1901