Don't set autodirection on elements like <script>, <style> and <textarea>.
Bug 819014.
--- 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