font-style:italic; tilts the font to the right just like this: my font
In Arabic, the writing is done from right-to-left, not left-to-right. Wh
Setting dir=rtl only affects the direction of layout. It doesn't change the direction of text — you still see "some italic code" in your example, not "edoc cilati emos" — nor does it mirror each character left-to-right.
Italic variants of Arabic fonts, where they exist, will often slant to the left instead of the right. (This is sometimes known as an "Iranic" variant.) This isn't a behavior you can control in CSS, though, as it is a decision made by the font designer, not the browser.