mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
Move WebIDL methods to traits implemented by JSRef types.
This commit is contained in:
parent
dfdda0098a
commit
76783b029e
106 changed files with 3644 additions and 1912 deletions
|
@ -40,163 +40,208 @@ impl HTMLTextAreaElement {
|
|||
}
|
||||
}
|
||||
|
||||
impl HTMLTextAreaElement {
|
||||
pub fn Autofocus(&self) -> bool {
|
||||
pub trait HTMLTextAreaElementMethods {
|
||||
fn Autofocus(&self) -> bool;
|
||||
fn SetAutofocus(&mut self, _autofocus: bool) -> ErrorResult;
|
||||
fn Cols(&self) -> u32;
|
||||
fn SetCols(&self, _cols: u32) -> ErrorResult;
|
||||
fn Disabled(&self) -> bool;
|
||||
fn SetDisabled(&mut self, _disabled: bool) -> ErrorResult;
|
||||
fn MaxLength(&self) -> i32;
|
||||
fn SetMaxLength(&self, _max_length: i32) -> ErrorResult;
|
||||
fn Name(&self) -> DOMString;
|
||||
fn SetName(&mut self, _name: DOMString) -> ErrorResult;
|
||||
fn Placeholder(&self) -> DOMString;
|
||||
fn SetPlaceholder(&mut self, _placeholder: DOMString) -> ErrorResult;
|
||||
fn ReadOnly(&self) -> bool;
|
||||
fn SetReadOnly(&mut self, _read_only: bool) -> ErrorResult;
|
||||
fn Required(&self) -> bool;
|
||||
fn SetRequired(&mut self, _required: bool) -> ErrorResult;
|
||||
fn Rows(&self) -> u32;
|
||||
fn SetRows(&self, _rows: u32) -> ErrorResult;
|
||||
fn Wrap(&self) -> DOMString;
|
||||
fn SetWrap(&mut self, _wrap: DOMString) -> ErrorResult;
|
||||
fn Type(&self) -> DOMString;
|
||||
fn SetType(&mut self, _type: DOMString);
|
||||
fn DefaultValue(&self) -> DOMString;
|
||||
fn SetDefaultValue(&mut self, _default_value: DOMString) -> ErrorResult;
|
||||
fn Value(&self) -> DOMString;
|
||||
fn SetValue(&mut self, _value: DOMString);
|
||||
fn TextLength(&self) -> u32;
|
||||
fn SetTextLength(&self, _text_length: u32) -> ErrorResult;
|
||||
fn WillValidate(&self) -> bool;
|
||||
fn SetWillValidate(&mut self, _will_validate: bool) -> ErrorResult;
|
||||
fn ValidationMessage(&self) -> DOMString;
|
||||
fn CheckValidity(&self) -> bool;
|
||||
fn SetCustomValidity(&self, _error: DOMString);
|
||||
fn Select(&self);
|
||||
fn GetSelectionStart(&self) -> Fallible<u32>;
|
||||
fn SetSelectionStart(&self, _selection_start: u32) -> ErrorResult;
|
||||
fn GetSelectionEnd(&self) -> Fallible<u32>;
|
||||
fn SetSelectionEnd(&self, _selection_end: u32) -> ErrorResult;
|
||||
fn GetSelectionDirection(&self) -> Fallible<DOMString>;
|
||||
fn SetSelectionDirection(&self, _selection_direction: DOMString) -> ErrorResult;
|
||||
fn SetRangeText(&self, _replacement: DOMString);
|
||||
}
|
||||
|
||||
impl<'a> HTMLTextAreaElementMethods for JSRef<'a, HTMLTextAreaElement> {
|
||||
fn Autofocus(&self) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
pub fn SetAutofocus(&mut self, _autofocus: bool) -> ErrorResult {
|
||||
fn SetAutofocus(&mut self, _autofocus: bool) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Cols(&self) -> u32 {
|
||||
fn Cols(&self) -> u32 {
|
||||
0
|
||||
}
|
||||
|
||||
pub fn SetCols(&self, _cols: u32) -> ErrorResult {
|
||||
fn SetCols(&self, _cols: u32) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Disabled(&self) -> bool {
|
||||
fn Disabled(&self) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
pub fn SetDisabled(&mut self, _disabled: bool) -> ErrorResult {
|
||||
fn SetDisabled(&mut self, _disabled: bool) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn MaxLength(&self) -> i32 {
|
||||
fn MaxLength(&self) -> i32 {
|
||||
0
|
||||
}
|
||||
|
||||
pub fn SetMaxLength(&self, _max_length: i32) -> ErrorResult {
|
||||
fn SetMaxLength(&self, _max_length: i32) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Name(&self) -> DOMString {
|
||||
fn Name(&self) -> DOMString {
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetName(&mut self, _name: DOMString) -> ErrorResult {
|
||||
fn SetName(&mut self, _name: DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Placeholder(&self) -> DOMString {
|
||||
fn Placeholder(&self) -> DOMString {
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetPlaceholder(&mut self, _placeholder: DOMString) -> ErrorResult {
|
||||
fn SetPlaceholder(&mut self, _placeholder: DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn ReadOnly(&self) -> bool {
|
||||
fn ReadOnly(&self) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
pub fn SetReadOnly(&mut self, _read_only: bool) -> ErrorResult {
|
||||
fn SetReadOnly(&mut self, _read_only: bool) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Required(&self) -> bool {
|
||||
fn Required(&self) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
pub fn SetRequired(&mut self, _required: bool) -> ErrorResult {
|
||||
fn SetRequired(&mut self, _required: bool) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Rows(&self) -> u32 {
|
||||
fn Rows(&self) -> u32 {
|
||||
0
|
||||
}
|
||||
|
||||
pub fn SetRows(&self, _rows: u32) -> ErrorResult {
|
||||
fn SetRows(&self, _rows: u32) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Wrap(&self) -> DOMString {
|
||||
fn Wrap(&self) -> DOMString {
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetWrap(&mut self, _wrap: DOMString) -> ErrorResult {
|
||||
fn SetWrap(&mut self, _wrap: DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Type(&self) -> DOMString {
|
||||
fn Type(&self) -> DOMString {
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetType(&mut self, _type: DOMString) {
|
||||
fn SetType(&mut self, _type: DOMString) {
|
||||
}
|
||||
|
||||
pub fn DefaultValue(&self) -> DOMString {
|
||||
fn DefaultValue(&self) -> DOMString {
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetDefaultValue(&mut self, _default_value: DOMString) -> ErrorResult {
|
||||
fn SetDefaultValue(&mut self, _default_value: DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn Value(&self) -> DOMString {
|
||||
fn Value(&self) -> DOMString {
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn SetValue(&mut self, _value: DOMString) {
|
||||
fn SetValue(&mut self, _value: DOMString) {
|
||||
}
|
||||
|
||||
pub fn TextLength(&self) -> u32 {
|
||||
fn TextLength(&self) -> u32 {
|
||||
0
|
||||
}
|
||||
|
||||
pub fn SetTextLength(&self, _text_length: u32) -> ErrorResult {
|
||||
fn SetTextLength(&self, _text_length: u32) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn WillValidate(&self) -> bool {
|
||||
fn WillValidate(&self) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
pub fn SetWillValidate(&mut self, _will_validate: bool) -> ErrorResult {
|
||||
fn SetWillValidate(&mut self, _will_validate: bool) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn ValidationMessage(&self) -> DOMString {
|
||||
fn ValidationMessage(&self) -> DOMString {
|
||||
~""
|
||||
}
|
||||
|
||||
pub fn CheckValidity(&self) -> bool {
|
||||
fn CheckValidity(&self) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
pub fn SetCustomValidity(&self, _error: DOMString) {
|
||||
fn SetCustomValidity(&self, _error: DOMString) {
|
||||
}
|
||||
|
||||
pub fn Select(&self) {
|
||||
fn Select(&self) {
|
||||
}
|
||||
|
||||
pub fn GetSelectionStart(&self) -> Fallible<u32> {
|
||||
fn GetSelectionStart(&self) -> Fallible<u32> {
|
||||
Ok(0)
|
||||
}
|
||||
|
||||
pub fn SetSelectionStart(&self, _selection_start: u32) -> ErrorResult {
|
||||
fn SetSelectionStart(&self, _selection_start: u32) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn GetSelectionEnd(&self) -> Fallible<u32> {
|
||||
fn GetSelectionEnd(&self) -> Fallible<u32> {
|
||||
Ok(0)
|
||||
}
|
||||
|
||||
pub fn SetSelectionEnd(&self, _selection_end: u32) -> ErrorResult {
|
||||
fn SetSelectionEnd(&self, _selection_end: u32) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn GetSelectionDirection(&self) -> Fallible<DOMString> {
|
||||
fn GetSelectionDirection(&self) -> Fallible<DOMString> {
|
||||
Ok(~"")
|
||||
}
|
||||
|
||||
pub fn SetSelectionDirection(&self, _selection_direction: DOMString) -> ErrorResult {
|
||||
fn SetSelectionDirection(&self, _selection_direction: DOMString) -> ErrorResult {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn SetRangeText(&self, _replacement: DOMString) {
|
||||
fn SetRangeText(&self, _replacement: DOMString) {
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue