Closed Bug 815043 Opened 12 years ago Closed 12 years ago

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

Categories

(Core :: Layout, defect)

x86_64
macOS
defect
Not set
critical

Tracking

()

RESOLVED FIXED
mozilla20

People

(Reporter: jruderman, Assigned: smontagu)

References

Details

(Keywords: assertion, testcase)

Attachments

(3 files)

Assertion failure: !aElement->AncestorHasDirAuto() || child->AncestorHasDirAuto() (AncestorHasDirAuto set on node but not its children), at content/base/src/DirectionalityUtils.cpp:665
Attached file stack
Attached 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: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla20
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: