mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-08 12:22:34 +00:00
Bug 312867 Implement textbox.reset(), expose input's editor
patch by ajvincent@gmail.com r=neil sr=neil
This commit is contained in:
parent
b83b9c785c
commit
683322a8ad
@ -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[
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user