зеркало из https://github.com/mozilla/gecko-dev.git
[XForms] Support appearance attribute for select1. Bug 303353, r=aaronr+doronr, patch by surkov@dc.baikal.ru
This commit is contained in:
Родитель
6493a984f5
Коммит
d84b65d0ba
|
@ -51,12 +51,12 @@
|
|||
xmlns:xforms="http://www.w3.org/2002/xforms">
|
||||
|
||||
|
||||
<!-- SELECT CONTROLS
|
||||
The section contains xforms select controls implementations for XHTML. All
|
||||
controls are inherited from interface bindings realized in select.xml.
|
||||
<!-- SELECT/SELECT1 CONTROLS
|
||||
The section contains xforms select/select1 controls implementations for XHTML.
|
||||
All controls are inherited from interface bindings realized in select.xml.
|
||||
-->
|
||||
|
||||
<!-- SELECT APPEARANCE='COMPACT' : <DEFAULT> -->
|
||||
<!-- SELECT/SELECT1 APPEARANCE='COMPACT' : <DEFAULT> -->
|
||||
<binding id="xformswidget-select-compact"
|
||||
extends="chrome://xforms/content/select.xml#xformswidget-select-base">
|
||||
<content>
|
||||
|
@ -70,7 +70,7 @@
|
|||
</content>
|
||||
</binding>
|
||||
|
||||
<!-- SELECT APPEARANCE='FULL' -->
|
||||
<!-- SELECT/SELECT1 APPEARANCE='FULL' -->
|
||||
<binding id="xformswidget-select-full"
|
||||
extends="chrome://xforms/content/select.xml#xformswidget-select-base">
|
||||
<content>
|
||||
|
@ -87,11 +87,18 @@
|
|||
</binding>
|
||||
|
||||
|
||||
<!-- CONTROL WIDGETS FOR SELECT/SELECT1 CONTROLS
|
||||
All control widgets are underlying controls for select/select1 and serve to
|
||||
realize functionality needed for select/select1 work in XHTML context. Thease
|
||||
widgets are inherited from 'controlwidget-base' binding and implement the
|
||||
interface what base widget for xforms select/select1 controls ask for. You can
|
||||
find interface description in 'select.xml' file.
|
||||
-->
|
||||
|
||||
|
||||
<!-- CONTROL WIDGETS FOR SELECT CONTROLS
|
||||
The section contains underlying widgets implementations needed for select
|
||||
controls. All underlying widgets implements the interface what base widget
|
||||
for xforms select controls ask for. You can find interface description in
|
||||
'select.xml' file.
|
||||
controls.
|
||||
-->
|
||||
|
||||
<!-- CONTROL WIDGET FOR SELECT APPEARANCE='COMPACT' -->
|
||||
|
@ -315,13 +322,75 @@
|
|||
this.updateInstanceData(false);
|
||||
</handler>
|
||||
|
||||
<!--
|
||||
<!--
|
||||
XXX: need to send DOMFocusIn/DOMFocusOut events
|
||||
XXX: when incremental='false' then model data should be updated on
|
||||
'blur' event for xforms:select only
|
||||
-->
|
||||
|
||||
</handlers>
|
||||
</binding>
|
||||
|
||||
|
||||
<!-- CONTROL WIDGETS FOR SELECT1 CONTROLS
|
||||
The section contains underlying widgets implementations needed for select1
|
||||
controls.
|
||||
-->
|
||||
|
||||
|
||||
<!-- CONTROL WIDGET FOR SELECT1 APPEARANCE='MINIMAL'
|
||||
Now select1 appearance='minimal' control is implemented in select1.xml
|
||||
as separate widget.
|
||||
-->
|
||||
|
||||
|
||||
<!-- CONTROL WIDGET FOR SELECT1 APPEARANCE='COMPACT' -->
|
||||
<binding id="controlwidget-select1-compact"
|
||||
extends="#controlwidget-select-compact">
|
||||
<content>
|
||||
<html:select xbl:inherits="style, accesskey, disabled=readonly"
|
||||
class="xf-value" size="5" anonid="control"/>
|
||||
</content>
|
||||
</binding>
|
||||
|
||||
|
||||
<!-- CONTROL WIDGET FOR SELECT1 APPEARANCE='FULL' -->
|
||||
<binding id="controlwidget-select1-full"
|
||||
extends="#controlwidget-select-full">
|
||||
|
||||
<content>
|
||||
<html:form anonid="control"/>
|
||||
</content>
|
||||
|
||||
<implementation>
|
||||
<method name="appendItem">
|
||||
<parameter name="aLabel"/>
|
||||
<parameter name="aValue"/>
|
||||
<parameter name="aGroup"/>
|
||||
<body>
|
||||
var div = document.createElementNS(this.XHTML_NS, "div");
|
||||
|
||||
var input = document.createElementNS(this.XHTML_NS, "input");
|
||||
input.setAttribute("type", "radio");
|
||||
input.setAttribute("value", aValue);
|
||||
input.setAttribute("name", "radioControlForXFormsSelect1");
|
||||
input.setAttribute("anonid", "wcontrol");
|
||||
if (this.readonly)
|
||||
input.setAttribute('disabled', 'true');
|
||||
div.appendChild(input);
|
||||
|
||||
if (aLabel)
|
||||
div.appendChild(aLabel.cloneNode(true));
|
||||
|
||||
if (aGroup) {
|
||||
aGroup.appendChild(div);
|
||||
} else {
|
||||
this.control.appendChild(div);
|
||||
}
|
||||
|
||||
return div;
|
||||
</body>
|
||||
</method>
|
||||
</implementation>
|
||||
</binding>
|
||||
</bindings>
|
||||
|
|
|
@ -47,9 +47,12 @@ html|*:root contextcontainer,
|
|||
html|*:root group,
|
||||
html|*:root switch,
|
||||
html|*:root case,
|
||||
html|*:root select1 item,
|
||||
html|*:root select1 itemset,
|
||||
html|*:root select1 choices {
|
||||
html|*:root select1:not([appearance]) item,
|
||||
html|*:root select1[appearance='minimal'] item,
|
||||
html|*:root select1:not([appearance]) itemset,
|
||||
html|*:root select1[appearance='minimal'] itemset,
|
||||
html|*:root select1:not([appearance]) choices,
|
||||
html|*:root select1[appearance='minimal'] choices {
|
||||
display: block;
|
||||
}
|
||||
|
||||
|
@ -69,19 +72,19 @@ xul|*:root case {
|
|||
display: -moz-box;
|
||||
}
|
||||
|
||||
xul|*:root select1 item,
|
||||
xul|*:root select1 itemset,
|
||||
xul|*:root select1 choices {
|
||||
display: none;
|
||||
}
|
||||
|
||||
contextcontainer-inline {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
select item,
|
||||
select itemset,
|
||||
select choices {
|
||||
select item, xul|*:root select1 item,
|
||||
html|*:root select1[appearance='compact'] item,
|
||||
html|*:root select1[appearance='full'] item,
|
||||
select itemset, xul|*:root select1 itemset,
|
||||
html|*:root select1[appearance='compact'] itemset,
|
||||
html|*:root select1[appearance='full'] itemset,
|
||||
select choices, xul|*:root select1 choices,
|
||||
html|*:root select1[appearance='compact'] choices,
|
||||
html|*:root select1[appearance='full'] choices {
|
||||
display: none;
|
||||
}
|
||||
|
||||
|
@ -360,10 +363,12 @@ select1 itemset, select itemset {
|
|||
}
|
||||
|
||||
/* select1 appearance='minimal' (default) */
|
||||
html|*:root select1 {
|
||||
html|*:root select1:not([appearance]),
|
||||
html|*:root select1[appearance='minimal'] {
|
||||
-moz-binding: url('chrome://xforms/content/select1.xml#xformswidget-select1');
|
||||
}
|
||||
html|*:root select1 item {
|
||||
html|*:root select1:not([appearance]) item,
|
||||
html|*:root select1[appearance='minimal'] item {
|
||||
-moz-binding: url('chrome://xforms/content/select1.xml#xformswidget-select1-item');
|
||||
white-space : nowrap;
|
||||
}
|
||||
|
@ -371,23 +376,37 @@ html|*:root select1 item {
|
|||
xul|*:root select1 {
|
||||
-moz-binding: url('chrome://xforms/content/select-xul.xml#xformswidget-select-minimal');
|
||||
}
|
||||
xul|*:root select1 xul|box {
|
||||
xul|*:root select1 xul|box[anonid="control"] {
|
||||
-moz-binding: url('chrome://xforms/content/select-xul.xml#controlwidget-select1-minimal');
|
||||
}
|
||||
|
||||
/* select1 appearance='compact' */
|
||||
html|*:root select1[appearance="compact"] {
|
||||
-moz-binding: url('chrome://xforms/content/select-xhtml.xml#xformswidget-select-compact');
|
||||
}
|
||||
html|*:root select1[appearance="compact"] html|span[anonid="control"] {
|
||||
-moz-binding: url('chrome://xforms/content/select-xhtml.xml#controlwidget-select1-compact');
|
||||
}
|
||||
|
||||
xul|*:root select1[appearance="compact"] {
|
||||
-moz-binding: url('chrome://xforms/content/select-xul.xml#xformswidget-select-compact');
|
||||
}
|
||||
xul|*:root select1[appearance="compact"] xul|box{
|
||||
xul|*:root select1[appearance="compact"] xul|box[anonid="control"] {
|
||||
-moz-binding: url('chrome://xforms/content/select-xul.xml#controlwidget-select1-compact');
|
||||
}
|
||||
|
||||
/* select1 appearance='full' */
|
||||
html|*:root select1[appearance="full"] {
|
||||
-moz-binding: url('chrome://xforms/content/select-xhtml.xml#xformswidget-select-full');
|
||||
}
|
||||
html|*:root select1[appearance="full"] html|span[anonid="control"] {
|
||||
-moz-binding: url('chrome://xforms/content/select-xhtml.xml#controlwidget-select1-full');
|
||||
}
|
||||
|
||||
xul|*:root select1[appearance="full"] {
|
||||
-moz-binding: url('chrome://xforms/content/select-xul.xml#xformswidget-select-full');
|
||||
}
|
||||
xul|*:root select1[appearance="full"] xul|box {
|
||||
xul|*:root select1[appearance="full"] xul|box[anonid="control"] {
|
||||
-moz-binding: url('chrome://xforms/content/select-xul.xml#controlwidget-select1-full');
|
||||
}
|
||||
|
||||
|
@ -479,6 +498,7 @@ html|*:root item[_moz_active] {
|
|||
background: Highlight;
|
||||
}
|
||||
|
||||
html|*:root select1:not([appearance]) choices > label,
|
||||
html|*:root select1[appearance='minimal'] choices > label {
|
||||
display: block;
|
||||
font: -moz-list;
|
||||
|
@ -490,8 +510,11 @@ html|*:root select1[appearance='minimal'] choices > label {
|
|||
text-indent: 0;
|
||||
}
|
||||
|
||||
html|*:root select1:not([appearance]) choices > item
|
||||
html|*:root select1[appearance='minimal'] choices > item,
|
||||
html|*:root select1:not([appearance]) choices > itemset,
|
||||
html|*:root select1[appearance='minimal'] choices > itemset,
|
||||
html|*:root select1:not([appearance]) choices > choices,
|
||||
html|*:root select1[appearance='minimal'] choices > choices {
|
||||
padding-left: 20px;
|
||||
font-style: normal;
|
||||
|
@ -524,7 +547,7 @@ html|*:root select[appearance="full"] html|span[anonid="control"] {
|
|||
xul|*:root select[appearance="full"] {
|
||||
-moz-binding: url('chrome://xforms/content/select-xul.xml#xformswidget-select-full');
|
||||
}
|
||||
xul|*:root select[appearance="full"] xul|box {
|
||||
xul|*:root select[appearance="full"] xul|box[anonid="control"] {
|
||||
-moz-binding: url('chrome://xforms/content/select-xul.xml#controlwidget-select-full');
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче