Remove elements from text node directionality map when they cease to have dir=auto, Bug 861610, r=ehsan

This commit is contained in:
Simon Montagu 2013-04-15 23:14:42 +03:00
parent c1ac4fce51
commit 46e88dac69

View File

@ -942,6 +942,11 @@ OnSetDirAttr(Element* aElement, const nsAttrValue* aNewValue,
if (aElement->HasDirAuto()) {
WalkDescendantsSetDirAuto(aElement, aNotify);
} else {
if (aElement->HasDirAutoSet()) {
nsINode* setByNode =
static_cast<nsINode*>(aElement->GetProperty(nsGkAtoms::dirAutoSetBy));
nsTextNodeDirectionalityMap::RemoveElementFromMap(setByNode, aElement);
}
SetDirectionalityOnDescendants(aElement,
RecomputeDirectionality(aElement, aNotify),
aNotify);