mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01: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
|
// https://html.spec.whatwg.org/multipage/#other-elements,-attributes-and-apis:isindex-2
|
||||||
local_name!("isindex") => make!(HTMLUnknownElement),
|
local_name!("isindex") => make!(HTMLUnknownElement),
|
||||||
local_name!("kbd") => make!(HTMLElement),
|
local_name!("kbd") => make!(HTMLElement),
|
||||||
|
// https://html.spec.whatwg.org/multipage/#keygen
|
||||||
|
local_name!("keygen") => make!(HTMLUnknownElement),
|
||||||
local_name!("label") => make!(HTMLLabelElement),
|
local_name!("label") => make!(HTMLLabelElement),
|
||||||
local_name!("legend") => make!(HTMLLegendElement),
|
local_name!("legend") => make!(HTMLLegendElement),
|
||||||
local_name!("li") => make!(HTMLLIElement),
|
local_name!("li") => make!(HTMLLIElement),
|
||||||
|
|
|
@ -3949,13 +3949,21 @@ impl Element {
|
||||||
fn click_event_filter_by_disabled_state(&self) -> bool {
|
fn click_event_filter_by_disabled_state(&self) -> bool {
|
||||||
let node = self.upcast::<Node>();
|
let node = self.upcast::<Node>();
|
||||||
match node.type_id() {
|
match node.type_id() {
|
||||||
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLButtonElement)) |
|
NodeTypeId::Element(ElementTypeId::HTMLElement(
|
||||||
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLInputElement)) |
|
HTMLElementTypeId::HTMLButtonElement,
|
||||||
// NodeTypeId::Element(ElementTypeId::HTMLKeygenElement) |
|
)) |
|
||||||
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLOptionElement)) |
|
NodeTypeId::Element(ElementTypeId::HTMLElement(
|
||||||
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLSelectElement)) |
|
HTMLElementTypeId::HTMLInputElement,
|
||||||
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLTextAreaElement))
|
)) |
|
||||||
if self.disabled_state() => true,
|
NodeTypeId::Element(ElementTypeId::HTMLElement(
|
||||||
|
HTMLElementTypeId::HTMLOptionElement,
|
||||||
|
)) |
|
||||||
|
NodeTypeId::Element(ElementTypeId::HTMLElement(
|
||||||
|
HTMLElementTypeId::HTMLSelectElement,
|
||||||
|
)) |
|
||||||
|
NodeTypeId::Element(ElementTypeId::HTMLElement(
|
||||||
|
HTMLElementTypeId::HTMLTextAreaElement,
|
||||||
|
)) if self.disabled_state() => true,
|
||||||
_ => false,
|
_ => false,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -650,7 +650,6 @@ impl HTMLElement {
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/multipage/#category-label
|
// https://html.spec.whatwg.org/multipage/#category-label
|
||||||
pub fn is_labelable_element(&self) -> bool {
|
pub fn is_labelable_element(&self) -> bool {
|
||||||
// Note: HTMLKeygenElement is omitted because Servo doesn't currently implement it
|
|
||||||
match self.upcast::<Node>().type_id() {
|
match self.upcast::<Node>().type_id() {
|
||||||
NodeTypeId::Element(ElementTypeId::HTMLElement(type_id)) => match type_id {
|
NodeTypeId::Element(ElementTypeId::HTMLElement(type_id)) => match type_id {
|
||||||
HTMLElementTypeId::HTMLInputElement => {
|
HTMLElementTypeId::HTMLInputElement => {
|
||||||
|
@ -670,12 +669,6 @@ impl HTMLElement {
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/multipage/#category-listed
|
// https://html.spec.whatwg.org/multipage/#category-listed
|
||||||
pub fn is_listed_element(&self) -> bool {
|
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() {
|
match self.upcast::<Node>().type_id() {
|
||||||
NodeTypeId::Element(ElementTypeId::HTMLElement(type_id)) => match type_id {
|
NodeTypeId::Element(ElementTypeId::HTMLElement(type_id)) => match type_id {
|
||||||
HTMLElementTypeId::HTMLButtonElement |
|
HTMLElementTypeId::HTMLButtonElement |
|
||||||
|
|
|
@ -366,10 +366,10 @@ impl HTMLFormElementMethods for HTMLFormElement {
|
||||||
elem.downcast::<HTMLTextAreaElement>().unwrap().form_owner()
|
elem.downcast::<HTMLTextAreaElement>().unwrap().form_owner()
|
||||||
},
|
},
|
||||||
_ => {
|
_ => {
|
||||||
debug_assert!(
|
debug_assert!(!elem
|
||||||
!elem.downcast::<HTMLElement>().unwrap().is_listed_element() ||
|
.downcast::<HTMLElement>()
|
||||||
elem.local_name() == &local_name!("keygen")
|
.unwrap()
|
||||||
);
|
.is_listed_element());
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -1287,11 +1287,6 @@ impl HTMLFormElement {
|
||||||
)) => {
|
)) => {
|
||||||
child.downcast::<HTMLInputElement>().unwrap().reset();
|
child.downcast::<HTMLInputElement>().unwrap().reset();
|
||||||
},
|
},
|
||||||
// TODO HTMLKeygenElement unimplemented
|
|
||||||
//NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLKeygenElement)) => {
|
|
||||||
// // Unimplemented
|
|
||||||
// {}
|
|
||||||
//}
|
|
||||||
NodeTypeId::Element(ElementTypeId::HTMLElement(
|
NodeTypeId::Element(ElementTypeId::HTMLElement(
|
||||||
HTMLElementTypeId::HTMLSelectElement,
|
HTMLElementTypeId::HTMLSelectElement,
|
||||||
)) => {
|
)) => {
|
||||||
|
|
|
@ -521,13 +521,6 @@ impl Tokenizer {
|
||||||
|
|
||||||
if let Some(control) = control {
|
if let Some(control) = control {
|
||||||
control.set_form_owner_from_parser(&form);
|
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 } => {
|
ParseOperation::Pop { node } => {
|
||||||
|
|
|
@ -1182,13 +1182,6 @@ impl TreeSink for Sink {
|
||||||
|
|
||||||
if let Some(control) = control {
|
if let Some(control) = control {
|
||||||
control.set_form_owner_from_parser(&form);
|
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;
|
unicode-bidi: bidi-override;
|
||||||
}
|
}
|
||||||
input:not([type=submit i]):not([type=reset i]):not([type=button i]),
|
input:not([type=submit i]):not([type=reset i]):not([type=button i]),
|
||||||
textarea, keygen {
|
textarea {
|
||||||
unicode-bidi: normal;
|
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-indent: initial;
|
||||||
text-transform: none;
|
text-transform: none;
|
||||||
}
|
}
|
||||||
|
|
|
@ -13256,7 +13256,7 @@
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
"htmlfieldsetelement_elements.html": [
|
"htmlfieldsetelement_elements.html": [
|
||||||
"ee0ea4ae15f1f9cd4e1cdb76c5f4c9f13e139bef",
|
"cb5757555f2f7c52803e50c6cd4f191f49dda4c5",
|
||||||
[
|
[
|
||||||
null,
|
null,
|
||||||
{}
|
{}
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<button>Click!</button>
|
<button>Click!</button>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
<!-- The keygen element should not be recognized as a listed element -->
|
||||||
<keygen name="key">
|
<keygen name="key">
|
||||||
<textarea>
|
<textarea>
|
||||||
A
|
A
|
||||||
|
@ -31,17 +32,16 @@
|
||||||
<script>
|
<script>
|
||||||
test(function() {
|
test(function() {
|
||||||
var fs = document.getElementById("fs");
|
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[0] instanceof HTMLInputElement, "Should be HTMLInputElement");
|
||||||
assert_true(fs.elements[1] instanceof HTMLFieldSetElement, "Should be HTMLFieldSetElement");
|
assert_true(fs.elements[1] instanceof HTMLFieldSetElement, "Should be HTMLFieldSetElement");
|
||||||
assert_true(fs.elements[2] instanceof HTMLButtonElement, "Should be HTMLButtonElement");
|
assert_true(fs.elements[2] instanceof HTMLButtonElement, "Should be HTMLButtonElement");
|
||||||
assert_true(fs.elements[3] instanceof HTMLUnknownElement, "Should be HTMLUnknownElement");
|
assert_true(fs.elements[3] instanceof HTMLTextAreaElement, "Should be HTMLTextAreaElement");
|
||||||
assert_true(fs.elements[4] instanceof HTMLTextAreaElement, "Should be HTMLTextAreaElement");
|
assert_true(fs.elements[4] instanceof HTMLSelectElement, "Should be HTMLSelectElement");
|
||||||
assert_true(fs.elements[5] 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[6] instanceof HTMLInputElement, "Should be HTMLInputElement");
|
||||||
assert_true(fs.elements[7] instanceof HTMLInputElement, "Should be HTMLInputElement");
|
assert_true(fs.elements[7] instanceof HTMLOutputElement, "Should be HTMLOutputElement");
|
||||||
assert_true(fs.elements[8] instanceof HTMLOutputElement, "Should be HTMLOutputElement");
|
assert_true(fs.elements[8] instanceof HTMLObjectElement, "Should be HTMLObjectElement");
|
||||||
assert_true(fs.elements[9] instanceof HTMLObjectElement, "Should be HTMLObjectElement");
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
</html>
|
</html>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue