browser_selectpopup_minFontSize.js (1049B)
1 /* Any copyright is dedicated to the Public Domain. 2 * http://creativecommons.org/publicdomain/zero/1.0/ */ 3 4 // NOTE that this test expects "font.minimum-size.x-western=9" to be set 5 // in the manifest. 6 7 const PAGE = ` 8 <!doctype html> 9 <body lang="en-US"> 10 <select> 11 <option style="font-size:24px">A</option> 12 <option style="font-size:6px">BCD</option> 13 </select> 14 `; 15 16 add_setup(async function () { 17 await SpecialPowers.pushPrefEnv({ 18 set: [["test.wait300msAfterTabSwitch", true]], 19 }); 20 }); 21 22 add_task(async function () { 23 const url = "data:text/html," + encodeURI(PAGE); 24 await BrowserTestUtils.withNewTab( 25 { 26 gBrowser, 27 url, 28 }, 29 async function () { 30 let popup = await openSelectPopup("click"); 31 let menuitems = popup.querySelectorAll("menuitem"); 32 is( 33 getComputedStyle(menuitems[0]).fontSize, 34 "24px", 35 "font-size should be honored" 36 ); 37 is( 38 getComputedStyle(menuitems[1]).fontSize, 39 "9px", 40 "minimum font-size should be honored" 41 ); 42 } 43 ); 44 });