rem:  var b = document.createElement("box"); b.style.width = "1in"; var dpi = window.getComputedStyle(b, null).width.match(/^\d+/); 
add: var dpi = 96; try {  var b = document.createElement("box"); b.style.width = "1in"; dpi = window.getComputedStyle(b, null).width.match(/^\d+/); } catch(ex) { try {  b = document.createElementNS("box", XHTML_NS); b.style.width = "1in"; dpi = window.getComputedStyle(b, null).width.match(/^\d+/); } catch(ex) { } } 
context: function getDefaultFontSize(){    const PREF_CTRID = "@mozilla.org/preferences-service;1";    const nsIPrefService = Components.interfaces.nsIPrefService;    const nsIPrefBranch = Components.interfaces.nsIPrefBranch;        var prefService =        Components.classes[PREF_CTRID].getService(nsIPrefService);    var prefBranch = prefService.getBranch(null);        // PX size pref: font.size.variable.x-western    var pxSize = 16;    try    {        pxSize = prefBranch.getIntPref("font.size.variable.x-western");    }    catch(ex) { }        // Get the DPI the fun way (make Mozilla do the work).    var b = document.createElement("box");    b.style.width = "1in";    var dpi = window.getComputedStyle(b, null).width.match(/^\d+/);        return Math.round((pxSize / dpi) * 72);}
meta: 1567	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/1567/386550f4cdd3cae9c7c46bdcfca817d282b5ddfa/static.js/buggy/xul/content/static.js