mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Implement HTMLAnchorElement.text
This commit is contained in:
parent
7cd57870b4
commit
13c9d4c4a0
2 changed files with 16 additions and 1 deletions
|
@ -5,6 +5,8 @@
|
|||
use dom::bindings::codegen::Bindings::AttrBinding::AttrMethods;
|
||||
use dom::bindings::codegen::Bindings::EventBinding::EventMethods;
|
||||
use dom::bindings::codegen::Bindings::HTMLAnchorElementBinding;
|
||||
use dom::bindings::codegen::Bindings::HTMLAnchorElementBinding::HTMLAnchorElementMethods;
|
||||
use dom::bindings::codegen::Bindings::NodeBinding::NodeMethods;
|
||||
use dom::bindings::codegen::InheritTypes::HTMLAnchorElementDerived;
|
||||
use dom::bindings::codegen::InheritTypes::{ElementCast, HTMLElementCast, NodeCast};
|
||||
use dom::bindings::js::{JSRef, Temporary, OptionalRootable};
|
||||
|
@ -114,3 +116,15 @@ impl Reflectable for HTMLAnchorElement {
|
|||
self.htmlelement.reflector()
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> HTMLAnchorElementMethods for JSRef<'a, HTMLAnchorElement> {
|
||||
fn Text(&self) -> DOMString {
|
||||
let node: &JSRef<Node> = NodeCast::from_ref(self);
|
||||
node.GetTextContent().unwrap()
|
||||
}
|
||||
|
||||
fn SetText(&self, value: DOMString) {
|
||||
let node: &JSRef<Node> = NodeCast::from_ref(self);
|
||||
node.SetTextContent(Some(value))
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,7 +21,8 @@ interface HTMLAnchorElement : HTMLElement {
|
|||
// attribute DOMString hreflang;
|
||||
// attribute DOMString type;
|
||||
|
||||
// attribute DOMString text;
|
||||
[Pure]
|
||||
attribute DOMString text;
|
||||
|
||||
// also has obsolete members
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue