Don't set autodirection on elements like <script>, <style> and <textarea>. Bug 819014.
authorSimon Montagu <smontagu@smontagu.org>
Sun, 23 Dec 2012 00:13:32 -0800
changeset 122513 4aee8b87bea8950b1b05438736df699017e383e5
parent 122512 4f30345471b0fbe40f534aa7a592f0cf78c379cf
child 122514 9f3051733fec0917d7d4bc30e4a8e7aaca4d7362
push idunknown
push userunknown
push dateunknown
bugs819014
milestone20.0a1
Don't set autodirection on elements like <script>, <style> and <textarea>. Bug 819014.
content/base/src/DirectionalityUtils.cpp
--- a/content/base/src/DirectionalityUtils.cpp
+++ b/content/base/src/DirectionalityUtils.cpp
@@ -358,16 +358,19 @@ GetDirectionFromText(const nsTextFragmen
  *            strong directional characters
  * @return the text node containing the character that determined the direction
  */
 static nsINode*
 WalkDescendantsSetDirectionFromText(Element* aElement, bool aNotify = true,
                                        nsINode* aStartAfterNode = nullptr)
 {
   MOZ_ASSERT(aElement, "aElement is null");
+  if (DoesNotParticipateInAutoDirection(aElement)) {
+    return nullptr;
+  }
 
   nsIContent* child;
   if (aStartAfterNode &&
       nsContentUtils::ContentIsDescendantOf(aStartAfterNode, aElement)) {
     nsIContent* firstNode = aStartAfterNode->GetNextNode(aElement);
 
 #ifdef DEBUG
     // In debug builds, assert that aStartAfterNode is correctly set by checking