mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Add a dummy implementation of contentEditable
This commit is contained in:
parent
b60c70bab6
commit
c00eb62090
3 changed files with 24 additions and 15 deletions
|
@ -568,6 +568,27 @@ impl HTMLElementMethods for HTMLElement {
|
|||
},
|
||||
);
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-contenteditable
|
||||
fn ContentEditable(&self) -> DOMString {
|
||||
// TODO: https://github.com/servo/servo/issues/12776
|
||||
self.upcast::<Element>()
|
||||
.get_attribute(&ns!(), &local_name!("contenteditable"))
|
||||
.map(|attr| DOMString::from(&**attr.value()))
|
||||
.unwrap_or_else(|| DOMString::from("inherit"))
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-contenteditable
|
||||
fn SetContentEditable(&self, _: DOMString) {
|
||||
// TODO: https://github.com/servo/servo/issues/12776
|
||||
warn!("The contentEditable attribute is not implemented yet");
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-contenteditable
|
||||
fn IsContentEditable(&self) -> bool {
|
||||
// TODO: https://github.com/servo/servo/issues/12776
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
fn append_text_node_to_fragment(document: &Document, fragment: &DocumentFragment, text: String) {
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
// https://html.spec.whatwg.org/multipage/#elementcontenteditable
|
||||
[Exposed=Window]
|
||||
interface mixin ElementContentEditable {
|
||||
// [CEReactions]
|
||||
// attribute DOMString contentEditable;
|
||||
// readonly attribute boolean isContentEditable;
|
||||
[CEReactions]
|
||||
attribute DOMString contentEditable;
|
||||
readonly attribute boolean isContentEditable;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue