mirror of
https://github.com/servo/servo.git
synced 2025-07-18 04:43:41 +01:00
Implement 'htmlFor' attribute for <label> elements
This commit is contained in:
parent
f97d1d148b
commit
98a6fc07e2
5 changed files with 7 additions and 139 deletions
|
@ -46,6 +46,12 @@ impl HTMLLabelElementMethods for HTMLLabelElement {
|
||||||
self.form_owner()
|
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
|
// https://html.spec.whatwg.org/multipage/#dom-label-control
|
||||||
fn GetControl(&self) -> Option<Root<HTMLElement>> {
|
fn GetControl(&self) -> Option<Root<HTMLElement>> {
|
||||||
if !self.upcast::<Node>().is_in_doc() {
|
if !self.upcast::<Node>().is_in_doc() {
|
||||||
|
|
|
@ -6,6 +6,6 @@
|
||||||
// https://html.spec.whatwg.org/multipage/#htmllabelelement
|
// https://html.spec.whatwg.org/multipage/#htmllabelelement
|
||||||
interface HTMLLabelElement : HTMLElement {
|
interface HTMLLabelElement : HTMLElement {
|
||||||
readonly attribute HTMLFormElement? form;
|
readonly attribute HTMLFormElement? form;
|
||||||
// attribute DOMString htmlFor;
|
attribute DOMString htmlFor;
|
||||||
readonly attribute HTMLElement? control;
|
readonly attribute HTMLElement? control;
|
||||||
};
|
};
|
||||||
|
|
|
@ -4881,12 +4881,6 @@
|
||||||
[HTMLLabelElement interface: existence and properties of interface object]
|
[HTMLLabelElement interface: existence and properties of interface object]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[HTMLLabelElement interface: attribute htmlFor]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[HTMLLabelElement interface: document.createElement("label") must inherit property "htmlFor" with the proper type (1)]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[HTMLInputElement interface: existence and properties of interface object]
|
[HTMLInputElement interface: existence and properties of interface object]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
|
|
@ -2913,135 +2913,6 @@
|
||||||
[label.tabIndex: IDL set to -2147483648 followed by getAttribute()]
|
[label.tabIndex: IDL set to -2147483648 followed by getAttribute()]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[label.htmlFor (<label for>): typeof IDL attribute]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[label.htmlFor (<label for>): IDL get with DOM attribute unset]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[label.htmlFor (<label for>): setAttribute() to "" followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[label.htmlFor (<label for>): setAttribute() to " \\0\\x01\\x02\\x03\\x04\\x05\\x06\\x07 \\b\\t\\n\\v\\f\\r\\x0e\\x0f \\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17 \\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f foo " followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[label.htmlFor (<label for>): setAttribute() to undefined followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[label.htmlFor (<label for>): setAttribute() to 7 followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[label.htmlFor (<label for>): setAttribute() to 1.5 followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[label.htmlFor (<label for>): setAttribute() to true followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[label.htmlFor (<label for>): setAttribute() to false followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[label.htmlFor (<label for>): setAttribute() to object "[object Object\]" followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[label.htmlFor (<label for>): setAttribute() to NaN followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[label.htmlFor (<label for>): setAttribute() to Infinity followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[label.htmlFor (<label for>): setAttribute() to -Infinity followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[label.htmlFor (<label for>): setAttribute() to "\\0" followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[label.htmlFor (<label for>): setAttribute() to null followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[label.htmlFor (<label for>): setAttribute() to object "test-toString" followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[label.htmlFor (<label for>): setAttribute() to object "test-valueOf" followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[label.htmlFor (<label for>): IDL set to "" followed by getAttribute()]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[label.htmlFor (<label for>): IDL set to " \\0\\x01\\x02\\x03\\x04\\x05\\x06\\x07 \\b\\t\\n\\v\\f\\r\\x0e\\x0f \\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17 \\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f foo " followed by getAttribute()]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[label.htmlFor (<label for>): IDL set to undefined followed by getAttribute()]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[label.htmlFor (<label for>): IDL set to undefined followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[label.htmlFor (<label for>): IDL set to 7 followed by getAttribute()]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[label.htmlFor (<label for>): IDL set to 7 followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[label.htmlFor (<label for>): IDL set to 1.5 followed by getAttribute()]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[label.htmlFor (<label for>): IDL set to 1.5 followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[label.htmlFor (<label for>): IDL set to true followed by getAttribute()]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[label.htmlFor (<label for>): IDL set to true followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[label.htmlFor (<label for>): IDL set to false followed by getAttribute()]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[label.htmlFor (<label for>): IDL set to false followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[label.htmlFor (<label for>): IDL set to object "[object Object\]" followed by getAttribute()]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[label.htmlFor (<label for>): IDL set to object "[object Object\]" followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[label.htmlFor (<label for>): IDL set to NaN followed by getAttribute()]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[label.htmlFor (<label for>): IDL set to NaN followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[label.htmlFor (<label for>): IDL set to Infinity followed by getAttribute()]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[label.htmlFor (<label for>): IDL set to Infinity followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[label.htmlFor (<label for>): IDL set to -Infinity followed by getAttribute()]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[label.htmlFor (<label for>): IDL set to -Infinity followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[label.htmlFor (<label for>): IDL set to "\\0" followed by getAttribute()]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[label.htmlFor (<label for>): IDL set to null followed by getAttribute()]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[label.htmlFor (<label for>): IDL set to null followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[label.htmlFor (<label for>): IDL set to object "test-toString" followed by getAttribute()]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[label.htmlFor (<label for>): IDL set to object "test-toString" followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[label.htmlFor (<label for>): IDL set to object "test-valueOf" followed by IDL get]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[label.itemScope: typeof IDL attribute]
|
[label.itemScope: typeof IDL attribute]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,3 @@
|
||||||
[A form control has no label 2.]
|
[A form control has no label 2.]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[A label's htmlFor attribute must reflect the for content attribute]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue