[XForms] Expose base bindings for select widgets. Bug 323849, r=doronr+aaronr, patch by surkov@dc.baikal.ru

This commit is contained in:
allan%beaufour.dk 2006-03-27 08:40:13 +00:00
Родитель d0aee47716
Коммит 00078eb11b
5 изменённых файлов: 539 добавлений и 770 удалений

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

@ -18,6 +18,7 @@ xforms.jar:
content/xforms/select1.xml (resources/content/select1.xml)
content/xforms/range.xml (resources/content/range.xml)
content/xforms/select.xml (resources/content/select.xml)
content/xforms/select-xhtml.xml (resources/content/select-xhtml.xml)
content/xforms/bindingex.css (resources/content/bindingex.css)
content/xforms/bindingex.xul (resources/content/bindingex.xul)
content/xforms/calendar.png (resources/content/calendar.png)

Разница между файлами не показана из-за своего большого размера Загрузить разницу

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

@ -127,6 +127,7 @@
getAnonymousElementByAttribute(this, "anonid", 'implicitcontent'),
_explicitContent: this.ownerDocument.
getAnonymousElementByAttribute(this, 'anonid', 'explicitcontent'),
__proto__: this,
set value(val) {
if (val != null) {
@ -136,6 +137,26 @@
this._implicitContent.textContent = '';
this._explicitContent.style.display = 'inline';
}
},
get textValue() {
if (this._explicitContent.style.display == 'none')
return this._implicitContent.textContent;
return this.textContent;
},
get nodeValue() {
var fragment = this.ownerDocument.createDocumentFragment();
var container = null;
if (this._explicitContent.style.display == 'none')
container = this._implicitContent;
else
container = this;
for (var node = container.firstChild; node; node = node.nextSibling) {
fragment.appendChild(node.cloneNode(true));
}
return fragment;
}
};
</body>

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

@ -468,12 +468,18 @@ case > html|div.-moz-xforms-case-container {
}
/* select */
select {
-moz-binding: url('chrome://xforms/content/select.xml#xformswidget-select');
html|*:root select {
-moz-binding: url('chrome://xforms/content/select-xhtml.xml#xformswidget-select-compact');
}
html|*:root select html|span[anonid="control"] {
-moz-binding: url('chrome://xforms/content/select-xhtml.xml#widget-select-compact');
}
select[appearance="full"] {
-moz-binding: url('chrome://xforms/content/select.xml#xformswidget-select-full');
html|*:root select[appearance="full"] {
-moz-binding: url('chrome://xforms/content/select-xhtml.xml#xformswidget-select-full');
}
html|*:root select[appearance="full"] html|span[anonid="control"] {
-moz-binding: url('chrome://xforms/content/select-xhtml.xml#widget-select-full');
}
select html|div.select-choice-label {

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

@ -171,6 +171,7 @@
<destructor>
this._delegate = null;
this._accessors = null;
this._control = null;
</destructor>
<property name="delegate" readonly="true">
@ -216,6 +217,8 @@
method what returns the object:
{
set value(); // set "string" value
get textValue() // return text representing label value
get nodeValue() // return document fragment representing label value
}
-->
<binding id="xformswidget-label-base"
@ -229,6 +232,11 @@
</body>
</method>
<property name="textValue" readonly="true"
onget="return this.control.textValue;"/>
<property name="nodeValue" readonly="true"
onget="return this.control.nodeValue;"/>
</implementation>
</binding>