mirror of
https://github.com/servo/servo
synced 2026-04-26 01:25:32 +02:00
script: Add longdesc reflection to HTMLIFrameElement and HTMLFrameElement Also corrects the reflection for HTMLImageElement to use USVString. Testing: Covered by WPTs Signed-off-by: Luke Warlow <lwarlow@igalia.com>
58 lines
1.7 KiB
Rust
58 lines
1.7 KiB
Rust
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
|
|
|
use dom_struct::dom_struct;
|
|
use html5ever::{LocalName, Prefix};
|
|
use js::rust::HandleObject;
|
|
use script_bindings::codegen::GenericBindings::HTMLFrameElementBinding::HTMLFrameElement_Binding::HTMLFrameElementMethods;
|
|
|
|
use crate::dom::bindings::root::DomRoot;
|
|
use crate::dom::bindings::str::USVString;
|
|
use crate::dom::document::Document;
|
|
use crate::dom::html::htmlelement::HTMLElement;
|
|
use crate::dom::node::Node;
|
|
use crate::script_runtime::CanGc;
|
|
|
|
#[dom_struct]
|
|
pub(crate) struct HTMLFrameElement {
|
|
htmlelement: HTMLElement,
|
|
}
|
|
|
|
impl HTMLFrameElement {
|
|
fn new_inherited(
|
|
local_name: LocalName,
|
|
prefix: Option<Prefix>,
|
|
document: &Document,
|
|
) -> HTMLFrameElement {
|
|
HTMLFrameElement {
|
|
htmlelement: HTMLElement::new_inherited(local_name, prefix, document),
|
|
}
|
|
}
|
|
|
|
pub(crate) fn new(
|
|
local_name: LocalName,
|
|
prefix: Option<Prefix>,
|
|
document: &Document,
|
|
proto: Option<HandleObject>,
|
|
can_gc: CanGc,
|
|
) -> DomRoot<HTMLFrameElement> {
|
|
Node::reflect_node_with_proto(
|
|
Box::new(HTMLFrameElement::new_inherited(
|
|
local_name, prefix, document,
|
|
)),
|
|
document,
|
|
proto,
|
|
can_gc,
|
|
)
|
|
}
|
|
}
|
|
|
|
impl HTMLFrameElementMethods<crate::DomTypeHolder> for HTMLFrameElement {
|
|
// https://html.spec.whatwg.org/multipage/#dom-frame-longdesc
|
|
make_url_getter!(LongDesc, "longdesc");
|
|
|
|
// https://html.spec.whatwg.org/multipage/#dom-frame-longdesc
|
|
make_url_setter!(SetLongDesc, "longdesc");
|
|
}
|