The requirements of line wrapping and Unicode Bidirectional Algorithm create a chicken-egg problem:
1) UBA requires bidi reordering after splitting the text into lines.
2) in order to split the text into lines with any line-wrapping algorithm, the width of the line excluding the whitespace before the first word and after the last word needs to be known. But for that, the visual order of the words needs to be known so as to know which whitespace to cut. But per UBA, the visual order of the RTL/LTR segments must be computed for each line individually, so after line wrapping.
How is this problem solved conceptually and in practice (eg. in chrome, openoffice, etc.)?