editor/reftests/xul/platform.js

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 // The appearance of XUL elements is platform-specific, so we set the
     2 // style of the root element according to the platform, so that the
     3 // CSS code inside input.css can select the correct styles for each
     4 // platform.
     6 var id;
     7 var ua = navigator.userAgent;
     9 if (/Windows/.test(ua)) {
    10   id = "win";
    11   if (/NT 5\.1/.test(ua) || /NT 5\.2; Win64/.test(ua))
    12     var classname = "winxp";
    13 }
    14 else if (/Linux/.test(ua))
    15   id = "linux";
    16 else if (/SunOS/.test(ua))
    17   id = "linux";
    18 else if (/Mac OS X/.test(ua))
    19   id = "mac";
    21 if (id)
    22   document.documentElement.setAttribute("id", id);
    23 else
    24   document.documentElement.appendChild(
    25     document.createTextNode("Unrecognized platform")
    26   );
    27 if (classname)
    28   document.documentElement.setAttribute("class", classname);

mercurial