Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | <?xml version="1.0"?> |
michael@0 | 2 | <?xml-stylesheet href="chrome://global/skin" type="text/css"?> |
michael@0 | 3 | |
michael@0 | 4 | <window title="Stretched controls test reference" |
michael@0 | 5 | xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" |
michael@0 | 6 | xmlns:html="http://www.w3.org/1999/xhtml" |
michael@0 | 7 | xmlns:svg="http://www.w3.org/2000/svg" |
michael@0 | 8 | orient="vertical" |
michael@0 | 9 | class="reftest-wait" |
michael@0 | 10 | onload="loaded()"> |
michael@0 | 11 | |
michael@0 | 12 | <html:style><![CDATA[ |
michael@0 | 13 | .regular { |
michael@0 | 14 | font: -moz-dialog; |
michael@0 | 15 | } |
michael@0 | 16 | .small { |
michael@0 | 17 | font: message-box; |
michael@0 | 18 | } |
michael@0 | 19 | .spacer { |
michael@0 | 20 | height: 40px; |
michael@0 | 21 | } |
michael@0 | 22 | .foreground > :nth-child(2) { |
michael@0 | 23 | display: none; /* <----- This is the only difference from nostretch.xul */ |
michael@0 | 24 | } |
michael@0 | 25 | ]]> |
michael@0 | 26 | </html:style> |
michael@0 | 27 | |
michael@0 | 28 | <script type="application/javascript;version=1.8"><![CDATA[ |
michael@0 | 29 | |
michael@0 | 30 | function cE(elem) { |
michael@0 | 31 | return document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", elem); |
michael@0 | 32 | } |
michael@0 | 33 | function elWithValue(elem, val) { |
michael@0 | 34 | let e = cE(elem); |
michael@0 | 35 | e.setAttribute(elem == "label" || elem == "textbox" ? "value" : "label", val); |
michael@0 | 36 | return e; |
michael@0 | 37 | } |
michael@0 | 38 | |
michael@0 | 39 | function allPairs(set) { |
michael@0 | 40 | let ps = []; |
michael@0 | 41 | for(let i = 0; i < set.length; ++i) { |
michael@0 | 42 | for (let j = 0; j < set.length; ++j) { |
michael@0 | 43 | if (i != j) |
michael@0 | 44 | ps.push([set[i], set[j]]); |
michael@0 | 45 | } |
michael@0 | 46 | } |
michael@0 | 47 | return ps; |
michael@0 | 48 | } |
michael@0 | 49 | |
michael@0 | 50 | function createLabel(v) elWithValue("label", v) |
michael@0 | 51 | function createRadio(v) elWithValue("radio", v) |
michael@0 | 52 | function createCheckbox(v) elWithValue("checkbox", v) |
michael@0 | 53 | function createButton(v) elWithValue("button", v) |
michael@0 | 54 | function createTextField(v) elWithValue("textbox", v) |
michael@0 | 55 | function createMenulist(v) { |
michael@0 | 56 | let [list, popup, item] = [cE("menulist"), cE("menupopup"), elWithValue("menuitem", v)]; |
michael@0 | 57 | item.setAttribute("selected", "true"); |
michael@0 | 58 | popup.appendChild(item); |
michael@0 | 59 | list.appendChild(popup); |
michael@0 | 60 | return list; |
michael@0 | 61 | } |
michael@0 | 62 | function createEditableMenulist(v) { |
michael@0 | 63 | let list = createMenulist(v); |
michael@0 | 64 | list.setAttribute("editable", "true"); |
michael@0 | 65 | return list; |
michael@0 | 66 | } |
michael@0 | 67 | function loaded() { |
michael@0 | 68 | let template = document.getElementById("template"); |
michael@0 | 69 | ["regular", "small"].forEach(function(size) { |
michael@0 | 70 | let wrapper = document.querySelectorAll("#wrapper > ." + size)[0]; |
michael@0 | 71 | allPairs([ |
michael@0 | 72 | createButton, createMenulist, createTextField, createEditableMenulist, |
michael@0 | 73 | ]).forEach(function(elemList) { |
michael@0 | 74 | let newBox = template.cloneNode(true); |
michael@0 | 75 | newBox.className = "spacer"; |
michael@0 | 76 | let foregroundRow = newBox.firstChild; |
michael@0 | 77 | elemList.forEach(function(creator) { |
michael@0 | 78 | foregroundRow.appendChild(creator("Label")); |
michael@0 | 79 | }); |
michael@0 | 80 | wrapper.appendChild(newBox); |
michael@0 | 81 | }); |
michael@0 | 82 | }); |
michael@0 | 83 | document.documentElement.className = ""; |
michael@0 | 84 | } |
michael@0 | 85 | |
michael@0 | 86 | ]]></script> |
michael@0 | 87 | <vbox id="template"> |
michael@0 | 88 | <hbox class="foreground"/> |
michael@0 | 89 | </vbox> |
michael@0 | 90 | <hbox id="wrapper"> |
michael@0 | 91 | <vbox class="regular" width="500"/> |
michael@0 | 92 | <vbox class="small" flex="1"/> |
michael@0 | 93 | </hbox> |
michael@0 | 94 | |
michael@0 | 95 | <spacer flex="1"/> |
michael@0 | 96 | |
michael@0 | 97 | </window> |