Followup to bug 151407: use GetDir() on the root element. r=bz

This commit is contained in:
Simon Montagu 2013-04-23 15:12:14 +03:00
Родитель b766680d74
Коммит f80ed0e6b6
1 изменённых файлов: 1 добавлений и 10 удалений

Просмотреть файл

@ -6239,8 +6239,6 @@ nsDocument::GetAnimationController()
return mAnimationController;
}
static const char* dirAttributes[] = { "ltr", "rtl", "auto", 0 };
/**
* Retrieve the "direction" property of the document.
*
@ -6259,14 +6257,7 @@ nsIDocument::GetDir(nsAString& aDirection) const
aDirection.Truncate();
Element* rootElement = GetHtmlElement();
if (rootElement) {
nsAutoString dir;
rootElement->GetAttr(kNameSpaceID_None, nsGkAtoms::dir, dir);
for (uint32_t i = 0; dirAttributes[i]; ++i) {
if (dir.LowerCaseEqualsASCII(dirAttributes[i])) {
aDirection.AssignASCII(dirAttributes[i]);
return;
}
}
static_cast<nsGenericHTMLElement*>(rootElement)->GetDir(aDirection);
}
}