static PLDHashOperator ResetNodeDirection(nsPtrHashKey<Element>* aEntry, void* aData)
 {
   MOZ_ASSERT(aEntry->GetKey()->IsElement(), "Must be an Element");
   // run the downward propagation algorithm
   // and remove the text node from the map
   Element* rootNode = aEntry->GetKey();
   nsINode* textNode = WalkDescendantsSetDirectionFromText(rootNode, true);
   if (textNode) {
     nsTextNodeDirectionalityMap::AddEntryToMap(textNode, rootNode);
   } else {
     rootNode->ClearHasDirAutoSet();
     rootNode->UnsetProperty(nsGkAtoms::dirAutoSetBy);
   }
   return PL_DHASH_REMOVE;
 }