Make the test for <bdi> without dir=auto more accurate. Bug 838689, r=ehsan
Don't clear HasDirAutoSet on a <bdi>. Bug 838489, r=ehsan
Text nodes in anonymous subtrees shouldn't affect ancestors with dir=auto. Bug 839886, r=ehsan