mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Treat the keygen
element as obsolete (#30429)
* Eradicate the `keygen` element * Run `./mach fmt` * Fix relevant Servo test * Fix outdated manifest
This commit is contained in:
parent
f330cf534d
commit
80d9a2bb4f
10 changed files with 31 additions and 47 deletions
|
@ -308,6 +308,8 @@ pub fn create_native_html_element(
|
|||
// https://html.spec.whatwg.org/multipage/#other-elements,-attributes-and-apis:isindex-2
|
||||
local_name!("isindex") => make!(HTMLUnknownElement),
|
||||
local_name!("kbd") => make!(HTMLElement),
|
||||
// https://html.spec.whatwg.org/multipage/#keygen
|
||||
local_name!("keygen") => make!(HTMLUnknownElement),
|
||||
local_name!("label") => make!(HTMLLabelElement),
|
||||
local_name!("legend") => make!(HTMLLegendElement),
|
||||
local_name!("li") => make!(HTMLLIElement),
|
||||
|
|
|
@ -3949,13 +3949,21 @@ impl Element {
|
|||
fn click_event_filter_by_disabled_state(&self) -> bool {
|
||||
let node = self.upcast::<Node>();
|
||||
match node.type_id() {
|
||||
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLButtonElement)) |
|
||||
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLInputElement)) |
|
||||
// NodeTypeId::Element(ElementTypeId::HTMLKeygenElement) |
|
||||
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLOptionElement)) |
|
||||
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLSelectElement)) |
|
||||
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLTextAreaElement))
|
||||
if self.disabled_state() => true,
|
||||
NodeTypeId::Element(ElementTypeId::HTMLElement(
|
||||
HTMLElementTypeId::HTMLButtonElement,
|
||||
)) |
|
||||
NodeTypeId::Element(ElementTypeId::HTMLElement(
|
||||
HTMLElementTypeId::HTMLInputElement,
|
||||
)) |
|
||||
NodeTypeId::Element(ElementTypeId::HTMLElement(
|
||||
HTMLElementTypeId::HTMLOptionElement,
|
||||
)) |
|
||||
NodeTypeId::Element(ElementTypeId::HTMLElement(
|
||||
HTMLElementTypeId::HTMLSelectElement,
|
||||
)) |
|
||||
NodeTypeId::Element(ElementTypeId::HTMLElement(
|
||||
HTMLElementTypeId::HTMLTextAreaElement,
|
||||
)) if self.disabled_state() => true,
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
|
|
|
@ -650,7 +650,6 @@ impl HTMLElement {
|
|||
|
||||
// https://html.spec.whatwg.org/multipage/#category-label
|
||||
pub fn is_labelable_element(&self) -> bool {
|
||||
// Note: HTMLKeygenElement is omitted because Servo doesn't currently implement it
|
||||
match self.upcast::<Node>().type_id() {
|
||||
NodeTypeId::Element(ElementTypeId::HTMLElement(type_id)) => match type_id {
|
||||
HTMLElementTypeId::HTMLInputElement => {
|
||||
|
@ -670,12 +669,6 @@ impl HTMLElement {
|
|||
|
||||
// https://html.spec.whatwg.org/multipage/#category-listed
|
||||
pub fn is_listed_element(&self) -> bool {
|
||||
// Servo does not implement HTMLKeygenElement
|
||||
// https://github.com/servo/servo/issues/2782
|
||||
if self.upcast::<Element>().local_name() == &local_name!("keygen") {
|
||||
return true;
|
||||
}
|
||||
|
||||
match self.upcast::<Node>().type_id() {
|
||||
NodeTypeId::Element(ElementTypeId::HTMLElement(type_id)) => match type_id {
|
||||
HTMLElementTypeId::HTMLButtonElement |
|
||||
|
|
|
@ -366,10 +366,10 @@ impl HTMLFormElementMethods for HTMLFormElement {
|
|||
elem.downcast::<HTMLTextAreaElement>().unwrap().form_owner()
|
||||
},
|
||||
_ => {
|
||||
debug_assert!(
|
||||
!elem.downcast::<HTMLElement>().unwrap().is_listed_element() ||
|
||||
elem.local_name() == &local_name!("keygen")
|
||||
);
|
||||
debug_assert!(!elem
|
||||
.downcast::<HTMLElement>()
|
||||
.unwrap()
|
||||
.is_listed_element());
|
||||
return false;
|
||||
},
|
||||
},
|
||||
|
@ -1287,11 +1287,6 @@ impl HTMLFormElement {
|
|||
)) => {
|
||||
child.downcast::<HTMLInputElement>().unwrap().reset();
|
||||
},
|
||||
// TODO HTMLKeygenElement unimplemented
|
||||
//NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLKeygenElement)) => {
|
||||
// // Unimplemented
|
||||
// {}
|
||||
//}
|
||||
NodeTypeId::Element(ElementTypeId::HTMLElement(
|
||||
HTMLElementTypeId::HTMLSelectElement,
|
||||
)) => {
|
||||
|
|
|
@ -521,13 +521,6 @@ impl Tokenizer {
|
|||
|
||||
if let Some(control) = control {
|
||||
control.set_form_owner_from_parser(&form);
|
||||
} else {
|
||||
// TODO remove this code when keygen is implemented.
|
||||
assert_eq!(
|
||||
node.NodeName(),
|
||||
"KEYGEN",
|
||||
"Unknown form-associatable element"
|
||||
);
|
||||
}
|
||||
},
|
||||
ParseOperation::Pop { node } => {
|
||||
|
|
|
@ -1182,13 +1182,6 @@ impl TreeSink for Sink {
|
|||
|
||||
if let Some(control) = control {
|
||||
control.set_form_owner_from_parser(&form);
|
||||
} else {
|
||||
// TODO remove this code when keygen is implemented.
|
||||
assert_eq!(
|
||||
node.NodeName(),
|
||||
"KEYGEN",
|
||||
"Unknown form-associatable element"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -18,6 +18,6 @@ tbody, tfoot, tr, td, th, dir, dd, dl, dt, menu, ol, ul, li, [dir=ltr i],
|
|||
unicode-bidi: bidi-override;
|
||||
}
|
||||
input:not([type=submit i]):not([type=reset i]):not([type=button i]),
|
||||
textarea, keygen {
|
||||
textarea {
|
||||
unicode-bidi: normal;
|
||||
}
|
||||
|
|
|
@ -250,7 +250,7 @@ table:matches(
|
|||
}
|
||||
|
||||
|
||||
input, select, option, optgroup, button, textarea, keygen {
|
||||
input, select, option, optgroup, button, textarea {
|
||||
text-indent: initial;
|
||||
text-transform: none;
|
||||
}
|
||||
|
|
|
@ -13256,7 +13256,7 @@
|
|||
]
|
||||
],
|
||||
"htmlfieldsetelement_elements.html": [
|
||||
"ee0ea4ae15f1f9cd4e1cdb76c5f4c9f13e139bef",
|
||||
"cb5757555f2f7c52803e50c6cd4f191f49dda4c5",
|
||||
[
|
||||
null,
|
||||
{}
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
<fieldset>
|
||||
<button>Click!</button>
|
||||
</fieldset>
|
||||
<!-- The keygen element should not be recognized as a listed element -->
|
||||
<keygen name="key">
|
||||
<textarea>
|
||||
A
|
||||
|
@ -31,17 +32,16 @@
|
|||
<script>
|
||||
test(function() {
|
||||
var fs = document.getElementById("fs");
|
||||
assert_equals(fs.elements.length, 10);
|
||||
assert_equals(fs.elements.length, 9);
|
||||
assert_true(fs.elements[0] instanceof HTMLInputElement, "Should be HTMLInputElement");
|
||||
assert_true(fs.elements[1] instanceof HTMLFieldSetElement, "Should be HTMLFieldSetElement");
|
||||
assert_true(fs.elements[2] instanceof HTMLButtonElement, "Should be HTMLButtonElement");
|
||||
assert_true(fs.elements[3] instanceof HTMLUnknownElement, "Should be HTMLUnknownElement");
|
||||
assert_true(fs.elements[4] instanceof HTMLTextAreaElement, "Should be HTMLTextAreaElement");
|
||||
assert_true(fs.elements[5] instanceof HTMLSelectElement, "Should be HTMLSelectElement");
|
||||
assert_true(fs.elements[3] instanceof HTMLTextAreaElement, "Should be HTMLTextAreaElement");
|
||||
assert_true(fs.elements[4] instanceof HTMLSelectElement, "Should be HTMLSelectElement");
|
||||
assert_true(fs.elements[5] instanceof HTMLInputElement, "Should be HTMLInputElement");
|
||||
assert_true(fs.elements[6] instanceof HTMLInputElement, "Should be HTMLInputElement");
|
||||
assert_true(fs.elements[7] instanceof HTMLInputElement, "Should be HTMLInputElement");
|
||||
assert_true(fs.elements[8] instanceof HTMLOutputElement, "Should be HTMLOutputElement");
|
||||
assert_true(fs.elements[9] instanceof HTMLObjectElement, "Should be HTMLObjectElement");
|
||||
assert_true(fs.elements[7] instanceof HTMLOutputElement, "Should be HTMLOutputElement");
|
||||
assert_true(fs.elements[8] instanceof HTMLObjectElement, "Should be HTMLObjectElement");
|
||||
});
|
||||
</script>
|
||||
</html>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue