content: Replace uses of downcast+is_some/is_none with is (#33804)

* content: Replace uses of downcast+is_some/is_none with is

Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com>

* Remove ! to return correct logic

Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com>

---------

Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com>
This commit is contained in:
tanishka 2024-10-11 21:10:39 +05:30 committed by GitHub
parent c5899e596d
commit 27b25e869b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 5 additions and 8 deletions

View file

@ -1102,10 +1102,7 @@ impl HTMLFormElement {
let child = child.upcast::<Node>();
// Step 5.1: The field element has a datalist element ancestor.
if child
.ancestors()
.any(|a| DomRoot::downcast::<HTMLDataListElement>(a).is_some())
{
if child.ancestors().any(|a| a.is::<HTMLDataListElement>()) {
continue;
}
if let NodeTypeId::Element(ElementTypeId::HTMLElement(element)) = child.type_id() {