mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 14:22:01 +00:00
Bug 1289970, ensure we don't remove valid Directionality map from textnode, r=ehsan
--HG-- extra : rebase_source : 5d784d52125daf4725cad0f0cf9fe03a8d47577a
This commit is contained in:
parent
a742ff6791
commit
ad6d094330
@ -511,6 +511,12 @@ private:
|
||||
oldTextNode);
|
||||
}
|
||||
if (newTextNode) {
|
||||
nsINode* oldDirAutoSetBy =
|
||||
static_cast<nsTextNode*>(rootNode->GetProperty(nsGkAtoms::dirAutoSetBy));
|
||||
if (oldDirAutoSetBy == newTextNode) {
|
||||
// We're already registered.
|
||||
return OpNext;
|
||||
}
|
||||
nsTextNodeDirectionalityMap::AddEntryToMap(newTextNode, rootNode);
|
||||
} else {
|
||||
rootNode->ClearHasDirAutoSet();
|
||||
@ -684,7 +690,9 @@ WalkDescendantsResetAutoDirection(Element* aElement)
|
||||
if (child->NodeType() == nsIDOMNode::TEXT_NODE &&
|
||||
child->HasTextNodeDirectionalityMap()) {
|
||||
nsTextNodeDirectionalityMap::ResetTextNodeDirection(static_cast<nsTextNode*>(child), nullptr);
|
||||
nsTextNodeDirectionalityMap::EnsureMapIsClearFor(child);
|
||||
// Don't call nsTextNodeDirectionalityMap::EnsureMapIsClearFor(child)
|
||||
// since ResetTextNodeDirection may have kept elements in child's
|
||||
// DirectionalityMap.
|
||||
}
|
||||
child = child->GetNextNode(aElement);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user