Assertion failure: "AncestorHasDirAuto set on node but not its children"

RESOLVED FIXED in mozilla20

Status

()

defect
--
critical
RESOLVED FIXED
7 years ago
7 years ago

People

(Reporter: jruderman, Assigned: smontagu)

Tracking

(Blocks 1 bug, {assertion, testcase})

Trunk
mozilla20
x86_64
macOS
Points:
---
Dependency tree / graph
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(3 attachments)

Assertion failure: !aElement->AncestorHasDirAuto() || child->AncestorHasDirAuto() (AncestorHasDirAuto set on node but not its children), at content/base/src/DirectionalityUtils.cpp:665
Posted file stack
Posted patch PatchSplinter Review
The only semantic change here is adding 

+  if (!DoesNotParticipateInAutoDirection(aElement) &&
+      !aElement->NodeInfo()->Equals(nsGkAtoms::bdi) &&

to the conditions for setting AncestorHasDirAuto when binding a new element to a document. We need this condition because the descendants of these elements are never going to affect the directionality of their ancestors.

The rest of the patch is just moving code around.
Attachment #689603 - Flags: review?(peterv)
Attachment #689603 - Attachment is patch: true
Assignee: nobody → smontagu
Comment on attachment 689603 [details] [diff] [review]
Patch

Review of attachment 689603 [details] [diff] [review]:
-----------------------------------------------------------------

Please add the testcase as an automated test.

::: content/base/src/DirectionalityUtils.cpp
@@ +614,2 @@
>  void
> +WalkAncestorsResetAutoDirection(Element* aElement, bool aNotify = true)

Just pass in true in the one caller that omits aNotify.

@@ +886,5 @@
> +{
> +  // Set the AncestorHasDirAuto flag, unless this element shouldn't affect
> +  // ancestors that have dir=auto
> +  if (!DoesNotParticipateInAutoDirection(aElement) &&
> +      !aElement->NodeInfo()->Equals(nsGkAtoms::bdi) &&

Hmm, this should be |!aElement->IsHTML(nsGkAtoms::bdi)|. And file a bug to fix all the other spots where we made this mistake.
Attachment #689603 - Flags: review?(peterv) → review+
https://hg.mozilla.org/mozilla-central/rev/31a28a59de39
https://hg.mozilla.org/mozilla-central/rev/7eb3d3124d24
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla20
You need to log in before you can comment on or make changes to this bug.