When the text node that set the directionality of an element with dir=auto is removed, and there is no other text node that can set the directionality, clear the dirAutoSetBy property on the element. Bug 815500, r=peterv
authorSimon Montagu <smontagu@smontagu.org>
Sun, 16 Dec 2012 07:35:07 -0800
changeset 125298 1392f08d100085ccc2e64953e050cf3bafea3f0b
parent 125297 3548adeeb1636fb93375195b05ef162414f44972
child 125299 463b740c3e2f77925dc48a47979bcf9fa5d27bba
push id2151
push userlsblakk@mozilla.com
push dateTue, 19 Feb 2013 18:06:57 +0000
treeherdermozilla-beta@4952e88741ec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspeterv
bugs815500
milestone20.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
When the text node that set the directionality of an element with dir=auto is removed, and there is no other text node that can set the directionality, clear the dirAutoSetBy property on the element. Bug 815500, r=peterv
content/base/src/DirectionalityUtils.cpp
--- a/content/base/src/DirectionalityUtils.cpp
+++ b/content/base/src/DirectionalityUtils.cpp
@@ -485,16 +485,19 @@ private:
     // run the downward propagation algorithm
     // and remove the text node from the map
     nsINode* startAfterNode = static_cast<Element*>(aData);
     Element* rootNode = aEntry->GetKey();
     nsINode* textNode = WalkDescendantsSetDirectionFromText(rootNode, true,
                                                             startAfterNode);
     if (textNode) {
       nsTextNodeDirectionalityMap::AddEntryToMap(textNode, rootNode);
+    } else {
+      rootNode->ClearHasDirAutoSet();
+      rootNode->UnsetProperty(nsGkAtoms::dirAutoSetBy);
     }
     return PL_DHASH_REMOVE;
   }
 
 public:
   void UpdateAutoDirection(Directionality aDir)
   {
     mElements.EnumerateEntries(SetNodeDirection, &aDir);