mirror of
https://gitlab.com/xmpp-rs/xmpp-rs.git
synced 2024-07-12 22:21:53 +00:00
media_element: Also check for unknown attributes.
This commit is contained in:
parent
4875f15201
commit
6e48d0f65a
1 changed files with 2 additions and 3 deletions
|
@ -57,9 +57,8 @@ impl TryFrom<Element> for MediaElement {
|
||||||
type Err = Error;
|
type Err = Error;
|
||||||
|
|
||||||
fn try_from(elem: Element) -> Result<MediaElement, Error> {
|
fn try_from(elem: Element) -> Result<MediaElement, Error> {
|
||||||
if !elem.is("media", ns::MEDIA_ELEMENT) {
|
check_self!(elem, "media", ns::MEDIA_ELEMENT);
|
||||||
return Err(Error::ParseError("This is not a media element."));
|
check_no_unknown_attributes!(elem, "media", ["width", "height"]);
|
||||||
}
|
|
||||||
|
|
||||||
let mut media = MediaElement {
|
let mut media = MediaElement {
|
||||||
width: get_attr!(elem, "width", optional),
|
width: get_attr!(elem, "width", optional),
|
||||||
|
|
Loading…
Reference in a new issue