Testcase from bug 847127, r=ehsan
Set the AncestorHasDirAuto flag for all new text nodes that need it. Bug 847127, r=ehsan
Make sure not to return the old text node in ResetNodeDirection. Bug 845093, r=ehsan
Move WalkDescendantsClearAncestorDirAuto from BeforeSetAttr to OnSetDirAttr to simplify the test for elements that had dir=auto but no longer do, especially <bdi>. Bug 845093, r=ehsan