XBL forms experiments. Testing the water to see what XBL can do right now. Not used as part of build. a=ben
This commit is contained in:
Родитель
bd27dca16b
Коммит
ee5d2b7cbe
|
@ -28,7 +28,9 @@ include <$(DEPTH)\config\rules.mak>
|
|||
install:: $(LIBRARY)
|
||||
$(MAKE_INSTALL) htmlbindings.xml $(DIST)\bin\res\builtin
|
||||
$(MAKE_INSTALL) buttonBindings.xml $(DIST)\bin\res\builtin
|
||||
$(MAKE_INSTALL) selectBindings.xml $(DIST)\bin\res\builtin
|
||||
|
||||
clobber::
|
||||
rm -f $(DIST)\bin\res\builtin\htmlbindings.xml
|
||||
rm -f $(DIST)\bin\res\builtin\buttonBindings.xml
|
||||
rm -f $(DIST)\bin\res\builtin\selectBindings.xml
|
||||
|
|
|
@ -0,0 +1,413 @@
|
|||
<?xml version="1.0"?>
|
||||
|
||||
<bindings id="formWidgets"
|
||||
xmlns="http://www.mozilla.org/xbl"
|
||||
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<binding id="select-base">
|
||||
<implementation>
|
||||
<property name="size">
|
||||
<getter>
|
||||
var size = this.getAttribute("size")
|
||||
return !size ? 1 : size;
|
||||
</getter>
|
||||
<setter>
|
||||
this.setAttribute("size", val);
|
||||
return val;
|
||||
</setter>
|
||||
</property>
|
||||
|
||||
<property name="_selectArray">[]</property>
|
||||
<method name="_initSelection">
|
||||
<body>
|
||||
<![CDATA[
|
||||
// Note that here we only initialize a _selectArray[0], as a selection
|
||||
// of more than one option in the case of a regular select is meaningless.
|
||||
var options = this.getElementsByTagName("option");
|
||||
for (var i = 0; i < options.length; ++i) {
|
||||
if (options[i].hasAttribute("selected")) {
|
||||
this._selectArray.push(options[i]);
|
||||
this._selectArray[0].selected = true; // XXX lame
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (this.size == 1 && options.length &&
|
||||
!this._selectArray.length)
|
||||
options[0].selected = true;
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
</implementation>
|
||||
</binding>
|
||||
|
||||
<binding id="select-size" display="xul:tree"
|
||||
extends="resource:///res/builtin/selectBindings.xml#select-base">
|
||||
<implementation>
|
||||
<property name="value" onget="return this.getAttribute('value');">
|
||||
<setter>
|
||||
<![CDATA[
|
||||
var options = this.getElementsByTagName("option");
|
||||
for (var i = 0; i < options.length; ++i) {
|
||||
if (options[i].getAttribute("value") == val)
|
||||
this._selectArray.push(options[i]);
|
||||
}
|
||||
this.setAttribute("value", val);
|
||||
return val;
|
||||
]]>
|
||||
</setter>
|
||||
</property>
|
||||
<property name="disabled" onset="if (val) this.setAttribute('disabled',true);
|
||||
else this.removeAttribute('disabled');
|
||||
return val;"
|
||||
onget="return (this.getAttribute('disabled')=='true');"/>
|
||||
<property name="selectedIndex">
|
||||
<getter>
|
||||
<![CDATA[
|
||||
if (!this._selectArray)
|
||||
return -1;
|
||||
|
||||
var options = this.getElementsByTagName("option");
|
||||
for (var i = 0; i < options.length; ++i) {
|
||||
if (options[i].getAttribute("selected"))
|
||||
return i;
|
||||
}
|
||||
|
||||
return -1;
|
||||
]]>
|
||||
</getter>
|
||||
<setter>
|
||||
<![CDATA[
|
||||
if (val >= 0 && this.hasChildNodes() && this.childNodes[val]) {
|
||||
this.childNodes[val].setAttribute("selected", "true");
|
||||
this._selectArray.push(this.childNodes[val]);
|
||||
}
|
||||
|
||||
return val;
|
||||
]]>
|
||||
</setter>
|
||||
</property>
|
||||
|
||||
<!-- Internal Implementation Methods -->
|
||||
<method name="getElementByAttribute">
|
||||
<parameter name="aAttributeName"/>
|
||||
<parameter name="aAttributeValue"/>
|
||||
<body>
|
||||
<![CDATA[
|
||||
var anonymousNodes = document.getAnonymousNodes(this);
|
||||
for (var i = 0; i < anonymousNodes.length; ++i)
|
||||
return this.recursiveAttributeSearch(anonymousNodes[i], aAttributeName, aAttributeValue);
|
||||
return null;
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
<method name="recursiveAttributeSearch">
|
||||
<parameter name="aNode"/>
|
||||
<parameter name="aAttributeName"/>
|
||||
<parameter name="aAttributeValue"/>
|
||||
<body>
|
||||
<![CDATA[
|
||||
if (aNode) {
|
||||
if (aNode.getAttribute(aAttributeName) == aAttributeValue)
|
||||
return aNode;
|
||||
|
||||
for (var i = 0; i < aNode.childNodes.length; ++i)
|
||||
return this.recursiveAttributeSearch(aNode.childNodes[i], aAttributeName, aAttributeValue);
|
||||
}
|
||||
return null;
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
<method name="_deselectAll">
|
||||
<body>
|
||||
<![CDATA[
|
||||
for (var i = 0; i < this._selectArray.length; ++i) {
|
||||
dump("*** clearing selection for = " + this._selectArray[i].text + "\n");
|
||||
this._selectArray[i].selected = false;
|
||||
}
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
<method name="_adjustSelection">
|
||||
<parameter name="aSelectUp"/>
|
||||
<paramater name="aAdditive"/>
|
||||
<body>
|
||||
<![CDATA[
|
||||
if (this._selectArray.length < 1) return;
|
||||
for (var i = 0; i < this._selectArray.length; ++i) {
|
||||
if (this._selectArray[i] == this.childNodes[this.selectedIndex]) {
|
||||
var currItem = this._selectArray[i];
|
||||
this._deselectAll();
|
||||
var nextItem = aSelectUp ? currItem.previousSibling : currItem.nextSibling;
|
||||
if (nextItem) this.selectedIndex = nextItem.index;
|
||||
break;
|
||||
}
|
||||
}
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
</implementation>
|
||||
<handlers>
|
||||
<handler event="mousedown">
|
||||
<![CDATA[
|
||||
if (event.target.localName != "OPTION")
|
||||
return;
|
||||
|
||||
for (var i = 0; i < this._selectArray.length; ++i)
|
||||
this._selectArray[i].removeAttribute('selected');
|
||||
this._selectArray = [event.target];
|
||||
event.target.setAttribute("selected", "true");
|
||||
]]>
|
||||
</handler>
|
||||
<handler event="command" phase="capturing">
|
||||
<![CDATA[
|
||||
if (event.target.localName == "menuitem")
|
||||
this.selectedItem = event.target;
|
||||
]]>
|
||||
</handler>
|
||||
<handler event="create">
|
||||
<![CDATA[
|
||||
if (event.target.parentNode == this && this.selectedItem) {
|
||||
// Not ready for auto-setting the active child in hierarchies yet.
|
||||
// For now, only do this when the outermost menupopup opens.
|
||||
var menuBox = this.boxObject.QueryInterface(Components.interfaces.nsIMenuBoxObject);
|
||||
menuBox.activeChild = this.selectedItem;
|
||||
}
|
||||
]]>
|
||||
</handler>
|
||||
<handler event="bindingattached" action="this._initSelection()"/>
|
||||
|
||||
<!-- Selection Management -->
|
||||
<handler event="keypress" keycode="vk_up">
|
||||
<![CDATA[
|
||||
if (event.target == this)
|
||||
this._adjustSelection(true);
|
||||
event.preventDefault();
|
||||
]]>
|
||||
</handler>
|
||||
<handler event="keypress" keycode="vk_down">
|
||||
<![CDATA[
|
||||
if (event.target == this)
|
||||
this._adjustSelection(false);
|
||||
event.preventDefault();
|
||||
]]>
|
||||
</handler>
|
||||
|
||||
|
||||
</handlers>
|
||||
</binding>
|
||||
|
||||
<binding id="select" display="xul:menu"
|
||||
extends="resource:///res/builtin/selectBindings.xml#select-base">
|
||||
<implementation>
|
||||
<property name="value" onget="return this.getAttribute('value');">
|
||||
<setter>
|
||||
<![CDATA[
|
||||
var options = this.getElementsByTagName("option");
|
||||
for (var i = 0; i < options.length; ++i) {
|
||||
if (options[i].getAttribute("value") == val)
|
||||
this._selectArray.push(options[i]);
|
||||
}
|
||||
this.setAttribute("value", val);
|
||||
return val;
|
||||
]]>
|
||||
</setter>
|
||||
</property>
|
||||
<property name="disabled">
|
||||
<getter>
|
||||
return this.hasAttribute("disabled");
|
||||
</getter>
|
||||
<setter>
|
||||
if (val == "true") this.setAttribute("disabled", "true");
|
||||
else this.removeAttribute("disabled");
|
||||
return val;
|
||||
</setter>
|
||||
</property>
|
||||
<property name="selectedIndex">
|
||||
<getter>
|
||||
<![CDATA[
|
||||
if (!this._selectArray)
|
||||
return -1;
|
||||
|
||||
var options = this.getElementsByTagName("option");
|
||||
for (var i = 0; i < options.length; ++i) {
|
||||
if (options[i].getAttribute("selected"))
|
||||
return i;
|
||||
}
|
||||
|
||||
return -1;
|
||||
]]>
|
||||
</getter>
|
||||
<setter>
|
||||
<![CDATA[
|
||||
this._selectArray = [];
|
||||
|
||||
if (val >= 0 && this.hasChildNodes() && this.childNodes[val]) {
|
||||
this.childNodes[val].setAttribute("selected", "true");
|
||||
this._selectArray.push(this.childNodes[val]);
|
||||
|
||||
var textDisplayNode = this.getElementByAttribute("selectattr", "text");
|
||||
if (textDisplayNode)
|
||||
textDisplayNode.setAttribute("value", this.childNodes[val].text);
|
||||
}
|
||||
|
||||
return val;
|
||||
]]>
|
||||
</setter>
|
||||
</property>
|
||||
|
||||
<!-- Internal Implementation Methods -->
|
||||
<method name="getElementByAttribute">
|
||||
<parameter name="aAttributeName"/>
|
||||
<parameter name="aAttributeValue"/>
|
||||
<body>
|
||||
<![CDATA[
|
||||
var anonymousNodes = document.getAnonymousNodes(this);
|
||||
for (var i = 0; i < anonymousNodes.length; ++i)
|
||||
return this.recursiveAttributeSearch(anonymousNodes[i], aAttributeName, aAttributeValue);
|
||||
return null;
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
<method name="recursiveAttributeSearch">
|
||||
<parameter name="aNode"/>
|
||||
<parameter name="aAttributeName"/>
|
||||
<parameter name="aAttributeValue"/>
|
||||
<body>
|
||||
<![CDATA[
|
||||
if (aNode) {
|
||||
if (aNode.getAttribute(aAttributeName) == aAttributeValue)
|
||||
return aNode;
|
||||
|
||||
for (var i = 0; i < aNode.childNodes.length; ++i)
|
||||
return this.recursiveAttributeSearch(aNode.childNodes[i], aAttributeName, aAttributeValue);
|
||||
}
|
||||
return null;
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
</implementation>
|
||||
<handlers>
|
||||
<handler event="command" phase="capturing">
|
||||
<![CDATA[
|
||||
if (event.target.localName == "OPTION")
|
||||
this.selectedIndex = event.target.index;
|
||||
]]>
|
||||
</handler>
|
||||
<handler event="create">
|
||||
<![CDATA[
|
||||
if (event.target == this && this._selectArray.length) {
|
||||
// Not ready for auto-setting the active child in hierarchies yet.
|
||||
// For now, only do this when the outermost menupopup opens.
|
||||
var boxObject = document.getBoxObjectFor(this);
|
||||
var menuBox = boxObject.QueryInterface(Components.interfaces.nsIMenuBoxObject);
|
||||
menuBox.activeChild = this._selectArray[0];
|
||||
}
|
||||
|
||||
if (this._selectArray[0])
|
||||
this.childNodes[this.selectedIndex].setAttribute("menuactive", "true");
|
||||
]]>
|
||||
</handler>
|
||||
<handler event="mouseover">
|
||||
<![CDATA[
|
||||
if (event.target.localName == "OPTION") {
|
||||
var oldactive = this.getElementByAttribute("menuactive", "true");
|
||||
if (oldactive)
|
||||
oldactive.removeAttribute("menuactive");
|
||||
}
|
||||
]]>
|
||||
</handler>
|
||||
<handler event="bindingattached" action="this._initSelection()"/>
|
||||
</handlers>
|
||||
</binding>
|
||||
|
||||
<binding id="option" display="xul:menuitem"
|
||||
extends="resource:///res/builtin/selectBindings.xml#option-base"/>
|
||||
|
||||
<binding id="option-size" display="xul:treerow"
|
||||
extends="resource:///res/builtin/selectBindings.xml#option-base"/>
|
||||
|
||||
<binding id="option-base">
|
||||
<implementation>
|
||||
<property name="form" readonly="true"/>
|
||||
|
||||
<property name="defaultSelected">false</property>
|
||||
|
||||
<property name="text" readonly="true">
|
||||
<getter>
|
||||
<![CDATA[
|
||||
var textString = "";
|
||||
if (this.hasChildNodes()) {
|
||||
for (var i = 0; i < this.childNodes.length; ++i)
|
||||
textString += this.childNodes[i].nodeValue;
|
||||
}
|
||||
return textString;
|
||||
]]>
|
||||
</getter>
|
||||
</property>
|
||||
|
||||
<property name="index" readonly="true">
|
||||
<getter>
|
||||
<![CDATA[
|
||||
var parent = this.parentNode;
|
||||
// bail on supporting optgroup at this juncture.
|
||||
if (!parent) return -1;
|
||||
|
||||
for (var i = 0; i < parent.childNodes.length; ++i) {
|
||||
if (parent.childNodes[i] == this)
|
||||
return i;
|
||||
}
|
||||
return -1;
|
||||
]]>
|
||||
</getter>
|
||||
</property>
|
||||
|
||||
<property name="disabled">
|
||||
<getter>
|
||||
return this.hasAttribute("disabled");
|
||||
</getter>
|
||||
<setter>
|
||||
if (val) this.setAttribute("disabled", "true");
|
||||
else this.removeAttribute("disabled");
|
||||
</setter>
|
||||
</property>
|
||||
|
||||
<property name="label">
|
||||
<getter>
|
||||
return this.getAttribute("label");
|
||||
</getter>
|
||||
<setter>
|
||||
this.setAttribute("label", val);
|
||||
return val;
|
||||
</setter>
|
||||
</property>
|
||||
|
||||
<property name="selected">
|
||||
<getter>
|
||||
return this.hasAttribute("selected");
|
||||
</getter>
|
||||
<setter>
|
||||
var parent = this.parentNode;
|
||||
if (parent)
|
||||
parent.selectedIndex = this.index;
|
||||
return val;
|
||||
</setter>
|
||||
</property>
|
||||
|
||||
<property name="value">
|
||||
<getter>
|
||||
return this.getAttribute("value");
|
||||
</getter>
|
||||
<setter>
|
||||
this.setAttribute("value", val);
|
||||
return val;
|
||||
</setter>
|
||||
</property>
|
||||
|
||||
<property name="_textNode">
|
||||
|
||||
</property>
|
||||
</implementation>
|
||||
</binding>
|
||||
|
||||
</bindings>
|
||||
|
|
@ -1,3 +1,27 @@
|
|||
/*
|
||||
* The contents of this file are subject to the Netscape Public
|
||||
* License Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* David Hyatt & Ben Goodger
|
||||
*/
|
||||
|
||||
@namespace url(http://www.w3.org/1999/xhtml); /* set default namespace to HTML */
|
||||
|
||||
button, input[type="button"], input[type="submit"], input[type="reset"]
|
||||
{
|
||||
border-left : 1px solid threedface;
|
||||
|
|
|
@ -26,11 +26,17 @@ include <$(DEPTH)\config\rules.mak>
|
|||
install:: $(LIBRARY)
|
||||
$(MAKE_INSTALL) platformHTMLBindings.xml $(DIST)\bin\res\builtin
|
||||
$(MAKE_INSTALL) platformButtonBindings.xml $(DIST)\bin\res\builtin
|
||||
$(MAKE_INSTALL) platformSelectBindings.xml $(DIST)\bin\res\builtin
|
||||
$(MAKE_INSTALL) xbl-forms.css $(DIST)\bin\res\builtin
|
||||
$(MAKE_INSTALL) buttons.css $(DIST)\bin\res\builtin
|
||||
$(MAKE_INSTALL) buttons.css $(DIST)\bin\res\builtin
|
||||
$(MAKE_INSTALL) select.css $(DIST)\bin\res\builtin
|
||||
$(MAKE_INSTALL) textfields.css $(DIST)\bin\res\builtin
|
||||
|
||||
clobber::
|
||||
rm -f $(DIST)\bin\res\builtin\platformHTMLBindings.xml
|
||||
rm -f $(DIST)\bin\res\builtin\platformButtonBindings.xml
|
||||
rm -f $(DIST)\bin\res\builtin\platformSelectBindings.xml
|
||||
rm -f $(DIST)\bin\res\builtin\xbl-forms.css
|
||||
rm -f $(DIST)\bin\res\builtin\buttons.css
|
||||
rm -f $(DIST)\bin\res\builtin\buttons.css
|
||||
rm -f $(DIST)\bin\res\builtin\select.css
|
||||
rm -f $(DIST)\bin\res\builtin\textfields.css
|
||||
|
|
|
@ -28,4 +28,5 @@
|
|||
</content>
|
||||
</binding>
|
||||
|
||||
</bindings>
|
||||
</bindings>
|
||||
|
||||
|
|
|
@ -5,6 +5,11 @@
|
|||
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<binding id="inputFields" extends="resource:///res/builtin/htmlBindings.xml#inputFieldsBase">
|
||||
<!-- <content>
|
||||
<xul:box class="text-input-internal-box">
|
||||
<html:input class="text-input" flex="1" inherits="onfocus,onblur,value,type,maxlength,disabled,size,readonly"/>
|
||||
</xul:box>
|
||||
</content>-->
|
||||
<handlers>
|
||||
<handler event="keypress" keycode="VK_UP" command="cmd_charPrevious"/>
|
||||
<handler event="keypress" keycode="VK_DOWN" command="cmd_charNext"/>
|
||||
|
|
|
@ -0,0 +1,83 @@
|
|||
<?xml version="1.0"?>
|
||||
|
||||
<bindings id="selectBindings"
|
||||
xmlns="http://www.mozilla.org/xbl"
|
||||
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<binding id="select-size" extends="resource:///res/builtin/selectBindings.xml#select-size">
|
||||
<content>
|
||||
<xul:treecolgroup>
|
||||
<xul:treecol flex="1"/>
|
||||
</xul:treecolgroup>
|
||||
<xul:treerows class="select-container-treerows" flex="1">
|
||||
<xul:treechildren flex="1" outer="true" treeitem="optgroup" treerow="option"
|
||||
sizemode="true" style="-moz-binding: none; overflow: -moz-scrollbars-vertical;">
|
||||
<children/> <!-- includes="optgroup|option" -->
|
||||
</xul:treechildren>
|
||||
</xul:treerows>
|
||||
</content>
|
||||
</binding>
|
||||
|
||||
<binding id="option-size" extends="resource:///res/builtin/selectBindings.xml#option-size">
|
||||
<!-- extends="resource:///res/builtin/selectBindings.xml#option-size"> -->
|
||||
<content includes="*">
|
||||
<xul:treecell style="-moz-binding: none;">
|
||||
<!--xul:treeindentation/-->
|
||||
<xul:text inherits="value=xbl:text,value=label"/>
|
||||
</xul:treecell>
|
||||
</content>
|
||||
</binding>
|
||||
|
||||
<binding id="optgroup-size" extends="xul:treeitem">
|
||||
<!-- extends="resource:///res/builtin/selectBindings.xml#optgroup-size"> -->
|
||||
<content open="true">
|
||||
<xul:treerow>
|
||||
<xul:treecell style="-moz-binding: none;">
|
||||
<!--xul:treeindentation/-->
|
||||
<xul:text inherits="value=label" flex="1" crop="right"/>
|
||||
</xul:treecell>
|
||||
</xul:treerow>
|
||||
<xul:treechildren>
|
||||
<children/> <!-- includes="optgroup|option" -->
|
||||
</xul:treechildren>
|
||||
</content>
|
||||
</binding>
|
||||
|
||||
<binding id="select" extends="resource:///res/builtin/selectBindings.xml#select">
|
||||
<content sizetopopup="true">
|
||||
<xul:box class="select-menulist-internal-box" flex="1">
|
||||
<xul:box class="select-menulist-display-box" flex="1" valign="middle" autostretch="never">
|
||||
<xul:text value="[[[[[MENULIST!]]]]]" class="select-menulist-text"
|
||||
selectattr="text" inherits="accesskey" crop="right" flex="1"/>
|
||||
</xul:box>
|
||||
<xul:box class="select-menulist-dropmarker-box-1" valign="middle" inherits="open">
|
||||
<xul:box class="select-menulist-dropmarker-box-2" flex="1" autostretch="never" valign="middle" inherits="open">
|
||||
<xul:image class="select-menulist-dropmarker" inherits="disabled"/>
|
||||
</xul:box>
|
||||
</xul:box>
|
||||
</xul:box>
|
||||
<xul:menupopup class="select-menulist-menupopup" style="-moz-binding: none;" menugenerated="true">
|
||||
<xul:box class="select-menulistpopup-internal-box" orient="vertical" flex="1" style="overflow: auto">
|
||||
<children/>
|
||||
</xul:box>
|
||||
</xul:menupopup>
|
||||
</content>
|
||||
</binding>
|
||||
|
||||
<binding id="option" extends="resource:///res/builtin/selectBindings.xml#option">
|
||||
<content includes="*">
|
||||
<xul:text inherits="value=xbl:text,value=label" crop="right"/>
|
||||
</content>
|
||||
</binding>
|
||||
|
||||
<binding id="optgroup" extends="xul:menu">
|
||||
<!-- extends="resource:///res/builtin/selectBindings.xml#optgroup-size"> -->
|
||||
<content includes="*">
|
||||
<xul:text inherits="value=xbl:text,value=label" crop="right"/>
|
||||
<xul:menupopup style="overflow:auto; -moz-binding: none;" menugenerated="true">
|
||||
<children/>
|
||||
</xul:menupopup>
|
||||
</content>
|
||||
</binding>
|
||||
|
||||
</bindings>
|
|
@ -0,0 +1,169 @@
|
|||
/*
|
||||
* The contents of this file are subject to the Netscape Public
|
||||
* License Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* David Hyatt & Ben Goodger
|
||||
*/
|
||||
|
||||
@namespace url(http://www.w3.org/1999/xhtml); /* set default namespace to HTML */
|
||||
|
||||
select[size]
|
||||
{
|
||||
margin : 0px;
|
||||
}
|
||||
|
||||
.select-container-treerows
|
||||
{
|
||||
border-left : 1px solid threeddarkshadow;
|
||||
border-top : 1px solid threeddarkshadow;
|
||||
border-right : 1px solid threedface;
|
||||
border-bottom : 1px solid threedface;
|
||||
}
|
||||
|
||||
option
|
||||
{
|
||||
font : button;
|
||||
border : 1px solid transparent;
|
||||
color : windowtext;
|
||||
}
|
||||
|
||||
/*
|
||||
select option[selected]
|
||||
{
|
||||
background-color : highlight;
|
||||
color : highlighttext;
|
||||
}
|
||||
*/
|
||||
|
||||
/* menulist based select */
|
||||
|
||||
select, select[size="1"]
|
||||
{
|
||||
border-left : 1px solid threedshadow;
|
||||
border-top : 1px solid threedshadow;
|
||||
border-right : 1px solid threedhighlight;
|
||||
border-bottom : 1px solid threedhighlight;
|
||||
background-color : -moz-field;
|
||||
color : menutext;
|
||||
font : pull-down-menu;
|
||||
margin : 1px 5px 2px 5px;
|
||||
}
|
||||
|
||||
select[disabled]
|
||||
{
|
||||
background-color : threedface;
|
||||
}
|
||||
|
||||
/* icon display frame */
|
||||
.select-menulist-internal-box
|
||||
{
|
||||
border-left : 1px solid threeddarkshadow;
|
||||
border-top : 1px solid threeddarkshadow;
|
||||
border-right : 1px solid threedface;
|
||||
border-bottom : 1px solid threedface;
|
||||
-moz-user-focus : ignore;
|
||||
}
|
||||
|
||||
.select-menulist-display-box,
|
||||
select[open="true"]:focus > .select-menulist-internal-box > .select-menulist-display-box
|
||||
{
|
||||
border : 1px solid transparent;
|
||||
margin : 1px;
|
||||
background-color : -moz-field;
|
||||
color : menutext;
|
||||
}
|
||||
|
||||
select:focus > .select-menulist-internal-box > .select-menulist-display-box
|
||||
{
|
||||
border : 1px dotted #F5DB95;
|
||||
background-color : highlight;
|
||||
color : highlighttext;
|
||||
}
|
||||
|
||||
/* text display frame */
|
||||
.select-menulist-text
|
||||
{
|
||||
padding : 0px 2px 0px 1px;
|
||||
margin : 0px;
|
||||
}
|
||||
|
||||
/* drop marker display frame */
|
||||
.select-menulist-dropmarker-box-1
|
||||
{
|
||||
border-top : 1px solid threedface;
|
||||
border-left : 1px solid threedface;
|
||||
border-bottom : 1px solid threeddarkshadow;
|
||||
border-right : 1px solid threeddarkshadow;
|
||||
background-color : threedface;
|
||||
}
|
||||
|
||||
.select-menulist-dropmarker-box-2
|
||||
{
|
||||
border-top : 1px solid threedhighlight;
|
||||
border-left : 1px solid threedhighlight;
|
||||
border-bottom : 1px solid threedshadow;
|
||||
border-right : 1px solid threedshadow;
|
||||
padding : 2px 1px 2px 1px;
|
||||
}
|
||||
|
||||
.select-menulist-dropmarker
|
||||
{
|
||||
list-style-image : url("chrome://global/skin/scroll-down.gif");
|
||||
}
|
||||
|
||||
.select-menulist-dropmarker[disabled="true"]
|
||||
{
|
||||
list-style-image : url("chrome://global/skin/scroll-down-disabled.gif");
|
||||
padding : 2px;
|
||||
}
|
||||
|
||||
select:hover:active > .select-menulist-internal-box > .select-menulist-dropmarker-box-1[open="true"]
|
||||
{
|
||||
border : 1px solid threedshadow;
|
||||
}
|
||||
|
||||
select:hover:active > .select-menulist-internal-box > .select-menulist-dropmarker-box-1 > .select-menulist-dropmarker-box-2[open="true"]
|
||||
{
|
||||
border : 1px solid threedface;
|
||||
padding : 3px 0px 1px 2px;
|
||||
}
|
||||
|
||||
/* rules for popups and separators associated with menulists */
|
||||
select > .select-menulist-menupopup
|
||||
{
|
||||
background-color : -moz-field;
|
||||
border : 1px solid #000000;
|
||||
min-width : 0px;
|
||||
}
|
||||
|
||||
select > option
|
||||
{
|
||||
padding : 0px 7px !important;
|
||||
min-width : 0px; /* should be in content*/
|
||||
max-width : none; /* should be in content*/
|
||||
border : 1px solid transparent;
|
||||
}
|
||||
|
||||
select:focus > option[menuactive="true"]
|
||||
{
|
||||
border : 1px dotted #F5DB95;
|
||||
background-color : highlight;
|
||||
color : highlighttext;
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
/*
|
||||
* The contents of this file are subject to the Netscape Public
|
||||
* License Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* David Hyatt & Ben Goodger
|
||||
*/
|
||||
|
||||
@namespace url(http://www.w3.org/1999/xhtml); /* set default namespace to HTML */
|
||||
|
||||
input
|
||||
{
|
||||
background-color : -moz-field;
|
||||
border-left : 1px solid threedshadow;
|
||||
border-top : 1px solid threedshadow;
|
||||
border-right : 1px solid threedhighlight;
|
||||
border-bottom : 1px solid threedhighlight;
|
||||
color : windowtext;
|
||||
font : window;
|
||||
}
|
||||
|
||||
.text-input-internal-box
|
||||
{
|
||||
border-left : 1px solid threeddarkshadow;
|
||||
border-top : 1px solid threeddarkshadow;
|
||||
border-right : 1px solid threedface;
|
||||
border-bottom : 1px solid threedface;
|
||||
}
|
||||
|
|
@ -17,8 +17,11 @@
|
|||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* David Hyatt & Ben Goodger
|
||||
*/
|
||||
@import url(resource:/res/builtin/textfields.css);
|
||||
@import url(resource:/res/builtin/buttons.css);
|
||||
@import url(resource:/res/builtin/select.css);
|
||||
|
||||
@namespace url(http://www.w3.org/1999/xhtml); /* set default namespace to HTML */
|
||||
|
||||
|
@ -30,20 +33,80 @@
|
|||
input[type="image"],
|
||||
input[type="checkbox"],
|
||||
input[type="radio"],
|
||||
select, fieldset, legend {
|
||||
display: none;
|
||||
fieldset, legend, select {
|
||||
display : none;
|
||||
}
|
||||
|
||||
input {
|
||||
-moz-user-focus: normal;
|
||||
}
|
||||
input, input[type="text"], input[type="password"]
|
||||
{
|
||||
cursor : text;
|
||||
text-align : start;
|
||||
vertical-align : bottom;
|
||||
-moz-box-sizing : border-box;
|
||||
-moz-user-focus : normal;
|
||||
-moz-binding : url("resource:///res/builtin/platformHTMLBindings.xml#inputFields");
|
||||
}
|
||||
|
||||
.input-inner
|
||||
{
|
||||
-moz-binding : none;
|
||||
}
|
||||
|
||||
button
|
||||
{
|
||||
-moz-binding : url("resource:///res/builtin/platformButtonBindings.xml#button");
|
||||
}
|
||||
{
|
||||
-moz-binding : url("resource:///res/builtin/platformButtonBindings.xml#button");
|
||||
}
|
||||
|
||||
input[type="button"],input[type="submit"],input[type="reset"] {
|
||||
-moz-binding : url("resource:///res/builtin/platformButtonBindings.xml#inputButton");
|
||||
-moz-binding : url("resource:///res/builtin/platformButtonBindings.xml#inputButton");
|
||||
cursor : default;
|
||||
}
|
||||
|
||||
/**
|
||||
<select/> Widget
|
||||
**/
|
||||
|
||||
select[size]
|
||||
{
|
||||
-moz-binding : url("resource:///res/builtin/platformSelectBindings.xml#select-size");
|
||||
}
|
||||
|
||||
select, select[size="1"]
|
||||
{
|
||||
-moz-user-focus : normal;
|
||||
-moz-user-select : none;
|
||||
-moz-binding : url("resource:///res/builtin/platformSelectBindings.xml#select");
|
||||
display : inline;
|
||||
}
|
||||
|
||||
/* <select size=">1"/> */
|
||||
|
||||
select[size] > optgroup,
|
||||
select[size] > option,
|
||||
select[size] optgroup[open="true"] > option,
|
||||
select[size] optgroup[open="true"] > optgroup
|
||||
{
|
||||
display : block !important;
|
||||
}
|
||||
|
||||
select[size] optgroup
|
||||
{
|
||||
-moz-binding : url("resource:///res/builtin/platformSelectBindings.xml#optgroup-size");
|
||||
}
|
||||
|
||||
select[size] option
|
||||
{
|
||||
-moz-binding : url("resource:///res/builtin/platformSelectBindings.xml#option-size");
|
||||
}
|
||||
|
||||
select optgroup, select[size="1"] optgroup
|
||||
{
|
||||
-moz-binding : url("resource:///res/builtin/platformSelectBindings.xml#optgroup");
|
||||
}
|
||||
|
||||
select option, select[size="1"] option
|
||||
{
|
||||
-moz-binding : url("resource:///res/builtin/platformSelectBindings.xml#option");
|
||||
}
|
||||
|
||||
|
|
@ -28,7 +28,9 @@ include <$(DEPTH)\config\rules.mak>
|
|||
install:: $(LIBRARY)
|
||||
$(MAKE_INSTALL) htmlbindings.xml $(DIST)\bin\res\builtin
|
||||
$(MAKE_INSTALL) buttonBindings.xml $(DIST)\bin\res\builtin
|
||||
$(MAKE_INSTALL) selectBindings.xml $(DIST)\bin\res\builtin
|
||||
|
||||
clobber::
|
||||
rm -f $(DIST)\bin\res\builtin\htmlbindings.xml
|
||||
rm -f $(DIST)\bin\res\builtin\buttonBindings.xml
|
||||
rm -f $(DIST)\bin\res\builtin\selectBindings.xml
|
||||
|
|
|
@ -0,0 +1,413 @@
|
|||
<?xml version="1.0"?>
|
||||
|
||||
<bindings id="formWidgets"
|
||||
xmlns="http://www.mozilla.org/xbl"
|
||||
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<binding id="select-base">
|
||||
<implementation>
|
||||
<property name="size">
|
||||
<getter>
|
||||
var size = this.getAttribute("size")
|
||||
return !size ? 1 : size;
|
||||
</getter>
|
||||
<setter>
|
||||
this.setAttribute("size", val);
|
||||
return val;
|
||||
</setter>
|
||||
</property>
|
||||
|
||||
<property name="_selectArray">[]</property>
|
||||
<method name="_initSelection">
|
||||
<body>
|
||||
<![CDATA[
|
||||
// Note that here we only initialize a _selectArray[0], as a selection
|
||||
// of more than one option in the case of a regular select is meaningless.
|
||||
var options = this.getElementsByTagName("option");
|
||||
for (var i = 0; i < options.length; ++i) {
|
||||
if (options[i].hasAttribute("selected")) {
|
||||
this._selectArray.push(options[i]);
|
||||
this._selectArray[0].selected = true; // XXX lame
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (this.size == 1 && options.length &&
|
||||
!this._selectArray.length)
|
||||
options[0].selected = true;
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
</implementation>
|
||||
</binding>
|
||||
|
||||
<binding id="select-size" display="xul:tree"
|
||||
extends="resource:///res/builtin/selectBindings.xml#select-base">
|
||||
<implementation>
|
||||
<property name="value" onget="return this.getAttribute('value');">
|
||||
<setter>
|
||||
<![CDATA[
|
||||
var options = this.getElementsByTagName("option");
|
||||
for (var i = 0; i < options.length; ++i) {
|
||||
if (options[i].getAttribute("value") == val)
|
||||
this._selectArray.push(options[i]);
|
||||
}
|
||||
this.setAttribute("value", val);
|
||||
return val;
|
||||
]]>
|
||||
</setter>
|
||||
</property>
|
||||
<property name="disabled" onset="if (val) this.setAttribute('disabled',true);
|
||||
else this.removeAttribute('disabled');
|
||||
return val;"
|
||||
onget="return (this.getAttribute('disabled')=='true');"/>
|
||||
<property name="selectedIndex">
|
||||
<getter>
|
||||
<![CDATA[
|
||||
if (!this._selectArray)
|
||||
return -1;
|
||||
|
||||
var options = this.getElementsByTagName("option");
|
||||
for (var i = 0; i < options.length; ++i) {
|
||||
if (options[i].getAttribute("selected"))
|
||||
return i;
|
||||
}
|
||||
|
||||
return -1;
|
||||
]]>
|
||||
</getter>
|
||||
<setter>
|
||||
<![CDATA[
|
||||
if (val >= 0 && this.hasChildNodes() && this.childNodes[val]) {
|
||||
this.childNodes[val].setAttribute("selected", "true");
|
||||
this._selectArray.push(this.childNodes[val]);
|
||||
}
|
||||
|
||||
return val;
|
||||
]]>
|
||||
</setter>
|
||||
</property>
|
||||
|
||||
<!-- Internal Implementation Methods -->
|
||||
<method name="getElementByAttribute">
|
||||
<parameter name="aAttributeName"/>
|
||||
<parameter name="aAttributeValue"/>
|
||||
<body>
|
||||
<![CDATA[
|
||||
var anonymousNodes = document.getAnonymousNodes(this);
|
||||
for (var i = 0; i < anonymousNodes.length; ++i)
|
||||
return this.recursiveAttributeSearch(anonymousNodes[i], aAttributeName, aAttributeValue);
|
||||
return null;
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
<method name="recursiveAttributeSearch">
|
||||
<parameter name="aNode"/>
|
||||
<parameter name="aAttributeName"/>
|
||||
<parameter name="aAttributeValue"/>
|
||||
<body>
|
||||
<![CDATA[
|
||||
if (aNode) {
|
||||
if (aNode.getAttribute(aAttributeName) == aAttributeValue)
|
||||
return aNode;
|
||||
|
||||
for (var i = 0; i < aNode.childNodes.length; ++i)
|
||||
return this.recursiveAttributeSearch(aNode.childNodes[i], aAttributeName, aAttributeValue);
|
||||
}
|
||||
return null;
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
<method name="_deselectAll">
|
||||
<body>
|
||||
<![CDATA[
|
||||
for (var i = 0; i < this._selectArray.length; ++i) {
|
||||
dump("*** clearing selection for = " + this._selectArray[i].text + "\n");
|
||||
this._selectArray[i].selected = false;
|
||||
}
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
<method name="_adjustSelection">
|
||||
<parameter name="aSelectUp"/>
|
||||
<paramater name="aAdditive"/>
|
||||
<body>
|
||||
<![CDATA[
|
||||
if (this._selectArray.length < 1) return;
|
||||
for (var i = 0; i < this._selectArray.length; ++i) {
|
||||
if (this._selectArray[i] == this.childNodes[this.selectedIndex]) {
|
||||
var currItem = this._selectArray[i];
|
||||
this._deselectAll();
|
||||
var nextItem = aSelectUp ? currItem.previousSibling : currItem.nextSibling;
|
||||
if (nextItem) this.selectedIndex = nextItem.index;
|
||||
break;
|
||||
}
|
||||
}
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
</implementation>
|
||||
<handlers>
|
||||
<handler event="mousedown">
|
||||
<![CDATA[
|
||||
if (event.target.localName != "OPTION")
|
||||
return;
|
||||
|
||||
for (var i = 0; i < this._selectArray.length; ++i)
|
||||
this._selectArray[i].removeAttribute('selected');
|
||||
this._selectArray = [event.target];
|
||||
event.target.setAttribute("selected", "true");
|
||||
]]>
|
||||
</handler>
|
||||
<handler event="command" phase="capturing">
|
||||
<![CDATA[
|
||||
if (event.target.localName == "menuitem")
|
||||
this.selectedItem = event.target;
|
||||
]]>
|
||||
</handler>
|
||||
<handler event="create">
|
||||
<![CDATA[
|
||||
if (event.target.parentNode == this && this.selectedItem) {
|
||||
// Not ready for auto-setting the active child in hierarchies yet.
|
||||
// For now, only do this when the outermost menupopup opens.
|
||||
var menuBox = this.boxObject.QueryInterface(Components.interfaces.nsIMenuBoxObject);
|
||||
menuBox.activeChild = this.selectedItem;
|
||||
}
|
||||
]]>
|
||||
</handler>
|
||||
<handler event="bindingattached" action="this._initSelection()"/>
|
||||
|
||||
<!-- Selection Management -->
|
||||
<handler event="keypress" keycode="vk_up">
|
||||
<![CDATA[
|
||||
if (event.target == this)
|
||||
this._adjustSelection(true);
|
||||
event.preventDefault();
|
||||
]]>
|
||||
</handler>
|
||||
<handler event="keypress" keycode="vk_down">
|
||||
<![CDATA[
|
||||
if (event.target == this)
|
||||
this._adjustSelection(false);
|
||||
event.preventDefault();
|
||||
]]>
|
||||
</handler>
|
||||
|
||||
|
||||
</handlers>
|
||||
</binding>
|
||||
|
||||
<binding id="select" display="xul:menu"
|
||||
extends="resource:///res/builtin/selectBindings.xml#select-base">
|
||||
<implementation>
|
||||
<property name="value" onget="return this.getAttribute('value');">
|
||||
<setter>
|
||||
<![CDATA[
|
||||
var options = this.getElementsByTagName("option");
|
||||
for (var i = 0; i < options.length; ++i) {
|
||||
if (options[i].getAttribute("value") == val)
|
||||
this._selectArray.push(options[i]);
|
||||
}
|
||||
this.setAttribute("value", val);
|
||||
return val;
|
||||
]]>
|
||||
</setter>
|
||||
</property>
|
||||
<property name="disabled">
|
||||
<getter>
|
||||
return this.hasAttribute("disabled");
|
||||
</getter>
|
||||
<setter>
|
||||
if (val == "true") this.setAttribute("disabled", "true");
|
||||
else this.removeAttribute("disabled");
|
||||
return val;
|
||||
</setter>
|
||||
</property>
|
||||
<property name="selectedIndex">
|
||||
<getter>
|
||||
<![CDATA[
|
||||
if (!this._selectArray)
|
||||
return -1;
|
||||
|
||||
var options = this.getElementsByTagName("option");
|
||||
for (var i = 0; i < options.length; ++i) {
|
||||
if (options[i].getAttribute("selected"))
|
||||
return i;
|
||||
}
|
||||
|
||||
return -1;
|
||||
]]>
|
||||
</getter>
|
||||
<setter>
|
||||
<![CDATA[
|
||||
this._selectArray = [];
|
||||
|
||||
if (val >= 0 && this.hasChildNodes() && this.childNodes[val]) {
|
||||
this.childNodes[val].setAttribute("selected", "true");
|
||||
this._selectArray.push(this.childNodes[val]);
|
||||
|
||||
var textDisplayNode = this.getElementByAttribute("selectattr", "text");
|
||||
if (textDisplayNode)
|
||||
textDisplayNode.setAttribute("value", this.childNodes[val].text);
|
||||
}
|
||||
|
||||
return val;
|
||||
]]>
|
||||
</setter>
|
||||
</property>
|
||||
|
||||
<!-- Internal Implementation Methods -->
|
||||
<method name="getElementByAttribute">
|
||||
<parameter name="aAttributeName"/>
|
||||
<parameter name="aAttributeValue"/>
|
||||
<body>
|
||||
<![CDATA[
|
||||
var anonymousNodes = document.getAnonymousNodes(this);
|
||||
for (var i = 0; i < anonymousNodes.length; ++i)
|
||||
return this.recursiveAttributeSearch(anonymousNodes[i], aAttributeName, aAttributeValue);
|
||||
return null;
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
<method name="recursiveAttributeSearch">
|
||||
<parameter name="aNode"/>
|
||||
<parameter name="aAttributeName"/>
|
||||
<parameter name="aAttributeValue"/>
|
||||
<body>
|
||||
<![CDATA[
|
||||
if (aNode) {
|
||||
if (aNode.getAttribute(aAttributeName) == aAttributeValue)
|
||||
return aNode;
|
||||
|
||||
for (var i = 0; i < aNode.childNodes.length; ++i)
|
||||
return this.recursiveAttributeSearch(aNode.childNodes[i], aAttributeName, aAttributeValue);
|
||||
}
|
||||
return null;
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
</implementation>
|
||||
<handlers>
|
||||
<handler event="command" phase="capturing">
|
||||
<![CDATA[
|
||||
if (event.target.localName == "OPTION")
|
||||
this.selectedIndex = event.target.index;
|
||||
]]>
|
||||
</handler>
|
||||
<handler event="create">
|
||||
<![CDATA[
|
||||
if (event.target == this && this._selectArray.length) {
|
||||
// Not ready for auto-setting the active child in hierarchies yet.
|
||||
// For now, only do this when the outermost menupopup opens.
|
||||
var boxObject = document.getBoxObjectFor(this);
|
||||
var menuBox = boxObject.QueryInterface(Components.interfaces.nsIMenuBoxObject);
|
||||
menuBox.activeChild = this._selectArray[0];
|
||||
}
|
||||
|
||||
if (this._selectArray[0])
|
||||
this.childNodes[this.selectedIndex].setAttribute("menuactive", "true");
|
||||
]]>
|
||||
</handler>
|
||||
<handler event="mouseover">
|
||||
<![CDATA[
|
||||
if (event.target.localName == "OPTION") {
|
||||
var oldactive = this.getElementByAttribute("menuactive", "true");
|
||||
if (oldactive)
|
||||
oldactive.removeAttribute("menuactive");
|
||||
}
|
||||
]]>
|
||||
</handler>
|
||||
<handler event="bindingattached" action="this._initSelection()"/>
|
||||
</handlers>
|
||||
</binding>
|
||||
|
||||
<binding id="option" display="xul:menuitem"
|
||||
extends="resource:///res/builtin/selectBindings.xml#option-base"/>
|
||||
|
||||
<binding id="option-size" display="xul:treerow"
|
||||
extends="resource:///res/builtin/selectBindings.xml#option-base"/>
|
||||
|
||||
<binding id="option-base">
|
||||
<implementation>
|
||||
<property name="form" readonly="true"/>
|
||||
|
||||
<property name="defaultSelected">false</property>
|
||||
|
||||
<property name="text" readonly="true">
|
||||
<getter>
|
||||
<![CDATA[
|
||||
var textString = "";
|
||||
if (this.hasChildNodes()) {
|
||||
for (var i = 0; i < this.childNodes.length; ++i)
|
||||
textString += this.childNodes[i].nodeValue;
|
||||
}
|
||||
return textString;
|
||||
]]>
|
||||
</getter>
|
||||
</property>
|
||||
|
||||
<property name="index" readonly="true">
|
||||
<getter>
|
||||
<![CDATA[
|
||||
var parent = this.parentNode;
|
||||
// bail on supporting optgroup at this juncture.
|
||||
if (!parent) return -1;
|
||||
|
||||
for (var i = 0; i < parent.childNodes.length; ++i) {
|
||||
if (parent.childNodes[i] == this)
|
||||
return i;
|
||||
}
|
||||
return -1;
|
||||
]]>
|
||||
</getter>
|
||||
</property>
|
||||
|
||||
<property name="disabled">
|
||||
<getter>
|
||||
return this.hasAttribute("disabled");
|
||||
</getter>
|
||||
<setter>
|
||||
if (val) this.setAttribute("disabled", "true");
|
||||
else this.removeAttribute("disabled");
|
||||
</setter>
|
||||
</property>
|
||||
|
||||
<property name="label">
|
||||
<getter>
|
||||
return this.getAttribute("label");
|
||||
</getter>
|
||||
<setter>
|
||||
this.setAttribute("label", val);
|
||||
return val;
|
||||
</setter>
|
||||
</property>
|
||||
|
||||
<property name="selected">
|
||||
<getter>
|
||||
return this.hasAttribute("selected");
|
||||
</getter>
|
||||
<setter>
|
||||
var parent = this.parentNode;
|
||||
if (parent)
|
||||
parent.selectedIndex = this.index;
|
||||
return val;
|
||||
</setter>
|
||||
</property>
|
||||
|
||||
<property name="value">
|
||||
<getter>
|
||||
return this.getAttribute("value");
|
||||
</getter>
|
||||
<setter>
|
||||
this.setAttribute("value", val);
|
||||
return val;
|
||||
</setter>
|
||||
</property>
|
||||
|
||||
<property name="_textNode">
|
||||
|
||||
</property>
|
||||
</implementation>
|
||||
</binding>
|
||||
|
||||
</bindings>
|
||||
|
|
@ -1,135 +0,0 @@
|
|||
button, input[type="button"], input[type="submit"], input[type="reset"]
|
||||
{
|
||||
border-left : 1px solid threedface;
|
||||
border-top : 1px solid threedface;
|
||||
border-right : 1px solid threeddarkshadow;
|
||||
border-bottom : 1px solid threeddarkshadow;
|
||||
background-color : threedface;
|
||||
margin : 0px;
|
||||
font : button;
|
||||
color : buttontext;
|
||||
-moz-user-focus : normal;
|
||||
-moz-user-select : none;
|
||||
}
|
||||
|
||||
.button-box-1
|
||||
{
|
||||
border-left : 1px solid threedhighlight;
|
||||
border-top : 1px solid threedhighlight;
|
||||
border-right : 1px solid threedshadow;
|
||||
border-bottom : 1px solid threedshadow;
|
||||
-moz-user-focus : none;
|
||||
}
|
||||
|
||||
.button-box-2
|
||||
{
|
||||
border : 1px solid threedface;
|
||||
}
|
||||
|
||||
button:hover:active,
|
||||
input[type="button"]:hover:active,
|
||||
input[type="submit"]:hover:active,
|
||||
input[type="reset"]:hover:active
|
||||
{
|
||||
border : 1px solid threeddarkshadow;
|
||||
}
|
||||
|
||||
button:hover:active > .button-box-1,
|
||||
input[type="button"]:hover:active > .button-box-1,
|
||||
input[type="submit"]:hover:active > .button-box-1,
|
||||
input[type="reset"]:hover:active > .button-box-1
|
||||
{
|
||||
border : 1px solid threedshadow;
|
||||
}
|
||||
|
||||
button:hover:active > .button-box-1 > .button-box-2,
|
||||
input[type="button"]:hover:active > .button-box-1 > .button-box-2,
|
||||
input[type="submit"]:hover:active > .button-box-1 > .button-box-2,
|
||||
input[type="reset"]:hover:active > .button-box-1 > .button-box-2
|
||||
{
|
||||
border : 1px solid threedface;
|
||||
}
|
||||
|
||||
button:hover:active > .button-box-1 > .button-box-2 > .button-box-text,
|
||||
input[type="button"]:hover:active > .button-box-1 > .button-box-2 > .button-box-text,
|
||||
input[type="submit"]:hover:active > .button-box-1 > .button-box-2 > .button-box-text,
|
||||
input[type="reset"]:hover:active > .button-box-1 > .button-box-2 > .button-box-text
|
||||
{
|
||||
padding : 1px 2px 0px 3px;
|
||||
}
|
||||
|
||||
button[disabled],
|
||||
button[disabled]:hover:active,
|
||||
input[type="button"][disabled],
|
||||
input[type="button"][disabled]:hover:active,
|
||||
input[type="submit"][disabled],
|
||||
input[type="submit"][disabled]:hover:active,
|
||||
input[type="reset"][disabled],
|
||||
input[type="reset"][disabled]:hover:active
|
||||
{
|
||||
color : graytext;
|
||||
}
|
||||
|
||||
button[disabled] > .button-box-1 > .button-box-2 > .button-box-text,
|
||||
button[disabled]:hover:active > .button-box-1 > .button-box-2 > .button-box-text,
|
||||
input[type="button"][disabled] > .button-box-1 > .button-box-2 > .button-box-text,
|
||||
input[type="button"][disabled]:hover:active > .button-box-1 > .button-box-2 > .button-box-text,
|
||||
input[type="submit"][disabled] > .button-box-1 > .button-box-2 > .button-box-text,
|
||||
input[type="submit"][disabled]:hover:active > .button-box-1 > .button-box-2 > .button-box-text,
|
||||
input[type="reset"][disabled] > .button-box-1 > .button-box-2 > .button-box-text,
|
||||
input[type="reset"][disabled]:hover:active > .button-box-1 > .button-box-2 > .button-box-text
|
||||
{
|
||||
padding : 0px 3px 1px 2px;
|
||||
}
|
||||
|
||||
button:focus,
|
||||
input[type="button"]:focus,
|
||||
input[type="submit"]:focus,
|
||||
input[type="reset"]:focus
|
||||
{
|
||||
border : 1px solid threeddarkshadow;
|
||||
}
|
||||
|
||||
.button-box-text,
|
||||
button[disabled]:focus > .button-box-1 > .button-box-2 > .button-box-text,
|
||||
input[type="button"][disabled]:focus > .button-box-1 > .button-box-2 > .button-box-text,
|
||||
input[type="submit"][disabled]:focus > .button-box-1 > .button-box-2 > .button-box-text,
|
||||
input[type="reset"][disabled]:focus > .button-box-1 > .button-box-2 > .button-box-text
|
||||
{
|
||||
text-align : center;
|
||||
vertical-align : middle;
|
||||
padding : 0px 3px 1px 2px;
|
||||
border : 1px solid transparent;
|
||||
margin : 1px;
|
||||
}
|
||||
|
||||
button:focus > .button-box-1 > .button-box-2 > .button-box-text,
|
||||
input[type="button"]:focus > .button-box-1 > .button-box-2 > .button-box-text,
|
||||
input[type="submit"]:focus > .button-box-1 > .button-box-2 > .button-box-text,
|
||||
input[type="reset"]:focus > .button-box-1 > .button-box-2 > .button-box-text
|
||||
{
|
||||
border : 1px dotted threeddarkshadow;
|
||||
}
|
||||
|
||||
/* outer frame */
|
||||
button:focus > .button-box-1,
|
||||
input[type="button"]:focus > .button-box-1,
|
||||
input[type="submit"]:focus > .button-box-1,
|
||||
input[type="reset"]:focus > .button-box-1
|
||||
{
|
||||
border-left : 1px solid threedhighlight;
|
||||
border-top : 1px solid threedhighlight;
|
||||
border-right : 1px solid threeddarkshadow;
|
||||
border-bottom : 1px solid threeddarkshadow;
|
||||
}
|
||||
|
||||
button:focus > .button-box-1 > .button-box-2,
|
||||
input[type="button"]:focus > .button-box-1 > .button-box-2,
|
||||
input[type="submit"]:focus > .button-box-1 > .button-box-2,
|
||||
input[type="reset"]:focus > .button-box-1 > .button-box-2
|
||||
{
|
||||
border-left : 1px solid threedface;
|
||||
border-top : 1px solid threedface;
|
||||
border-right : 1px solid threedshadow;
|
||||
border-bottom : 1px solid threedshadow;
|
||||
}
|
|
@ -26,11 +26,17 @@ include <$(DEPTH)\config\rules.mak>
|
|||
install:: $(LIBRARY)
|
||||
$(MAKE_INSTALL) platformHTMLBindings.xml $(DIST)\bin\res\builtin
|
||||
$(MAKE_INSTALL) platformButtonBindings.xml $(DIST)\bin\res\builtin
|
||||
$(MAKE_INSTALL) platformSelectBindings.xml $(DIST)\bin\res\builtin
|
||||
$(MAKE_INSTALL) xbl-forms.css $(DIST)\bin\res\builtin
|
||||
$(MAKE_INSTALL) buttons.css $(DIST)\bin\res\builtin
|
||||
$(MAKE_INSTALL) buttons.css $(DIST)\bin\res\builtin
|
||||
$(MAKE_INSTALL) select.css $(DIST)\bin\res\builtin
|
||||
$(MAKE_INSTALL) textfields.css $(DIST)\bin\res\builtin
|
||||
|
||||
clobber::
|
||||
rm -f $(DIST)\bin\res\builtin\platformHTMLBindings.xml
|
||||
rm -f $(DIST)\bin\res\builtin\platformButtonBindings.xml
|
||||
rm -f $(DIST)\bin\res\builtin\platformSelectBindings.xml
|
||||
rm -f $(DIST)\bin\res\builtin\xbl-forms.css
|
||||
rm -f $(DIST)\bin\res\builtin\buttons.css
|
||||
rm -f $(DIST)\bin\res\builtin\buttons.css
|
||||
rm -f $(DIST)\bin\res\builtin\select.css
|
||||
rm -f $(DIST)\bin\res\builtin\textfields.css
|
||||
|
|
|
@ -1,31 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
|
||||
<bindings id="formWidgets"
|
||||
xmlns="http://www.mozilla.org/xbl"
|
||||
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<binding id="button" extends="xul:button">
|
||||
<content>
|
||||
<xul:box class="button-box-1" flex="1">
|
||||
<xul:box class="button-box-2" autostretch="never" flex="1">
|
||||
<xul:html class="button-box-text" flex="1" autostretch="never">
|
||||
<children/>
|
||||
</xul:html>
|
||||
</xul:box>
|
||||
</xul:box>
|
||||
</content>
|
||||
</binding>
|
||||
|
||||
<binding id="inputButton" extends="xul:button">
|
||||
<content>
|
||||
<xul:box class="button-box-1" flex="1">
|
||||
<xul:box class="button-box-2" autostretch="never" flex="1">
|
||||
<xul:box class="button-box-text" flex="1" autostretch="never">
|
||||
<xul:text inherits="value" value="Submit Query"/>
|
||||
</xul:box>
|
||||
</xul:box>
|
||||
</xul:box>
|
||||
</content>
|
||||
</binding>
|
||||
|
||||
</bindings>
|
|
@ -5,6 +5,11 @@
|
|||
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<binding id="inputFields" extends="resource:///res/builtin/htmlBindings.xml#inputFieldsBase">
|
||||
<!-- <content>
|
||||
<xul:box class="text-input-internal-box">
|
||||
<html:input class="text-input" flex="1" inherits="onfocus,onblur,value,type,maxlength,disabled,size,readonly"/>
|
||||
</xul:box>
|
||||
</content>-->
|
||||
<handlers>
|
||||
<handler event="keypress" keycode="VK_UP" command="cmd_charPrevious"/>
|
||||
<handler event="keypress" keycode="VK_DOWN" command="cmd_charNext"/>
|
||||
|
|
|
@ -0,0 +1,83 @@
|
|||
<?xml version="1.0"?>
|
||||
|
||||
<bindings id="selectBindings"
|
||||
xmlns="http://www.mozilla.org/xbl"
|
||||
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<binding id="select-size" extends="resource:///res/builtin/selectBindings.xml#select-size">
|
||||
<content>
|
||||
<xul:treecolgroup>
|
||||
<xul:treecol flex="1"/>
|
||||
</xul:treecolgroup>
|
||||
<xul:treerows class="select-container-treerows" flex="1">
|
||||
<xul:treechildren flex="1" outer="true" treeitem="optgroup" treerow="option"
|
||||
sizemode="true" style="-moz-binding: none; overflow: -moz-scrollbars-vertical;">
|
||||
<children/> <!-- includes="optgroup|option" -->
|
||||
</xul:treechildren>
|
||||
</xul:treerows>
|
||||
</content>
|
||||
</binding>
|
||||
|
||||
<binding id="option-size" extends="resource:///res/builtin/selectBindings.xml#option-size">
|
||||
<!-- extends="resource:///res/builtin/selectBindings.xml#option-size"> -->
|
||||
<content includes="*">
|
||||
<xul:treecell style="-moz-binding: none;">
|
||||
<!--xul:treeindentation/-->
|
||||
<xul:text inherits="value=xbl:text,value=label"/>
|
||||
</xul:treecell>
|
||||
</content>
|
||||
</binding>
|
||||
|
||||
<binding id="optgroup-size" extends="xul:treeitem">
|
||||
<!-- extends="resource:///res/builtin/selectBindings.xml#optgroup-size"> -->
|
||||
<content open="true">
|
||||
<xul:treerow>
|
||||
<xul:treecell style="-moz-binding: none;">
|
||||
<!--xul:treeindentation/-->
|
||||
<xul:text inherits="value=label" flex="1" crop="right"/>
|
||||
</xul:treecell>
|
||||
</xul:treerow>
|
||||
<xul:treechildren>
|
||||
<children/> <!-- includes="optgroup|option" -->
|
||||
</xul:treechildren>
|
||||
</content>
|
||||
</binding>
|
||||
|
||||
<binding id="select" extends="resource:///res/builtin/selectBindings.xml#select">
|
||||
<content sizetopopup="true">
|
||||
<xul:box class="select-menulist-internal-box" flex="1">
|
||||
<xul:box class="select-menulist-display-box" flex="1" valign="middle" autostretch="never">
|
||||
<xul:text value="[[[[[MENULIST!]]]]]" class="select-menulist-text"
|
||||
selectattr="text" inherits="accesskey" crop="right" flex="1"/>
|
||||
</xul:box>
|
||||
<xul:box class="select-menulist-dropmarker-box-1" valign="middle" inherits="open">
|
||||
<xul:box class="select-menulist-dropmarker-box-2" flex="1" autostretch="never" valign="middle" inherits="open">
|
||||
<xul:image class="select-menulist-dropmarker" inherits="disabled"/>
|
||||
</xul:box>
|
||||
</xul:box>
|
||||
</xul:box>
|
||||
<xul:menupopup class="select-menulist-menupopup" style="-moz-binding: none;" menugenerated="true">
|
||||
<xul:box class="select-menulistpopup-internal-box" orient="vertical" flex="1" style="overflow: auto">
|
||||
<children/>
|
||||
</xul:box>
|
||||
</xul:menupopup>
|
||||
</content>
|
||||
</binding>
|
||||
|
||||
<binding id="option" extends="resource:///res/builtin/selectBindings.xml#option">
|
||||
<content includes="*">
|
||||
<xul:text inherits="value=xbl:text,value=label" crop="right"/>
|
||||
</content>
|
||||
</binding>
|
||||
|
||||
<binding id="optgroup" extends="xul:menu">
|
||||
<!-- extends="resource:///res/builtin/selectBindings.xml#optgroup-size"> -->
|
||||
<content includes="*">
|
||||
<xul:text inherits="value=xbl:text,value=label" crop="right"/>
|
||||
<xul:menupopup style="overflow:auto; -moz-binding: none;" menugenerated="true">
|
||||
<children/>
|
||||
</xul:menupopup>
|
||||
</content>
|
||||
</binding>
|
||||
|
||||
</bindings>
|
|
@ -0,0 +1,169 @@
|
|||
/*
|
||||
* The contents of this file are subject to the Netscape Public
|
||||
* License Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* David Hyatt & Ben Goodger
|
||||
*/
|
||||
|
||||
@namespace url(http://www.w3.org/1999/xhtml); /* set default namespace to HTML */
|
||||
|
||||
select[size]
|
||||
{
|
||||
margin : 0px;
|
||||
}
|
||||
|
||||
.select-container-treerows
|
||||
{
|
||||
border-left : 1px solid threeddarkshadow;
|
||||
border-top : 1px solid threeddarkshadow;
|
||||
border-right : 1px solid threedface;
|
||||
border-bottom : 1px solid threedface;
|
||||
}
|
||||
|
||||
option
|
||||
{
|
||||
font : button;
|
||||
border : 1px solid transparent;
|
||||
color : windowtext;
|
||||
}
|
||||
|
||||
/*
|
||||
select option[selected]
|
||||
{
|
||||
background-color : highlight;
|
||||
color : highlighttext;
|
||||
}
|
||||
*/
|
||||
|
||||
/* menulist based select */
|
||||
|
||||
select, select[size="1"]
|
||||
{
|
||||
border-left : 1px solid threedshadow;
|
||||
border-top : 1px solid threedshadow;
|
||||
border-right : 1px solid threedhighlight;
|
||||
border-bottom : 1px solid threedhighlight;
|
||||
background-color : -moz-field;
|
||||
color : menutext;
|
||||
font : pull-down-menu;
|
||||
margin : 1px 5px 2px 5px;
|
||||
}
|
||||
|
||||
select[disabled]
|
||||
{
|
||||
background-color : threedface;
|
||||
}
|
||||
|
||||
/* icon display frame */
|
||||
.select-menulist-internal-box
|
||||
{
|
||||
border-left : 1px solid threeddarkshadow;
|
||||
border-top : 1px solid threeddarkshadow;
|
||||
border-right : 1px solid threedface;
|
||||
border-bottom : 1px solid threedface;
|
||||
-moz-user-focus : ignore;
|
||||
}
|
||||
|
||||
.select-menulist-display-box,
|
||||
select[open="true"]:focus > .select-menulist-internal-box > .select-menulist-display-box
|
||||
{
|
||||
border : 1px solid transparent;
|
||||
margin : 1px;
|
||||
background-color : -moz-field;
|
||||
color : menutext;
|
||||
}
|
||||
|
||||
select:focus > .select-menulist-internal-box > .select-menulist-display-box
|
||||
{
|
||||
border : 1px dotted #F5DB95;
|
||||
background-color : highlight;
|
||||
color : highlighttext;
|
||||
}
|
||||
|
||||
/* text display frame */
|
||||
.select-menulist-text
|
||||
{
|
||||
padding : 0px 2px 0px 1px;
|
||||
margin : 0px;
|
||||
}
|
||||
|
||||
/* drop marker display frame */
|
||||
.select-menulist-dropmarker-box-1
|
||||
{
|
||||
border-top : 1px solid threedface;
|
||||
border-left : 1px solid threedface;
|
||||
border-bottom : 1px solid threeddarkshadow;
|
||||
border-right : 1px solid threeddarkshadow;
|
||||
background-color : threedface;
|
||||
}
|
||||
|
||||
.select-menulist-dropmarker-box-2
|
||||
{
|
||||
border-top : 1px solid threedhighlight;
|
||||
border-left : 1px solid threedhighlight;
|
||||
border-bottom : 1px solid threedshadow;
|
||||
border-right : 1px solid threedshadow;
|
||||
padding : 2px 1px 2px 1px;
|
||||
}
|
||||
|
||||
.select-menulist-dropmarker
|
||||
{
|
||||
list-style-image : url("chrome://global/skin/scroll-down.gif");
|
||||
}
|
||||
|
||||
.select-menulist-dropmarker[disabled="true"]
|
||||
{
|
||||
list-style-image : url("chrome://global/skin/scroll-down-disabled.gif");
|
||||
padding : 2px;
|
||||
}
|
||||
|
||||
select:hover:active > .select-menulist-internal-box > .select-menulist-dropmarker-box-1[open="true"]
|
||||
{
|
||||
border : 1px solid threedshadow;
|
||||
}
|
||||
|
||||
select:hover:active > .select-menulist-internal-box > .select-menulist-dropmarker-box-1 > .select-menulist-dropmarker-box-2[open="true"]
|
||||
{
|
||||
border : 1px solid threedface;
|
||||
padding : 3px 0px 1px 2px;
|
||||
}
|
||||
|
||||
/* rules for popups and separators associated with menulists */
|
||||
select > .select-menulist-menupopup
|
||||
{
|
||||
background-color : -moz-field;
|
||||
border : 1px solid #000000;
|
||||
min-width : 0px;
|
||||
}
|
||||
|
||||
select > option
|
||||
{
|
||||
padding : 0px 7px !important;
|
||||
min-width : 0px; /* should be in content*/
|
||||
max-width : none; /* should be in content*/
|
||||
border : 1px solid transparent;
|
||||
}
|
||||
|
||||
select:focus > option[menuactive="true"]
|
||||
{
|
||||
border : 1px dotted #F5DB95;
|
||||
background-color : highlight;
|
||||
color : highlighttext;
|
||||
}
|
||||
|
||||
|
|
@ -17,8 +17,11 @@
|
|||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* David Hyatt & Ben Goodger
|
||||
*/
|
||||
@import url(resource:/res/builtin/textfields.css);
|
||||
@import url(resource:/res/builtin/buttons.css);
|
||||
@import url(resource:/res/builtin/select.css);
|
||||
|
||||
@namespace url(http://www.w3.org/1999/xhtml); /* set default namespace to HTML */
|
||||
|
||||
|
@ -30,20 +33,80 @@
|
|||
input[type="image"],
|
||||
input[type="checkbox"],
|
||||
input[type="radio"],
|
||||
select, fieldset, legend {
|
||||
display: none;
|
||||
fieldset, legend, select {
|
||||
display : none;
|
||||
}
|
||||
|
||||
input {
|
||||
-moz-user-focus: normal;
|
||||
}
|
||||
input, input[type="text"], input[type="password"]
|
||||
{
|
||||
cursor : text;
|
||||
text-align : start;
|
||||
vertical-align : bottom;
|
||||
-moz-box-sizing : border-box;
|
||||
-moz-user-focus : normal;
|
||||
-moz-binding : url("resource:///res/builtin/platformHTMLBindings.xml#inputFields");
|
||||
}
|
||||
|
||||
.input-inner
|
||||
{
|
||||
-moz-binding : none;
|
||||
}
|
||||
|
||||
button
|
||||
{
|
||||
-moz-binding : url("resource:///res/builtin/platformButtonBindings.xml#button");
|
||||
}
|
||||
{
|
||||
-moz-binding : url("resource:///res/builtin/platformButtonBindings.xml#button");
|
||||
}
|
||||
|
||||
input[type="button"],input[type="submit"],input[type="reset"] {
|
||||
-moz-binding : url("resource:///res/builtin/platformButtonBindings.xml#inputButton");
|
||||
-moz-binding : url("resource:///res/builtin/platformButtonBindings.xml#inputButton");
|
||||
cursor : default;
|
||||
}
|
||||
|
||||
/**
|
||||
<select/> Widget
|
||||
**/
|
||||
|
||||
select[size]
|
||||
{
|
||||
-moz-binding : url("resource:///res/builtin/platformSelectBindings.xml#select-size");
|
||||
}
|
||||
|
||||
select, select[size="1"]
|
||||
{
|
||||
-moz-user-focus : normal;
|
||||
-moz-user-select : none;
|
||||
-moz-binding : url("resource:///res/builtin/platformSelectBindings.xml#select");
|
||||
display : inline;
|
||||
}
|
||||
|
||||
/* <select size=">1"/> */
|
||||
|
||||
select[size] > optgroup,
|
||||
select[size] > option,
|
||||
select[size] optgroup[open="true"] > option,
|
||||
select[size] optgroup[open="true"] > optgroup
|
||||
{
|
||||
display : block !important;
|
||||
}
|
||||
|
||||
select[size] optgroup
|
||||
{
|
||||
-moz-binding : url("resource:///res/builtin/platformSelectBindings.xml#optgroup-size");
|
||||
}
|
||||
|
||||
select[size] option
|
||||
{
|
||||
-moz-binding : url("resource:///res/builtin/platformSelectBindings.xml#option-size");
|
||||
}
|
||||
|
||||
select optgroup, select[size="1"] optgroup
|
||||
{
|
||||
-moz-binding : url("resource:///res/builtin/platformSelectBindings.xml#optgroup");
|
||||
}
|
||||
|
||||
select option, select[size="1"] option
|
||||
{
|
||||
-moz-binding : url("resource:///res/builtin/platformSelectBindings.xml#option");
|
||||
}
|
||||
|
||||
|
Загрузка…
Ссылка в новой задаче