зеркало из https://github.com/mozilla/gecko-dev.git
100 строки
2.4 KiB
HTML
100 строки
2.4 KiB
HTML
<?xml version="1.0"?>
|
|
<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
|
|
|
|
<window title="Stretched controls test reference"
|
|
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
|
xmlns:html="http://www.w3.org/1999/xhtml"
|
|
xmlns:svg="http://www.w3.org/2000/svg"
|
|
orient="vertical"
|
|
class="reftest-wait"
|
|
onload="loaded()">
|
|
|
|
<html:style><![CDATA[
|
|
.regular {
|
|
font: -moz-dialog;
|
|
}
|
|
.small {
|
|
font: message-box;
|
|
}
|
|
.spacer {
|
|
height: 40px;
|
|
}
|
|
.foreground > :nth-child(2) {
|
|
display: none; /* <----- This is the only difference from nostretch.xhtml */
|
|
}
|
|
]]>
|
|
</html:style>
|
|
|
|
<script type="application/javascript"><![CDATA[
|
|
|
|
function cE(elem) {
|
|
return document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", elem);
|
|
}
|
|
function elWithValue(elem, val) {
|
|
let e = cE(elem);
|
|
e.setAttribute(elem == "label" ? "value" : "label", val);
|
|
return e;
|
|
}
|
|
|
|
function allPairs(set) {
|
|
let ps = [];
|
|
for(let i = 0; i < set.length; ++i) {
|
|
for (let j = 0; j < set.length; ++j) {
|
|
if (i != j)
|
|
ps.push([set[i], set[j]]);
|
|
}
|
|
}
|
|
return ps;
|
|
}
|
|
|
|
function createLabel(v) {
|
|
return elWithValue("label", v);
|
|
}
|
|
function createRadio(v) {
|
|
return elWithValue("radio", v);
|
|
}
|
|
function createCheckbox(v) {
|
|
return elWithValue("checkbox", v);
|
|
}
|
|
function createButton(v) {
|
|
return elWithValue("button", v);
|
|
}
|
|
function createMenulist(v) {
|
|
let [list, popup, item] = [cE("menulist"), cE("menupopup"), elWithValue("menuitem", v)];
|
|
item.setAttribute("selected", "true");
|
|
popup.appendChild(item);
|
|
list.appendChild(popup);
|
|
return list;
|
|
}
|
|
function loaded() {
|
|
let template = document.getElementById("template");
|
|
["regular", "small"].forEach(function(size) {
|
|
let wrapper = document.querySelectorAll("#wrapper > ." + size)[0];
|
|
allPairs([
|
|
createButton, createMenulist,
|
|
]).forEach(function(elemList) {
|
|
let newBox = template.cloneNode(true);
|
|
newBox.className = "spacer";
|
|
let foregroundRow = newBox.firstChild;
|
|
elemList.forEach(function(creator) {
|
|
foregroundRow.appendChild(creator("Label"));
|
|
});
|
|
wrapper.appendChild(newBox);
|
|
});
|
|
});
|
|
document.documentElement.className = "";
|
|
}
|
|
|
|
]]></script>
|
|
<vbox id="template">
|
|
<hbox class="foreground"/>
|
|
</vbox>
|
|
<hbox id="wrapper">
|
|
<vbox class="regular" width="500"/>
|
|
<vbox class="small" flex="1"/>
|
|
</hbox>
|
|
|
|
<spacer flex="1"/>
|
|
|
|
</window>
|