Bug 312867 Implement textbox.reset(), expose input's editor

patch by ajvincent@gmail.com r=neil sr=neil
This commit is contained in:
timeless%mozdev.org 2005-12-23 22:50:25 +00:00
parent b83b9c785c
commit 683322a8ad
2 changed files with 15 additions and 3 deletions

View File

@ -285,6 +285,13 @@
this.setInitialSelection();
]]></constructor>
<property name="editor" readonly="true">
<getter><![CDATA[
const nsIDOMNSEditableElement = Components.interfaces.nsIDOMNSEditableElement;
return this.inputField.QueryInterface(nsIDOMNSEditableElement).editor;
]]></getter>
</property>
<method name="_selectInputFieldValueInList">
<body>
<![CDATA[

View File

@ -70,6 +70,13 @@
onset="if (val) this.setAttribute('clickSelectsAll', 'true');
else this.removeAttribute('clickSelectsAll'); return val;" />
<property name="editor" readonly="true">
<getter><![CDATA[
const nsIDOMNSEditableElement = Components.interfaces.nsIDOMNSEditableElement;
return this.inputField.QueryInterface(nsIDOMNSEditableElement).editor;
]]></getter>
</property>
<method name="select">
<body>
this.inputField.select();
@ -101,12 +108,10 @@
str = this.getAttribute('newlines');
if (str) {
const nsIPlaintextEditor = Components.interfaces.nsIPlaintextEditor;
const nsIDOMNSEditableElement = Components.interfaces.nsIDOMNSEditableElement;
for (var x in nsIPlaintextEditor) {
if (/^eNewlines/.test(x)) {
if (str == RegExp.rightContext.toLowerCase()) {
this.inputField.QueryInterface(nsIDOMNSEditableElement)
.editor.QueryInterface(nsIPlaintextEditor)
this.editor.QueryInterface(nsIPlaintextEditor)
.newlineHandling = nsIPlaintextEditor[x];
break;
}