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)
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
| Reporter | ||
| Comment 1•12 years ago
           | ||
|   | Assignee | |
| Comment 2•12 years ago
           | ||
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)
|   | Assignee | |
| Updated•12 years ago
           | 
        Attachment #689603 -
        Attachment is patch: true
| Updated•12 years ago
           | 
Assignee: nobody → smontagu
| Comment 3•12 years ago
           | ||
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+
|   | Assignee | |
| Comment 4•12 years ago
           | ||
https://hg.mozilla.org/integration/mozilla-inbound/rev/31a28a59de39
https://hg.mozilla.org/integration/mozilla-inbound/rev/7eb3d3124d24
Flags: in-testsuite+
| Comment 5•12 years ago
           | ||
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.
        
Description
•