Implement 'htmlFor' attribute for <label> elements

This commit is contained in:
Corey Farwell 2015-10-24 13:09:15 -04:00
parent f97d1d148b
commit 98a6fc07e2
5 changed files with 7 additions and 139 deletions

View file

@ -46,6 +46,12 @@ impl HTMLLabelElementMethods for HTMLLabelElement {
self.form_owner()
}
// https://html.spec.whatwg.org/multipage/#dom-label-htmlfor
make_getter!(HtmlFor, "for");
// https://html.spec.whatwg.org/multipage/#dom-label-htmlfor
make_atomic_setter!(SetHtmlFor, "for");
// https://html.spec.whatwg.org/multipage/#dom-label-control
fn GetControl(&self) -> Option<Root<HTMLElement>> {
if !self.upcast::<Node>().is_in_doc() {

View file

@ -6,6 +6,6 @@
// https://html.spec.whatwg.org/multipage/#htmllabelelement
interface HTMLLabelElement : HTMLElement {
readonly attribute HTMLFormElement? form;
// attribute DOMString htmlFor;
attribute DOMString htmlFor;
readonly attribute HTMLElement? control;
};