Assertion failure: "Strong directional characters before aStartAfterNode" with dynamic dir=auto

RESOLVED FIXED in mozilla20

Status

()

--
critical
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: jruderman, Assigned: smontagu)

Tracking

(Blocks: 2 bugs, {assertion, regression, testcase})

Trunk
mozilla20
x86_64
Mac OS X
assertion, regression, testcase
Points:
---
Dependency tree / graph
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(3 attachments)

(Reporter)

Description

6 years ago
Created attachment 693499 [details]
testcase (asserts fatally when loaded)

Assertion failure: GetDirectionFromText(child->GetText()) == eDir_NotSet (Strong directional characters before aStartAfterNode), at content/base/src/DirectionalityUtils.cpp:375
(Reporter)

Comment 1

6 years ago
Created attachment 693500 [details]
stack
(Assignee)

Comment 2

6 years ago
Created attachment 693782 [details] [diff] [review]
Patch

We need to be consistent about which text nodes we look at in the loop in WalkDescendantsSetDirectionFromText and the #ifdef DEBUG pre-loop which looks for text nodes with strong directional characters before aStartAfterNode. Otherwise we get false positives like this. In the testcase there *is* a strong directional character before aStartAfterNode, but it's a descendant of a node with dir=ltr, so it doesn't set the direction of the ancestor div with dir="auto".
Assignee: nobody → smontagu
Attachment #693782 - Flags: review?(ehsan)

Comment 3

6 years ago
Comment on attachment 693782 [details] [diff] [review]
Patch

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

::: content/base/src/DirectionalityUtils.cpp
@@ +382,5 @@
> +      // of their ancestors
> +      if (child->IsElement() &&
> +          (DoesNotParticipateInAutoDirection(child->AsElement()) ||
> +           child->NodeInfo()->Equals(nsGkAtoms::bdi) ||
> +           child->HasFixedDir())) {

Hmm, I think we need to add a utility method for this.  Can you please file a follow-up?
Attachment #693782 - Flags: review?(ehsan) → review+
https://hg.mozilla.org/mozilla-central/rev/4f30345471b0
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Flags: in-testsuite? → in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla20
Keywords: regression
You need to log in before you can comment on or make changes to this bug.