Source code

Revision control

Copy as Markdown

Other Tools

Test Info: Warnings

<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
type="text/css"?>
<window title="Mac platform colors"
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=518395">Mozilla Bug 518395</a>
<p id="display"></p>
<div id="content" style="display: none">
</div>
<pre id="test">
</pre>
<box id="colorbox"></box>
</body>
<script class="testbody" type="application/javascript">
<![CDATA[
var colors = {
"activeborder": ["rgb(0, 0, 0)"],
"activecaption": ["rgb(204, 204, 204)"],
"appworkspace": ["rgb(255, 255, 255)"],
"background": ["rgb(99, 99, 206)"],
"buttonface": ["rgb(240, 240, 240)"],
"buttonhighlight": ["rgb(255, 255, 255)"],
"buttonshadow": ["rgb(220, 220, 220)"],
"buttontext": ["rgb(0, 0, 0)"],
"captiontext": ["rgb(0, 0, 0)"],
"graytext": ["rgb(127, 127, 127)"],
"highlight": ["rgb(115, 132, 153)", "rgb(127, 127, 127)", "rgb(56, 117, 215)", "rgb(255, 193, 31)", "rgb(243, 70, 72)", "rgb(255, 138, 34)", "rgb(102, 197, 71)", "rgb(140, 78, 184)"],
"highlighttext": ["rgb(255, 255, 255)", "rgb(255, 254, 254)", "rgb(254, 255, 254)"],
"inactiveborder": ["rgb(255, 255, 255)"],
"inactivecaption": ["rgb(255, 255, 255)"],
"inactivecaptiontext": ["rgb(69, 69, 69)"],
"infobackground": ["rgb(255, 255, 199)"],
"infotext": ["rgb(0, 0, 0)"],
"menu": ["rgb(255, 255, 255)", "rgb(254, 255, 254)", "rgb(255, 254, 254)"],
"menutext": ["rgb(0, 0, 0)"],
"scrollbar": ["rgb(170, 170, 170)"],
"threeddarkshadow": ["rgb(220, 220, 220)"],
"threedface": ["rgb(240, 240, 240)"],
"threedhighlight": ["rgb(255, 255, 255)"],
"threedlightshadow": ["rgb(218, 218, 218)"],
"threedshadow": ["rgb(224, 224, 224)"],
"window": ["rgb(255, 255, 255)"],
"windowframe": ["rgb(204, 204, 204)"],
"windowtext": ["rgb(0, 0, 0)"],
"-moz-activehyperlinktext": ["rgb(238, 0, 0)"],
"-moz-buttonhoverface": ["rgb(240, 240, 240)"],
"-moz-buttonhovertext": ["rgb(0, 0, 0)"],
"-moz-cellhighlight": ["rgb(212, 212, 212)", "rgb(220, 220, 220)"],
"-moz-cellhighlighttext": ["rgb(0, 0, 0)"],
"-moz-eventreerow": ["rgb(255, 255, 255)"],
"-moz-field": ["rgb(255, 255, 255)"],
"-moz-fieldtext": ["rgb(0, 0, 0)"],
"-moz-dialog": ["rgb(232, 232, 232)"],
"-moz-dialogtext": ["rgb(0, 0, 0)"],
"-moz-hyperlinktext": ["rgb(0, 0, 238)"],
"-moz-html-cellhighlight": ["rgb(212, 212, 212)"],
"-moz-html-cellhighlighttext": ["rgb(0, 0, 0)"],
"-moz-buttonactivetext": ["rgb(0, 0, 0)", "rgb(255, 255, 255)"],
"-moz-mac-defaultbuttontext": ["rgb(0, 0, 0)", "rgb(255, 255, 255)"],
//"-moz-mac-focusring": ["rgb(83, 144, 210)", "rgb(95, 112, 130)", "rgb(63, 152, 221)", "rgb(108, 126, 141)"],
"-moz-mac-menutextdisable": ["rgb(152, 152, 152)"],
"-moz-mac-menutextselect": ["rgb(255, 255, 255)"],
"-moz-mac-disabledtoolbartext": ["rgb(127, 127, 127)"],
"-moz-menuhover": ["rgb(115, 132, 153)", "rgb(127, 127, 127)", "rgb(56, 117, 215)", "rgb(255, 193, 31)", "rgb(243, 70, 72)", "rgb(255, 138, 34)", "rgb(102, 197, 71)", "rgb(140, 78, 184)"],
"-moz-menuhovertext": ["rgb(255, 255, 255)", "rgb(255, 254, 254)", "rgb(254, 255, 254)"],
//"-moz-menubarhovertext": ["rgb(255, 255, 255)"],
"-moz-oddtreerow": ["rgb(236, 242, 254)", "rgb(240, 240, 240)", "rgb(243, 245, 250)", "rgb(243, 246, 250)", "rgb(245, 245, 245)"],
"-moz-visitedhyperlinktext": ["rgb(85, 26, 139)"],
"currentcolor": ["rgb(0, 0, 0)"],
"-moz-comboboxtext": ["rgb(0, 0, 0)"],
"-moz-combobox": ["rgb(255, 255, 255)"]
};
var colorbox = document.getElementById('colorbox');
for (var c in colors) {
dump("testing color " + c + "\n");
colorbox.style.backgroundColor = c;
var rgb = document.defaultView.getComputedStyle(colorbox).getPropertyValue('background-color');
ok(colors[c].includes(rgb) || colors[c].length == 8, 'platform color ' + c + ' is wrong: ' + rgb);
}
]]>
</script>
</window>