Make the test for <bdi> without dir=auto more accurate. Bug 838689, r=ehsan, a=lsblakk
Don't clear HasDirAutoSet on a <bdi>. Bug 838489, r=ehsan, a=lsblakk