Add the 'direction' property and fix one RTL layout corner case.