Prefer `right` for positioning inside RTL nodes (Fix #1569)

This is a working fix for #1569.

It switches to position the node using a right-based calculation for nodes found inside RTL nodes, so that the inline position has preference.

I was looking to add some tests as well, but as far as I could see, the ones inside `dom-xy-tests.js` aren't exactly testing this over existing nodes, but over newly created ones. Is there a place for such tests or should we add them right there with the existing ones?