From 9e9cb640e2bb2818174fd335fb30260004d33429 Mon Sep 17 00:00:00 2001 From: Simon Montagu Date: Sun, 24 Mar 2013 11:27:03 +0200 Subject: [PATCH] Set AncestorHasDirAuto on the descendants of a having its dir attribute removed or set to an invalid value. Bug 849732, r=ehsan --- content/base/src/DirectionalityUtils.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/content/base/src/DirectionalityUtils.cpp b/content/base/src/DirectionalityUtils.cpp index 69e5b1a68b3..9e642f78b8f 100644 --- a/content/base/src/DirectionalityUtils.cpp +++ b/content/base/src/DirectionalityUtils.cpp @@ -663,8 +663,13 @@ WalkDescendantsResetAutoDirection(Element* aElement) void WalkDescendantsSetDirAuto(Element* aElement, bool aNotify) { - if (!DoesNotParticipateInAutoDirection(aElement) && - !IsBdiWithoutDirAuto(aElement)) { + // Only test for DoesNotParticipateInAutoDirection -- in other words, if + // aElement is a which is having its dir attribute set to auto (or + // removed or set to an invalid value, which are equivalent to dir=auto for + // , we *do* want to set AncestorHasDirAuto on its descendants, unlike + // in SetDirOnBind where we don't propagate AncestorHasDirAuto to a + // being bound to an existing node with dir=auto. + if (!DoesNotParticipateInAutoDirection(aElement)) { bool setAncestorDirAutoFlag = #ifdef DEBUG @@ -685,7 +690,7 @@ WalkDescendantsSetDirAuto(Element* aElement, bool aNotify) MOZ_ASSERT(!aElement->AncestorHasDirAuto() || child->AncestorHasDirAuto(), "AncestorHasDirAuto set on node but not its children"); - child->SetHasDirAuto(); + child->SetAncestorHasDirAuto(); child = child->GetNextNode(aElement); } }