Bug 587248 - Part 12: Replace UI.rtl with a static property to make sure that we don't incur any DOM performance penalty when checking it; r=ian a=blocking-betaN+

This commit is contained in:
Ehsan Akhgari 2010-11-10 22:48:42 -05:00
Родитель 9e86366a2d
Коммит 08da81dacb
1 изменённых файлов: 4 добавлений и 4 удалений

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

@ -250,9 +250,7 @@ let UI = {
// Property: rtl
// Returns true if we are in RTL mode, false otherwise
get rtl() {
return document.documentElement.getAttribute("dir") == "rtl";
},
rtl: false,
// Function: reset
// Resets the Panorama view to have just one group with all tabs
@ -369,7 +367,9 @@ let UI = {
_initPageDirection: function UI__initPageDirection() {
let chromeReg = Cc["@mozilla.org/chrome/chrome-registry;1"].
getService(Ci.nsIXULChromeRegistry);
document.documentElement.setAttribute("dir", chromeReg.isLocaleRTL("global") ? "rtl" : "ltr");
let dir = chromeReg.isLocaleRTL("global");
document.documentElement.setAttribute("dir", dir ? "rtl" : "ltr");
this.rtl = dir;
},
// ----------