Make the test for <bdi> without dir=auto more accurate. Bug 838689, r=ehsan
authorSimon Montagu <smontagu@smontagu.org>
Wed, 20 Feb 2013 22:57:50 -0800
changeset 122512 b6d2ac238d95c905baa31fabc2db2f864c36c063
parent 122511 bcbe8d700ea5fbc87b78dd06ddecbb87a4f9c94b
child 122513 3a1d89eaf2e520472d50e298dec8c8ca016063d0
push id24342
push userryanvm@gmail.com
push dateThu, 21 Feb 2013 13:05:06 +0000
treeherdermozilla-central@702d2814efbf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan
bugs838689
milestone22.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Make the test for <bdi> without dir=auto more accurate. Bug 838689, r=ehsan
content/base/src/DirectionalityUtils.cpp
--- a/content/base/src/DirectionalityUtils.cpp
+++ b/content/base/src/DirectionalityUtils.cpp
@@ -239,17 +239,21 @@ DoesNotParticipateInAutoDirection(const 
           nodeInfo->Equals(nsGkAtoms::script) ||
           nodeInfo->Equals(nsGkAtoms::style) ||
           nodeInfo->Equals(nsGkAtoms::textarea));
 }
 
 static inline bool
 IsBdiWithoutDirAuto(const Element* aElement)
 {
-  return aElement->IsHTML(nsGkAtoms::bdi) && !aElement->HasDirAuto();
+  // We are testing for bdi elements without explicit dir="auto", so we can't
+  // use the HasDirAuto() flag, since that will return true for bdi element with
+  // no dir attribute or an invalid dir attribute
+  return (aElement->IsHTML(nsGkAtoms::bdi) &&
+          (!aElement->HasValidDir() || aElement->HasFixedDir()));
 }
 
 /**
  * Returns true if aElement is one of the element whose text content should not
  * affect the direction of ancestors with dir=auto (though it may affect its own
  * direction, e.g. <bdi>)
  */
 static bool