This commit is contained in:
Boris Zbarsky 2009-01-29 21:42:59 -05:00
Родитель cbd8e29e2a
Коммит a474581eef
5 изменённых файлов: 211 добавлений и 0 удалений

Просмотреть файл

@ -0,0 +1,61 @@
gridlikebox {
margin: 2px 4px;
background-color: -moz-Field;
color: -moz-FieldText;
-moz-binding: url('374719-1-xbl.xml#gridlike');
-moz-user-focus: normal;
-moz-appearance: listbox;
}
gridlikehead {
-moz-binding: url("374719-1-xbl.xml#gridlikehead");
}
gridlikebox > scrollbox > box {
display: -moz-grid;
}
gridlikecols, gridlikehead, gridlikerows, gridlikeboxbody {
display: -moz-grid-group;
}
gridlikecol, gridlikeitem, gridlikeheaditem {
display: -moz-grid-line;
}
gridlikehead {
-moz-box-orient: vertical;
}
gridlikerows {
-moz-box-orient: vertical;
-moz-box-flex: 1;
}
gridlikeboxbody {
-moz-box-orient: vertical;
-moz-box-flex: 1;
}
gridlikecol {
-moz-box-orient: vertical;
min-width: 16px;
}
gridlikeheader {
-moz-binding: url("chrome://global/content/bindings/listbox.xml#listheader");
-moz-box-ordinal-group: 2147483646;
}
gridlikeheader {
-moz-appearance: treeheadercell;
-moz-box-align: center;
border: 2px solid;
-moz-border-top-colors: ThreeDHighlight ThreeDLightShadow;
-moz-border-right-colors: ThreeDDarkShadow ThreeDShadow;
-moz-border-bottom-colors: ThreeDDarkShadow ThreeDShadow;
-moz-border-left-colors: ThreeDHighlight ThreeDLightShadow;
background-color: -moz-Dialog;
color: -moz-DialogText;
padding: 0 4px;
}

Просмотреть файл

@ -0,0 +1,41 @@
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/global.css"
type="text/css"?>
<?xml-stylesheet href="374719-1-css.css"
type="text/css"?>
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<gridlikebox flex="1">
<gridlikecols>
<gridlikecol flex="1"/>
<gridlikecol flex="1"/>
</gridlikecols>
<gridlikehead>
<gridlikeheader label="Col1"/>
<gridlikeheader label="Col2"/>
</gridlikehead>
<gridlikeitem value="hello1">
<gridlikecell><label value="Hello"/></gridlikecell>
<gridlikecell><label value="Hello"/></gridlikecell>
</gridlikeitem>
<gridlikeitem value="aValue">
<gridlikecell><label value="aLabel1"/></gridlikecell>
<gridlikecell><label value="aLabel2"/></gridlikecell>
</gridlikeitem>
<gridlikeitem value="hello2">
<gridlikecell><label value="Hello2"/></gridlikecell>
<gridlikecell><label value="Hello2.1"/></gridlikecell>
</gridlikeitem>
<gridlikeitem value="hello3">
<gridlikecell><label value="Hello592"/></gridlikecell>
<gridlikecell><label value="Hello592.1"/></gridlikecell>
</gridlikeitem>
<gridlikeitem value="hello4">
<gridlikecell><label value="Hello4"/></gridlikecell>
<gridlikecell><label value="Hello4--"/></gridlikecell>
</gridlikeitem>
</gridlikebox>
</window>

Просмотреть файл

@ -0,0 +1,34 @@
<?xml version="1.0"?>
<bindings xmlns="http://www.mozilla.org/xbl"
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:xbl="http://www.mozilla.org/xbl"
xmlns:html="http://www.w3.org/1999/xhtml">
<binding id="gridlike">
<content>
<xul:scrollbox allowevents="true" orient="vertical" anonid="main-box"
flex="1" style="overflow: auto;">
<children includes="gridlikecols">
<xul:gridlikecols>
<xul:gridlikecol flex="1"/>
</xul:gridlikecols>
</children>
<xul:gridlikerows>
<children includes="gridlikehead"/>
<xul:gridlikeboxbody xbl:inherits="rows,size,minheight">
<children includes="gridlikeitem"/>
</xul:gridlikeboxbody>
</xul:gridlikerows>
</xul:scrollbox>
</content>
</binding>
<binding id="gridlikehead">
<content>
<xul:gridlikeheaditem>
<children includes="gridlikeheader"/>
</xul:gridlikeheaditem>
</content>
</binding>
</bindings>

Просмотреть файл

@ -0,0 +1,74 @@
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/global.css"
type="text/css"?>
<?xml-stylesheet href="374719-1-css.css"
type="text/css"?>
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload="test2()">
<script>
function test2()
{
var r = document.getElementById('rbox');
const XULNS =
"http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
var item = document.createElementNS(XULNS, "gridlikeitem");
item.setAttribute("value", "aValue");
var cell1 = document.createElementNS(XULNS, "gridlikecell");
var label1 = document.createElementNS(XULNS, "label");
label1.setAttribute("value", "aLabel1");
label1.setAttribute("flex", "1");
label1.setAttribute("crop", "end");
cell1.appendChild(label1);
item.appendChild(cell1);
var cell2 = document.createElementNS(XULNS, "gridlikecell");
var label2 = document.createElementNS(XULNS, "label");
label2.setAttribute("value", "aLabel2");
label2.setAttribute("flex", "1");
label2.setAttribute("crop", "end");
cell2.appendChild(label2);
item.appendChild(cell2);
var before = document.getElementById("inx");
if (!before)
r.appendChild(item);
else
r.insertBefore(item, before);
}
</script>
<gridlikebox flex="1" id="rbox">
<gridlikecols>
<gridlikecol flex="1"/>
<gridlikecol flex="1"/>
</gridlikecols>
<gridlikehead>
<gridlikeheader label="Col1"/>
<gridlikeheader label="Col2"/>
</gridlikehead>
<gridlikeitem value="hello1">
<gridlikecell><label value="Hello"/></gridlikecell>
<gridlikecell><label value="Hello"/></gridlikecell>
</gridlikeitem>
<gridlikeitem value="hello2" id="inx">
<gridlikecell><label value="Hello2"/></gridlikecell>
<gridlikecell><label value="Hello2.1"/></gridlikecell>
</gridlikeitem>
<gridlikeitem value="hello3">
<gridlikecell><label value="Hello592"/></gridlikecell>
<gridlikecell><label value="Hello592.1"/></gridlikecell>
</gridlikeitem>
<gridlikeitem value="hello4">
<gridlikecell><label value="Hello4"/></gridlikecell>
<gridlikecell><label value="Hello4--"/></gridlikecell>
</gridlikeitem>
</gridlikebox>
</window>

Просмотреть файл

@ -560,6 +560,7 @@ random-if(MOZ_WIDGET_TOOLKIT=="gtk2") == 368020-5.html 368020-5-ref.html # bug 3
== 372768-1.html 372768-1-ref.html
== 373383-1.html 373383-1-ref.html
== 374038-1.xul 374038-1-ref.xul
== 374719-1.xul 374719-1-ref.xul
== 374038-2.xul 374038-2-ref.xul
fails == 374927-1.html 374927-1-ref.html # Was broken by patch for bug 368600; fails until bug 400776 is fixed
== 375716-1.html 375716-1-ref.html