mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Address review comments
This commit is contained in:
parent
3a1f9bd7fb
commit
1484acb7af
9 changed files with 38 additions and 45 deletions
|
@ -11,7 +11,7 @@ use dom::document::Document;
|
|||
use dom::element::{Element, AttributeHandlers, HTMLFormElementTypeId};
|
||||
use dom::eventtarget::{EventTarget, NodeTargetTypeId};
|
||||
use dom::htmlelement::HTMLElement;
|
||||
use dom::node::{Node, ElementNodeTypeId};
|
||||
use dom::node::{Node, ElementNodeTypeId, window_from_node};
|
||||
use servo_util::str::DOMString;
|
||||
use std::ascii::OwnedStrAsciiExt;
|
||||
|
||||
|
@ -50,7 +50,17 @@ impl<'a> HTMLFormElementMethods for JSRef<'a, HTMLFormElement> {
|
|||
make_setter!(SetAcceptCharset, "accept-charset")
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/forms.html#dom-fs-action
|
||||
make_url_getter!(Action)
|
||||
fn Action(self) -> DOMString {
|
||||
let element: JSRef<Element> = ElementCast::from_ref(self);
|
||||
let url = element.get_url_attribute("src");
|
||||
match url.as_slice() {
|
||||
"" => {
|
||||
let window = window_from_node(self).root();
|
||||
window.get_url().serialize()
|
||||
},
|
||||
_ => url
|
||||
}
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/forms.html#dom-fs-action
|
||||
make_setter!(SetAction, "action")
|
||||
|
@ -126,6 +136,7 @@ impl<'a> HTMLFormElementMethods for JSRef<'a, HTMLFormElement> {
|
|||
// https://html.spec.whatwg.org/multipage/forms.html#dom-fs-target
|
||||
make_setter!(SetTarget, "target")
|
||||
}
|
||||
|
||||
impl Reflectable for HTMLFormElement {
|
||||
fn reflector<'a>(&'a self) -> &'a Reflector {
|
||||
self.htmlelement.reflector()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue