mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Fix #3933
This commit is contained in:
parent
bb7621f5dc
commit
09766511b5
7 changed files with 33 additions and 268 deletions
|
@ -91,6 +91,35 @@ impl<'a> HTMLOptionElementMethods for JSRef<'a, HTMLOptionElement> {
|
|||
let node: JSRef<Node> = NodeCast::from_ref(self);
|
||||
node.SetTextContent(Some(value))
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/forms.html#attr-option-value
|
||||
fn Value(self) -> DOMString {
|
||||
let element: JSRef<Element> = ElementCast::from_ref(self);
|
||||
let attr = &atom!("value");
|
||||
if element.has_attribute(attr) {
|
||||
element.get_string_attribute(attr)
|
||||
} else {
|
||||
self.Text()
|
||||
}
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/forms.html#attr-option-value
|
||||
make_setter!(SetValue, "value")
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/forms.html#attr-option-label
|
||||
fn Label(self) -> DOMString {
|
||||
let element: JSRef<Element> = ElementCast::from_ref(self);
|
||||
let attr = &atom!("label");
|
||||
if element.has_attribute(attr) {
|
||||
element.get_string_attribute(attr)
|
||||
} else {
|
||||
self.Text()
|
||||
}
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/forms.html#attr-option-label
|
||||
make_setter!(SetLabel, "label")
|
||||
|
||||
}
|
||||
|
||||
impl<'a> VirtualMethods for JSRef<'a, HTMLOptionElement> {
|
||||
|
@ -110,7 +139,7 @@ impl<'a> VirtualMethods for JSRef<'a, HTMLOptionElement> {
|
|||
let node: JSRef<Node> = NodeCast::from_ref(*self);
|
||||
node.set_disabled_state(true);
|
||||
node.set_enabled_state(false);
|
||||
},
|
||||
}
|
||||
_ => ()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,10 +8,10 @@
|
|||
interface HTMLOptionElement : HTMLElement {
|
||||
attribute boolean disabled;
|
||||
//readonly attribute HTMLFormElement? form;
|
||||
// attribute DOMString label;
|
||||
attribute DOMString label;
|
||||
// attribute boolean defaultSelected;
|
||||
// attribute boolean selected;
|
||||
// attribute DOMString value;
|
||||
attribute DOMString value;
|
||||
|
||||
attribute DOMString text;
|
||||
//readonly attribute long index;
|
||||
|
|
|
@ -6135,36 +6135,24 @@
|
|||
[HTMLOptionElement interface: attribute form]
|
||||
expected: FAIL
|
||||
|
||||
[HTMLOptionElement interface: attribute label]
|
||||
expected: FAIL
|
||||
|
||||
[HTMLOptionElement interface: attribute defaultSelected]
|
||||
expected: FAIL
|
||||
|
||||
[HTMLOptionElement interface: attribute selected]
|
||||
expected: FAIL
|
||||
|
||||
[HTMLOptionElement interface: attribute value]
|
||||
expected: FAIL
|
||||
|
||||
[HTMLOptionElement interface: attribute index]
|
||||
expected: FAIL
|
||||
|
||||
[HTMLOptionElement interface: document.createElement("option") must inherit property "form" with the proper type (1)]
|
||||
expected: FAIL
|
||||
|
||||
[HTMLOptionElement interface: document.createElement("option") must inherit property "label" with the proper type (2)]
|
||||
expected: FAIL
|
||||
|
||||
[HTMLOptionElement interface: document.createElement("option") must inherit property "defaultSelected" with the proper type (3)]
|
||||
expected: FAIL
|
||||
|
||||
[HTMLOptionElement interface: document.createElement("option") must inherit property "selected" with the proper type (4)]
|
||||
expected: FAIL
|
||||
|
||||
[HTMLOptionElement interface: document.createElement("option") must inherit property "value" with the proper type (5)]
|
||||
expected: FAIL
|
||||
|
||||
[HTMLOptionElement interface: document.createElement("option") must inherit property "index" with the proper type (7)]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -13527,93 +13527,6 @@
|
|||
[option.tabIndex: IDL set to -2147483648 followed by getAttribute()]
|
||||
expected: FAIL
|
||||
|
||||
[option.label: typeof IDL attribute]
|
||||
expected: FAIL
|
||||
|
||||
[option.label: IDL get with DOM attribute unset]
|
||||
expected: FAIL
|
||||
|
||||
[option.label: IDL set to "" followed by getAttribute()]
|
||||
expected: FAIL
|
||||
|
||||
[option.label: 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
|
||||
|
||||
[option.label: IDL set to undefined followed by getAttribute()]
|
||||
expected: FAIL
|
||||
|
||||
[option.label: IDL set to undefined followed by IDL get]
|
||||
expected: FAIL
|
||||
|
||||
[option.label: IDL set to 7 followed by getAttribute()]
|
||||
expected: FAIL
|
||||
|
||||
[option.label: IDL set to 7 followed by IDL get]
|
||||
expected: FAIL
|
||||
|
||||
[option.label: IDL set to 1.5 followed by getAttribute()]
|
||||
expected: FAIL
|
||||
|
||||
[option.label: IDL set to 1.5 followed by IDL get]
|
||||
expected: FAIL
|
||||
|
||||
[option.label: IDL set to true followed by getAttribute()]
|
||||
expected: FAIL
|
||||
|
||||
[option.label: IDL set to true followed by IDL get]
|
||||
expected: FAIL
|
||||
|
||||
[option.label: IDL set to false followed by getAttribute()]
|
||||
expected: FAIL
|
||||
|
||||
[option.label: IDL set to false followed by IDL get]
|
||||
expected: FAIL
|
||||
|
||||
[option.label: IDL set to object "[object Object\]" followed by getAttribute()]
|
||||
expected: FAIL
|
||||
|
||||
[option.label: IDL set to object "[object Object\]" followed by IDL get]
|
||||
expected: FAIL
|
||||
|
||||
[option.label: IDL set to NaN followed by getAttribute()]
|
||||
expected: FAIL
|
||||
|
||||
[option.label: IDL set to NaN followed by IDL get]
|
||||
expected: FAIL
|
||||
|
||||
[option.label: IDL set to Infinity followed by getAttribute()]
|
||||
expected: FAIL
|
||||
|
||||
[option.label: IDL set to Infinity followed by IDL get]
|
||||
expected: FAIL
|
||||
|
||||
[option.label: IDL set to -Infinity followed by getAttribute()]
|
||||
expected: FAIL
|
||||
|
||||
[option.label: IDL set to -Infinity followed by IDL get]
|
||||
expected: FAIL
|
||||
|
||||
[option.label: IDL set to "\\0" followed by getAttribute()]
|
||||
expected: FAIL
|
||||
|
||||
[option.label: IDL set to null followed by getAttribute()]
|
||||
expected: FAIL
|
||||
|
||||
[option.label: IDL set to null followed by IDL get]
|
||||
expected: FAIL
|
||||
|
||||
[option.label: IDL set to object "test-toString" followed by getAttribute()]
|
||||
expected: FAIL
|
||||
|
||||
[option.label: IDL set to object "test-toString" followed by IDL get]
|
||||
expected: FAIL
|
||||
|
||||
[option.label: IDL set to object "test-valueOf" followed by getAttribute()]
|
||||
expected: FAIL
|
||||
|
||||
[option.label: IDL set to object "test-valueOf" followed by IDL get]
|
||||
expected: FAIL
|
||||
|
||||
[option.defaultSelected (<option selected>): typeof IDL attribute]
|
||||
expected: FAIL
|
||||
|
||||
|
@ -13722,93 +13635,6 @@
|
|||
[option.defaultSelected (<option selected>): IDL set to object "test-valueOf" followed by IDL get]
|
||||
expected: FAIL
|
||||
|
||||
[option.value: typeof IDL attribute]
|
||||
expected: FAIL
|
||||
|
||||
[option.value: IDL get with DOM attribute unset]
|
||||
expected: FAIL
|
||||
|
||||
[option.value: IDL set to "" followed by getAttribute()]
|
||||
expected: FAIL
|
||||
|
||||
[option.value: 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
|
||||
|
||||
[option.value: IDL set to undefined followed by getAttribute()]
|
||||
expected: FAIL
|
||||
|
||||
[option.value: IDL set to undefined followed by IDL get]
|
||||
expected: FAIL
|
||||
|
||||
[option.value: IDL set to 7 followed by getAttribute()]
|
||||
expected: FAIL
|
||||
|
||||
[option.value: IDL set to 7 followed by IDL get]
|
||||
expected: FAIL
|
||||
|
||||
[option.value: IDL set to 1.5 followed by getAttribute()]
|
||||
expected: FAIL
|
||||
|
||||
[option.value: IDL set to 1.5 followed by IDL get]
|
||||
expected: FAIL
|
||||
|
||||
[option.value: IDL set to true followed by getAttribute()]
|
||||
expected: FAIL
|
||||
|
||||
[option.value: IDL set to true followed by IDL get]
|
||||
expected: FAIL
|
||||
|
||||
[option.value: IDL set to false followed by getAttribute()]
|
||||
expected: FAIL
|
||||
|
||||
[option.value: IDL set to false followed by IDL get]
|
||||
expected: FAIL
|
||||
|
||||
[option.value: IDL set to object "[object Object\]" followed by getAttribute()]
|
||||
expected: FAIL
|
||||
|
||||
[option.value: IDL set to object "[object Object\]" followed by IDL get]
|
||||
expected: FAIL
|
||||
|
||||
[option.value: IDL set to NaN followed by getAttribute()]
|
||||
expected: FAIL
|
||||
|
||||
[option.value: IDL set to NaN followed by IDL get]
|
||||
expected: FAIL
|
||||
|
||||
[option.value: IDL set to Infinity followed by getAttribute()]
|
||||
expected: FAIL
|
||||
|
||||
[option.value: IDL set to Infinity followed by IDL get]
|
||||
expected: FAIL
|
||||
|
||||
[option.value: IDL set to -Infinity followed by getAttribute()]
|
||||
expected: FAIL
|
||||
|
||||
[option.value: IDL set to -Infinity followed by IDL get]
|
||||
expected: FAIL
|
||||
|
||||
[option.value: IDL set to "\\0" followed by getAttribute()]
|
||||
expected: FAIL
|
||||
|
||||
[option.value: IDL set to null followed by getAttribute()]
|
||||
expected: FAIL
|
||||
|
||||
[option.value: IDL set to null followed by IDL get]
|
||||
expected: FAIL
|
||||
|
||||
[option.value: IDL set to object "test-toString" followed by getAttribute()]
|
||||
expected: FAIL
|
||||
|
||||
[option.value: IDL set to object "test-toString" followed by IDL get]
|
||||
expected: FAIL
|
||||
|
||||
[option.value: IDL set to object "test-valueOf" followed by getAttribute()]
|
||||
expected: FAIL
|
||||
|
||||
[option.value: IDL set to object "test-valueOf" followed by IDL get]
|
||||
expected: FAIL
|
||||
|
||||
[option.itemScope: typeof IDL attribute]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
[datalistoptions.html]
|
||||
type: testharness
|
||||
[options label/value]
|
||||
expected: FAIL
|
||||
|
||||
[If an element has a datalist element ancestor, it is barred from constraint validation]
|
||||
expected: FAIL
|
||||
|
|
|
@ -1,38 +0,0 @@
|
|||
[option-label.html]
|
||||
type: testharness
|
||||
[No children, no label]
|
||||
expected: FAIL
|
||||
|
||||
[No children, empty label]
|
||||
expected: FAIL
|
||||
|
||||
[No children, label]
|
||||
expected: FAIL
|
||||
|
||||
[No children, namespaced label]
|
||||
expected: FAIL
|
||||
|
||||
[Single child, no label]
|
||||
expected: FAIL
|
||||
|
||||
[Single child, empty label]
|
||||
expected: FAIL
|
||||
|
||||
[Single child, label]
|
||||
expected: FAIL
|
||||
|
||||
[Single child, namespaced label]
|
||||
expected: FAIL
|
||||
|
||||
[Two children, no label]
|
||||
expected: FAIL
|
||||
|
||||
[Two children, empty label]
|
||||
expected: FAIL
|
||||
|
||||
[Two children, label]
|
||||
expected: FAIL
|
||||
|
||||
[Two children, namespaced label]
|
||||
expected: FAIL
|
||||
|
|
@ -1,38 +0,0 @@
|
|||
[option-value.html]
|
||||
type: testharness
|
||||
[No children, no value]
|
||||
expected: FAIL
|
||||
|
||||
[No children, empty value]
|
||||
expected: FAIL
|
||||
|
||||
[No children, value]
|
||||
expected: FAIL
|
||||
|
||||
[No children, namespaced value]
|
||||
expected: FAIL
|
||||
|
||||
[Single child, no value]
|
||||
expected: FAIL
|
||||
|
||||
[Single child, empty value]
|
||||
expected: FAIL
|
||||
|
||||
[Single child, value]
|
||||
expected: FAIL
|
||||
|
||||
[Single child, namespaced value]
|
||||
expected: FAIL
|
||||
|
||||
[Two children, no value]
|
||||
expected: FAIL
|
||||
|
||||
[Two children, empty value]
|
||||
expected: FAIL
|
||||
|
||||
[Two children, value]
|
||||
expected: FAIL
|
||||
|
||||
[Two children, namespaced value]
|
||||
expected: FAIL
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue