mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Implement 'labels' attribute on 'labelable elements'
This commit is contained in:
parent
37c03c7816
commit
9df375195e
22 changed files with 184 additions and 63 deletions
|
@ -4,11 +4,13 @@
|
|||
|
||||
use dom::bindings::codegen::Bindings::HTMLOutputElementBinding;
|
||||
use dom::bindings::codegen::Bindings::HTMLOutputElementBinding::HTMLOutputElementMethods;
|
||||
use dom::bindings::conversions::Castable;
|
||||
use dom::bindings::js::Root;
|
||||
use dom::document::Document;
|
||||
use dom::htmlelement::HTMLElement;
|
||||
use dom::htmlformelement::{FormControl, HTMLFormElement};
|
||||
use dom::node::{Node, window_from_node};
|
||||
use dom::nodelist::NodeList;
|
||||
use dom::validitystate::ValidityState;
|
||||
use util::str::DOMString;
|
||||
|
||||
|
@ -47,6 +49,11 @@ impl HTMLOutputElementMethods for HTMLOutputElement {
|
|||
fn GetForm(&self) -> Option<Root<HTMLFormElement>> {
|
||||
self.form_owner()
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-lfe-labels
|
||||
fn Labels(&self) -> Root<NodeList> {
|
||||
self.upcast::<HTMLElement>().labels()
|
||||
}
|
||||
}
|
||||
|
||||
impl FormControl for HTMLOutputElement {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue