toolkit/themes/osx/reftests/nostretch-ref.xul

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/toolkit/themes/osx/reftests/nostretch-ref.xul	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,97 @@
     1.4 +<?xml version="1.0"?>
     1.5 +<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
     1.6 +
     1.7 +<window title="Stretched controls test reference"
     1.8 +        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
     1.9 +        xmlns:html="http://www.w3.org/1999/xhtml"
    1.10 +        xmlns:svg="http://www.w3.org/2000/svg"
    1.11 +        orient="vertical"
    1.12 +        class="reftest-wait"
    1.13 +        onload="loaded()">
    1.14 +
    1.15 +<html:style><![CDATA[
    1.16 +.regular {
    1.17 +  font: -moz-dialog;
    1.18 +}
    1.19 +.small {
    1.20 +  font: message-box;
    1.21 +}
    1.22 +.spacer {
    1.23 +  height: 40px;
    1.24 +}
    1.25 +.foreground > :nth-child(2) {
    1.26 +  display: none; /* <----- This is the only difference from nostretch.xul */
    1.27 +}
    1.28 +]]>
    1.29 +</html:style>
    1.30 +
    1.31 +<script type="application/javascript;version=1.8"><![CDATA[
    1.32 +
    1.33 +function cE(elem) {
    1.34 +  return document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", elem);
    1.35 +}
    1.36 +function elWithValue(elem, val) {
    1.37 +  let e = cE(elem);
    1.38 +  e.setAttribute(elem == "label" || elem == "textbox" ? "value" : "label", val);
    1.39 +  return e;
    1.40 +}
    1.41 +
    1.42 +function allPairs(set) {
    1.43 +  let ps = [];
    1.44 +  for(let i = 0; i < set.length; ++i) {
    1.45 +    for (let j = 0; j < set.length; ++j) {
    1.46 +      if (i != j)
    1.47 +        ps.push([set[i], set[j]]);
    1.48 +    }
    1.49 +  }
    1.50 +  return ps;
    1.51 +}
    1.52 +
    1.53 +function createLabel(v) elWithValue("label", v)
    1.54 +function createRadio(v) elWithValue("radio", v)
    1.55 +function createCheckbox(v) elWithValue("checkbox", v)
    1.56 +function createButton(v) elWithValue("button", v)
    1.57 +function createTextField(v) elWithValue("textbox", v)
    1.58 +function createMenulist(v) {
    1.59 +  let [list, popup, item] = [cE("menulist"), cE("menupopup"), elWithValue("menuitem", v)];
    1.60 +  item.setAttribute("selected", "true");
    1.61 +  popup.appendChild(item);
    1.62 +  list.appendChild(popup);
    1.63 +  return list;
    1.64 +}
    1.65 +function createEditableMenulist(v) {
    1.66 +  let list = createMenulist(v);
    1.67 +  list.setAttribute("editable", "true");
    1.68 +  return list;
    1.69 +}
    1.70 +function loaded() {
    1.71 +  let template = document.getElementById("template");
    1.72 +  ["regular", "small"].forEach(function(size) {
    1.73 +    let wrapper = document.querySelectorAll("#wrapper > ." + size)[0];
    1.74 +    allPairs([
    1.75 +      createButton, createMenulist, createTextField, createEditableMenulist,
    1.76 +    ]).forEach(function(elemList) {
    1.77 +      let newBox = template.cloneNode(true);
    1.78 +      newBox.className = "spacer";
    1.79 +      let foregroundRow = newBox.firstChild;
    1.80 +      elemList.forEach(function(creator) {
    1.81 +        foregroundRow.appendChild(creator("Label"));
    1.82 +      });
    1.83 +      wrapper.appendChild(newBox);
    1.84 +    });
    1.85 +  });
    1.86 +  document.documentElement.className = "";
    1.87 +}
    1.88 +
    1.89 +]]></script>
    1.90 +    <vbox id="template">
    1.91 +      <hbox class="foreground"/>
    1.92 +    </vbox>
    1.93 +  <hbox id="wrapper">
    1.94 +    <vbox class="regular" width="500"/>
    1.95 +    <vbox class="small" flex="1"/>
    1.96 +  </hbox>
    1.97 +
    1.98 +  <spacer flex="1"/>
    1.99 +
   1.100 +</window>

mercurial