use std::borrow::Cow;
use wasm_bindgen::JsCast;
use crate::core::anymore::AnyDebug;
use crate::modifiers::{Attr, Class, ClassIter, Rotate, Scale, ScaleValue, Style, StyleIter};
use crate::props::{WithElementProps, WithHtmlInputElementProps};
use crate::{DomNode, DomView, IntoAttributeValue, OptionalAction, Pointer, PointerMsg, events};
macro_rules! event_handler_mixin {
($(($event_ty: ident, $fn_name:ident, $event:expr, $web_sys_event_type:ident),)*) => {
$(
#[doc = concat!("Add an \"", $event, "\" event handler to this [`Element`].")]
fn $fn_name<Callback, OA>(
self,
handler: Callback,
) -> events::$event_ty<Self, State, Action, Callback>
where
State: 'static,
Action: 'static,
OA: OptionalAction<Action> + 'static,
Callback: Fn(&mut State, web_sys::$web_sys_event_type) -> OA + 'static,
{
events::$event_ty::new(self, handler)
}
)*
};
}
pub trait Element<State, Action = ()>:
Sized + DomView<State, Action, DomNode: DomNode<Props: WithElementProps> + AsRef<web_sys::Element>>
{
fn attr(
self,
name: impl Into<Cow<'static, str>>,
value: impl IntoAttributeValue,
) -> Attr<Self, State, Action> {
Attr::new(self, name.into(), value.into_attr_value())
}
fn class<AsClasses: ClassIter>(
self,
as_classes: AsClasses,
) -> Class<Self, AsClasses, State, Action> {
Class::new(self, as_classes)
}
fn on<Event, Callback, OA>(
self,
event: impl Into<Cow<'static, str>>,
handler: Callback,
) -> events::OnEvent<Self, State, Action, Event, Callback>
where
State: 'static,
Action: 'static,
OA: OptionalAction<Action>,
Callback: Fn(&mut State, Event) -> OA + 'static,
Event: JsCast + 'static + AnyDebug,
{
events::OnEvent::new(self, event, handler)
}
fn pointer<Callback: Fn(&mut State, PointerMsg)>(
self,
handler: Callback,
) -> Pointer<Self, State, Action, Callback> {
crate::pointer::pointer(self, handler)
}
fn id(self, value: impl IntoAttributeValue) -> Attr<Self, State, Action> {
Attr::new(self, Cow::from("id"), value.into_attr_value())
}
fn style<AsStyles: StyleIter>(self, styles: AsStyles) -> Style<Self, AsStyles, State, Action> {
Style::new(self, styles)
}
fn rotate(self, radians: f64) -> Rotate<Self, State, Action> {
Rotate::new(self, radians)
}
fn scale(self, scale: impl Into<ScaleValue>) -> Scale<Self, State, Action> {
Scale::new(self, scale)
}
event_handler_mixin!(
(OnAbort, on_abort, "abort", Event),
(OnAuxClick, on_auxclick, "auxclick", PointerEvent),
(OnBeforeInput, on_beforeinput, "beforeinput", InputEvent),
(OnBeforeMatch, on_beforematch, "beforematch", Event),
(OnBeforeToggle, on_beforetoggle, "beforetoggle", Event),
(OnBlur, on_blur, "blur", FocusEvent),
(OnCancel, on_cancel, "cancel", Event),
(OnCanPlay, on_canplay, "canplay", Event),
(OnCanPlayThrough, on_canplaythrough, "canplaythrough", Event),
(OnChange, on_change, "change", Event),
(OnClick, on_click, "click", PointerEvent),
(OnClose, on_close, "close", Event),
(OnContextLost, on_contextlost, "contextlost", Event),
(OnContextMenu, on_contextmenu, "contextmenu", PointerEvent),
(
OnContextRestored,
on_contextrestored,
"contextrestored",
Event
),
(OnCopy, on_copy, "copy", Event),
(OnCueChange, on_cuechange, "cuechange", Event),
(OnCut, on_cut, "cut", Event),
(OnDblClick, on_dblclick, "dblclick", MouseEvent),
(OnDrag, on_drag, "drag", Event),
(OnDragEnd, on_dragend, "dragend", Event),
(OnDragEnter, on_dragenter, "dragenter", Event),
(OnDragLeave, on_dragleave, "dragleave", Event),
(OnDragOver, on_dragover, "dragover", Event),
(OnDragStart, on_dragstart, "dragstart", Event),
(OnDrop, on_drop, "drop", Event),
(OnDurationChange, on_durationchange, "durationchange", Event),
(OnEmptied, on_emptied, "emptied", Event),
(OnEnded, on_ended, "ended", Event),
(OnError, on_error, "error", Event),
(OnFocus, on_focus, "focus", FocusEvent),
(OnFocusIn, on_focusin, "focusin", FocusEvent),
(OnFocusOut, on_focusout, "focusout", FocusEvent),
(OnFormData, on_formdata, "formdata", Event),
(OnInput, on_input, "input", Event),
(OnInvalid, on_invalid, "invalid", Event),
(OnKeyDown, on_keydown, "keydown", KeyboardEvent),
(OnKeyUp, on_keyup, "keyup", KeyboardEvent),
(OnLoad, on_load, "load", Event),
(OnLoadedData, on_loadeddata, "loadeddata", Event),
(OnLoadedMetadata, on_loadedmetadata, "loadedmetadata", Event),
(OnLoadStart, on_loadstart, "loadstart", Event),
(OnMouseDown, on_mousedown, "mousedown", MouseEvent),
(OnMouseEnter, on_mouseenter, "mouseenter", MouseEvent),
(OnMouseLeave, on_mouseleave, "mouseleave", MouseEvent),
(OnMouseMove, on_mousemove, "mousemove", MouseEvent),
(OnMouseOut, on_mouseout, "mouseout", MouseEvent),
(OnMouseOver, on_mouseover, "mouseover", MouseEvent),
(OnMouseUp, on_mouseup, "mouseup", MouseEvent),
(OnPaste, on_paste, "paste", Event),
(OnPause, on_pause, "pause", Event),
(OnPlay, on_play, "play", Event),
(OnPlaying, on_playing, "playing", Event),
(
OnPointerCancel,
on_pointercancel,
"pointercancel",
PointerEvent
),
(OnPointerDown, on_pointerdown, "pointerdown", PointerEvent),
(
OnPointerEnter,
on_pointerenter,
"pointerenter",
PointerEvent
),
(
OnPointerLeave,
on_pointerleave,
"pointerleave",
PointerEvent
),
(OnPointerMove, on_pointermove, "pointermove", PointerEvent),
(OnPointerOut, on_pointerout, "pointerout", PointerEvent),
(OnPointerOver, on_pointerover, "pointerover", PointerEvent),
(
OnPointerRawUpdate,
on_pointerrawupdate,
"pointerrawupdate",
PointerEvent
),
(OnPointerUp, on_pointerup, "pointerup", PointerEvent),
(OnProgress, on_progress, "progress", Event),
(OnRateChange, on_ratechange, "ratechange", Event),
(OnReset, on_reset, "reset", Event),
(OnScroll, on_scroll, "scroll", Event),
(OnScrollEnd, on_scrollend, "scrollend", Event),
(
OnSecurityPolicyViolation,
on_securitypolicyviolation,
"securitypolicyviolation",
Event
),
(OnSeeked, on_seeked, "seeked", Event),
(OnSeeking, on_seeking, "seeking", Event),
(OnSelect, on_select, "select", Event),
(OnSlotChange, on_slotchange, "slotchange", Event),
(OnStalled, on_stalled, "stalled", Event),
(OnSubmit, on_submit, "submit", Event),
(OnSuspend, on_suspend, "suspend", Event),
(OnTimeUpdate, on_timeupdate, "timeupdate", Event),
(OnToggle, on_toggle, "toggle", Event),
(OnVolumeChange, on_volumechange, "volumechange", Event),
(OnWaiting, on_waiting, "waiting", Event),
(OnWheel, on_wheel, "wheel", WheelEvent),
);
fn on_resize<Callback, OA>(
self,
handler: Callback,
) -> events::OnResize<Self, State, Action, Callback>
where
State: 'static,
Action: 'static,
OA: OptionalAction<Action>,
Callback: Fn(&mut State, web_sys::ResizeObserverEntry) -> OA + 'static,
Self::Element: AsRef<web_sys::Element>,
{
events::OnResize {
dom_view: self,
handler,
phantom_event_ty: std::marker::PhantomData,
}
}
}
impl<State, Action, T> Element<State, Action> for T
where
T: DomView<State, Action>,
<T::DomNode as DomNode>::Props: WithElementProps,
T::DomNode: AsRef<web_sys::Element>,
{
}
pub trait HtmlAnchorElement<State, Action = ()>:
HtmlElement<State, Action, DomNode: AsRef<web_sys::HtmlAnchorElement>>
{
}
impl<State, Action, T> HtmlAnchorElement<State, Action> for T
where
T: HtmlElement<State, Action>,
T::DomNode: AsRef<web_sys::HtmlAnchorElement>,
{
}
pub trait HtmlAreaElement<State, Action = ()>:
HtmlElement<State, Action, DomNode: AsRef<web_sys::HtmlAreaElement>>
{
}
impl<State, Action, T> HtmlAreaElement<State, Action> for T
where
T: HtmlElement<State, Action>,
T::DomNode: AsRef<web_sys::HtmlAreaElement>,
{
}
pub trait HtmlAudioElement<State, Action = ()>:
HtmlMediaElement<State, Action, DomNode: AsRef<web_sys::HtmlAudioElement>>
{
}
impl<State, Action, T> HtmlAudioElement<State, Action> for T
where
T: HtmlMediaElement<State, Action>,
T::DomNode: AsRef<web_sys::HtmlAudioElement>,
{
}
pub trait HtmlBrElement<State, Action = ()>:
HtmlElement<State, Action, DomNode: AsRef<web_sys::HtmlBrElement>>
{
}
impl<State, Action, T> HtmlBrElement<State, Action> for T
where
T: HtmlElement<State, Action>,
T::DomNode: AsRef<web_sys::HtmlBrElement>,
{
}
pub trait HtmlButtonElement<State, Action = ()>:
HtmlElement<State, Action, DomNode: AsRef<web_sys::HtmlButtonElement>>
{
fn disabled(self, disable: bool) -> Attr<Self, State, Action> {
Attr::new(self, "disabled".into(), disable.into_attr_value())
}
}
impl<State, Action, T> HtmlButtonElement<State, Action> for T
where
T: HtmlElement<State, Action>,
T::DomNode: AsRef<web_sys::HtmlButtonElement>,
{
}
pub trait HtmlCanvasElement<State, Action = ()>:
HtmlElement<State, Action, DomNode: AsRef<web_sys::HtmlCanvasElement>>
{
fn width(self, value: u32) -> Attr<Self, State, Action> {
Attr::new(self, "width".into(), value.into_attr_value())
}
}
impl<State, Action, T> HtmlCanvasElement<State, Action> for T
where
T: HtmlElement<State, Action>,
T::DomNode: AsRef<web_sys::HtmlCanvasElement>,
{
}
pub trait HtmlDataElement<State, Action = ()>:
HtmlElement<State, Action, DomNode: AsRef<web_sys::HtmlDataElement>>
{
}
impl<State, Action, T> HtmlDataElement<State, Action> for T
where
T: HtmlElement<State, Action>,
T::DomNode: AsRef<web_sys::HtmlDataElement>,
{
}
pub trait HtmlDataListElement<State, Action = ()>:
HtmlElement<State, Action, DomNode: AsRef<web_sys::HtmlDataListElement>>
{
}
impl<State, Action, T> HtmlDataListElement<State, Action> for T
where
T: HtmlElement<State, Action>,
T::DomNode: AsRef<web_sys::HtmlDataListElement>,
{
}
pub trait HtmlDetailsElement<State, Action = ()>:
HtmlElement<State, Action, DomNode: AsRef<web_sys::HtmlDetailsElement>>
{
}
impl<State, Action, T> HtmlDetailsElement<State, Action> for T
where
T: HtmlElement<State, Action>,
T::DomNode: AsRef<web_sys::HtmlDetailsElement>,
{
}
pub trait HtmlDialogElement<State, Action = ()>:
HtmlElement<State, Action, DomNode: AsRef<web_sys::HtmlDialogElement>>
{
}
impl<State, Action, T> HtmlDialogElement<State, Action> for T
where
T: HtmlElement<State, Action>,
T::DomNode: AsRef<web_sys::HtmlDialogElement>,
{
}
pub trait HtmlDivElement<State, Action = ()>:
HtmlElement<State, Action, DomNode: AsRef<web_sys::HtmlDivElement>>
{
}
impl<State, Action, T> HtmlDivElement<State, Action> for T
where
T: HtmlElement<State, Action>,
T::DomNode: AsRef<web_sys::HtmlDivElement>,
{
}
pub trait HtmlDListElement<State, Action = ()>:
HtmlElement<State, Action, DomNode: AsRef<web_sys::HtmlDListElement>>
{
}
impl<State, Action, T> HtmlDListElement<State, Action> for T
where
T: HtmlElement<State, Action>,
T::DomNode: AsRef<web_sys::HtmlDListElement>,
{
}
pub trait HtmlElement<State, Action = ()>:
Element<State, Action, DomNode: AsRef<web_sys::HtmlElement>>
{
}
impl<State, Action, T> HtmlElement<State, Action> for T
where
T: Element<State, Action>,
T::DomNode: AsRef<web_sys::HtmlElement>,
{
}
pub trait HtmlEmbedElement<State, Action = ()>:
HtmlElement<State, Action, DomNode: AsRef<web_sys::HtmlEmbedElement>>
{
}
impl<State, Action, T> HtmlEmbedElement<State, Action> for T
where
T: HtmlElement<State, Action>,
T::DomNode: AsRef<web_sys::HtmlEmbedElement>,
{
}
pub trait HtmlFieldSetElement<State, Action = ()>:
HtmlElement<State, Action, DomNode: AsRef<web_sys::HtmlFieldSetElement>>
{
}
impl<State, Action, T> HtmlFieldSetElement<State, Action> for T
where
T: HtmlElement<State, Action>,
T::DomNode: AsRef<web_sys::HtmlFieldSetElement>,
{
}
pub trait HtmlFormElement<State, Action = ()>:
HtmlElement<State, Action, DomNode: AsRef<web_sys::HtmlFormElement>>
{
}
impl<State, Action, T> HtmlFormElement<State, Action> for T
where
T: HtmlElement<State, Action>,
T::DomNode: AsRef<web_sys::HtmlFormElement>,
{
}
pub trait HtmlHeadingElement<State, Action = ()>:
HtmlElement<State, Action, DomNode: AsRef<web_sys::HtmlHeadingElement>>
{
}
impl<State, Action, T> HtmlHeadingElement<State, Action> for T
where
T: HtmlElement<State, Action>,
T::DomNode: AsRef<web_sys::HtmlHeadingElement>,
{
}
pub trait HtmlHrElement<State, Action = ()>:
HtmlElement<State, Action, DomNode: AsRef<web_sys::HtmlHrElement>>
{
}
impl<State, Action, T> HtmlHrElement<State, Action> for T
where
T: HtmlElement<State, Action>,
T::DomNode: AsRef<web_sys::HtmlHrElement>,
{
}
pub trait HtmlIFrameElement<State, Action = ()>:
HtmlElement<State, Action, DomNode: AsRef<web_sys::HtmlIFrameElement>>
{
fn src(self, value: impl IntoAttributeValue) -> Attr<Self, State, Action> {
Attr::new(self, "src".into(), value.into_attr_value())
}
}
impl<State, Action, T> HtmlIFrameElement<State, Action> for T
where
T: HtmlElement<State, Action>,
T::DomNode: AsRef<web_sys::HtmlIFrameElement>,
{
}
pub trait HtmlImageElement<State, Action = ()>:
HtmlElement<State, Action, DomNode: AsRef<web_sys::HtmlImageElement>>
{
fn src(self, value: impl IntoAttributeValue) -> Attr<Self, State, Action> {
Attr::new(self, Cow::from("src"), value.into_attr_value())
}
}
impl<State, Action, T> HtmlImageElement<State, Action> for T
where
T: HtmlElement<State, Action>,
T::DomNode: AsRef<web_sys::HtmlImageElement>,
{
}
use crate::modifiers::html_input_element;
pub trait HtmlInputElement<State, Action = ()>:
HtmlElement<
State,
Action,
DomNode: DomNode<Props: WithHtmlInputElementProps> + AsRef<web_sys::HtmlInputElement>,
>
{
fn checked(self, checked: bool) -> html_input_element::view::Checked<Self, State, Action> {
html_input_element::view::Checked::new(self, checked)
}
fn type_(self, value: impl Into<Cow<'static, str>>) -> Attr<Self, State, Action> {
Attr::new(self, "type".into(), value.into().into_attr_value())
}
fn name(self, value: impl Into<Cow<'static, str>>) -> Attr<Self, State, Action> {
Attr::new(self, "name".into(), value.into().into_attr_value())
}
fn default_checked(
self,
default_checked: bool,
) -> html_input_element::view::DefaultChecked<Self, State, Action> {
html_input_element::view::DefaultChecked::new(self, default_checked)
}
fn disabled(self, disabled: bool) -> html_input_element::view::Disabled<Self, State, Action> {
html_input_element::view::Disabled::new(self, disabled)
}
fn required(self, required: bool) -> html_input_element::view::Required<Self, State, Action> {
html_input_element::view::Required::new(self, required)
}
fn multiple(self, multiple: bool) -> html_input_element::view::Multiple<Self, State, Action> {
html_input_element::view::Multiple::new(self, multiple)
}
}
impl<State, Action, T> HtmlInputElement<State, Action> for T
where
T: HtmlElement<State, Action>,
T::DomNode: AsRef<web_sys::HtmlInputElement>,
<T::DomNode as DomNode>::Props: WithHtmlInputElementProps,
{
}
pub trait HtmlLabelElement<State, Action = ()>:
HtmlElement<State, Action, DomNode: AsRef<web_sys::HtmlLabelElement>>
{
fn for_(self, value: impl IntoAttributeValue) -> Attr<Self, State, Action> {
Attr::new(self, Cow::from("for"), value.into_attr_value())
}
}
impl<State, Action, T> HtmlLabelElement<State, Action> for T
where
T: HtmlElement<State, Action>,
T::DomNode: AsRef<web_sys::HtmlLabelElement>,
{
}
pub trait HtmlLegendElement<State, Action = ()>:
HtmlElement<State, Action, DomNode: AsRef<web_sys::HtmlLegendElement>>
{
}
impl<State, Action, T> HtmlLegendElement<State, Action> for T
where
T: HtmlElement<State, Action>,
T::DomNode: AsRef<web_sys::HtmlLegendElement>,
{
}
pub trait HtmlLiElement<State, Action = ()>:
HtmlElement<State, Action, DomNode: AsRef<web_sys::HtmlLiElement>>
{
fn value(self, value: i32) -> Attr<Self, State, Action> {
Attr::new(self, "value".into(), value.into_attr_value())
}
}
impl<State, Action, T> HtmlLiElement<State, Action> for T
where
T: HtmlElement<State, Action>,
T::DomNode: AsRef<web_sys::HtmlLiElement>,
{
}
pub trait HtmlLinkElement<State, Action = ()>:
HtmlElement<State, Action, DomNode: AsRef<web_sys::HtmlLinkElement>>
{
}
impl<State, Action, T> HtmlLinkElement<State, Action> for T
where
T: HtmlElement<State, Action>,
T::DomNode: AsRef<web_sys::HtmlLinkElement>,
{
}
pub trait HtmlMapElement<State, Action = ()>:
HtmlElement<State, Action, DomNode: AsRef<web_sys::HtmlMapElement>>
{
}
impl<State, Action, T> HtmlMapElement<State, Action> for T
where
T: HtmlElement<State, Action>,
T::DomNode: AsRef<web_sys::HtmlMapElement>,
{
}
pub trait HtmlMediaElement<State, Action = ()>:
HtmlElement<State, Action, DomNode: AsRef<web_sys::HtmlMediaElement>>
{
}
impl<State, Action, T> HtmlMediaElement<State, Action> for T
where
T: HtmlElement<State, Action>,
T::DomNode: AsRef<web_sys::HtmlMediaElement>,
{
}
pub trait HtmlMenuElement<State, Action = ()>:
HtmlElement<State, Action, DomNode: AsRef<web_sys::HtmlMenuElement>>
{
}
impl<State, Action, T> HtmlMenuElement<State, Action> for T
where
T: HtmlElement<State, Action>,
T::DomNode: AsRef<web_sys::HtmlMenuElement>,
{
}
pub trait HtmlMeterElement<State, Action = ()>:
HtmlElement<State, Action, DomNode: AsRef<web_sys::HtmlMeterElement>>
{
}
impl<State, Action, T> HtmlMeterElement<State, Action> for T
where
T: HtmlElement<State, Action>,
T::DomNode: AsRef<web_sys::HtmlMeterElement>,
{
}
pub trait HtmlModElement<State, Action = ()>:
HtmlElement<State, Action, DomNode: AsRef<web_sys::HtmlModElement>>
{
}
impl<State, Action, T> HtmlModElement<State, Action> for T
where
T: HtmlElement<State, Action>,
T::DomNode: AsRef<web_sys::HtmlModElement>,
{
}
pub trait HtmlObjectElement<State, Action = ()>:
HtmlElement<State, Action, DomNode: AsRef<web_sys::HtmlObjectElement>>
{
}
impl<State, Action, T> HtmlObjectElement<State, Action> for T
where
T: HtmlElement<State, Action>,
T::DomNode: AsRef<web_sys::HtmlObjectElement>,
{
}
pub trait HtmlOListElement<State, Action = ()>:
HtmlElement<State, Action, DomNode: AsRef<web_sys::HtmlOListElement>>
{
}
impl<State, Action, T> HtmlOListElement<State, Action> for T
where
T: HtmlElement<State, Action>,
T::DomNode: AsRef<web_sys::HtmlOListElement>,
{
}
pub trait HtmlOptGroupElement<State, Action = ()>:
HtmlElement<State, Action, DomNode: AsRef<web_sys::HtmlOptGroupElement>>
{
}
impl<State, Action, T> HtmlOptGroupElement<State, Action> for T
where
T: HtmlElement<State, Action>,
T::DomNode: AsRef<web_sys::HtmlOptGroupElement>,
{
}
pub trait HtmlOptionElement<State, Action = ()>:
HtmlElement<State, Action, DomNode: AsRef<web_sys::HtmlOptionElement>>
{
fn value(self, value: impl IntoAttributeValue) -> Attr<Self, State, Action> {
Attr::new(self, Cow::from("value"), value.into_attr_value())
}
fn selected(self, selected: bool) -> Attr<Self, State, Action> {
Attr::new(self, Cow::from("selected"), selected.into_attr_value())
}
}
impl<State, Action, T> HtmlOptionElement<State, Action> for T
where
T: HtmlElement<State, Action>,
T::DomNode: AsRef<web_sys::HtmlOptionElement>,
{
}
pub trait HtmlOutputElement<State, Action = ()>:
HtmlElement<State, Action, DomNode: AsRef<web_sys::HtmlOutputElement>>
{
}
impl<State, Action, T> HtmlOutputElement<State, Action> for T
where
T: HtmlElement<State, Action>,
T::DomNode: AsRef<web_sys::HtmlOutputElement>,
{
}
pub trait HtmlParagraphElement<State, Action = ()>:
HtmlElement<State, Action, DomNode: AsRef<web_sys::HtmlParagraphElement>>
{
}
impl<State, Action, T> HtmlParagraphElement<State, Action> for T
where
T: HtmlElement<State, Action>,
T::DomNode: AsRef<web_sys::HtmlParagraphElement>,
{
}
pub trait HtmlPictureElement<State, Action = ()>:
HtmlElement<State, Action, DomNode: AsRef<web_sys::HtmlPictureElement>>
{
}
impl<State, Action, T> HtmlPictureElement<State, Action> for T
where
T: HtmlElement<State, Action>,
T::DomNode: AsRef<web_sys::HtmlPictureElement>,
{
}
pub trait HtmlPreElement<State, Action = ()>:
HtmlElement<State, Action, DomNode: AsRef<web_sys::HtmlPreElement>>
{
}
impl<State, Action, T> HtmlPreElement<State, Action> for T
where
T: HtmlElement<State, Action>,
T::DomNode: AsRef<web_sys::HtmlPreElement>,
{
}
pub trait HtmlProgressElement<State, Action = ()>:
HtmlElement<State, Action, DomNode: AsRef<web_sys::HtmlProgressElement>>
{
}
impl<State, Action, T> HtmlProgressElement<State, Action> for T
where
T: HtmlElement<State, Action>,
T::DomNode: AsRef<web_sys::HtmlProgressElement>,
{
}
pub trait HtmlQuoteElement<State, Action = ()>:
HtmlElement<State, Action, DomNode: AsRef<web_sys::HtmlQuoteElement>>
{
}
impl<State, Action, T> HtmlQuoteElement<State, Action> for T
where
T: HtmlElement<State, Action>,
T::DomNode: AsRef<web_sys::HtmlQuoteElement>,
{
}
pub trait HtmlScriptElement<State, Action = ()>:
HtmlElement<State, Action, DomNode: AsRef<web_sys::HtmlScriptElement>>
{
}
impl<State, Action, T> HtmlScriptElement<State, Action> for T
where
T: HtmlElement<State, Action>,
T::DomNode: AsRef<web_sys::HtmlScriptElement>,
{
}
pub trait HtmlSelectElement<State, Action = ()>:
HtmlElement<State, Action, DomNode: AsRef<web_sys::HtmlSelectElement>>
{
fn value(self, value: impl IntoAttributeValue) -> Attr<Self, State, Action> {
Attr::new(self, Cow::from("value"), value.into_attr_value())
}
}
impl<State, Action, T> HtmlSelectElement<State, Action> for T
where
T: HtmlElement<State, Action>,
T::DomNode: AsRef<web_sys::HtmlSelectElement>,
{
}
pub trait HtmlSlotElement<State, Action = ()>:
HtmlElement<State, Action, DomNode: AsRef<web_sys::HtmlSlotElement>>
{
}
impl<State, Action, T> HtmlSlotElement<State, Action> for T
where
T: HtmlElement<State, Action>,
T::DomNode: AsRef<web_sys::HtmlSlotElement>,
{
}
pub trait HtmlSourceElement<State, Action = ()>:
HtmlElement<State, Action, DomNode: AsRef<web_sys::HtmlSourceElement>>
{
}
impl<State, Action, T> HtmlSourceElement<State, Action> for T
where
T: HtmlElement<State, Action>,
T::DomNode: AsRef<web_sys::HtmlSourceElement>,
{
}
pub trait HtmlSpanElement<State, Action = ()>:
HtmlElement<State, Action, DomNode: AsRef<web_sys::HtmlSpanElement>>
{
}
impl<State, Action, T> HtmlSpanElement<State, Action> for T
where
T: HtmlElement<State, Action>,
T::DomNode: AsRef<web_sys::HtmlSpanElement>,
{
}
pub trait HtmlTableCaptionElement<State, Action = ()>:
HtmlElement<State, Action, DomNode: AsRef<web_sys::HtmlTableCaptionElement>>
{
}
impl<State, Action, T> HtmlTableCaptionElement<State, Action> for T
where
T: HtmlElement<State, Action>,
T::DomNode: AsRef<web_sys::HtmlTableCaptionElement>,
{
}
pub trait HtmlTableCellElement<State, Action = ()>:
HtmlElement<State, Action, DomNode: AsRef<web_sys::HtmlTableCellElement>>
{
}
impl<State, Action, T> HtmlTableCellElement<State, Action> for T
where
T: HtmlElement<State, Action>,
T::DomNode: AsRef<web_sys::HtmlTableCellElement>,
{
}
pub trait HtmlTableColElement<State, Action = ()>:
HtmlElement<State, Action, DomNode: AsRef<web_sys::HtmlTableColElement>>
{
}
impl<State, Action, T> HtmlTableColElement<State, Action> for T
where
T: HtmlElement<State, Action>,
T::DomNode: AsRef<web_sys::HtmlTableColElement>,
{
}
pub trait HtmlTableElement<State, Action = ()>:
HtmlElement<State, Action, DomNode: AsRef<web_sys::HtmlTableElement>>
{
}
impl<State, Action, T> HtmlTableElement<State, Action> for T
where
T: HtmlElement<State, Action>,
T::DomNode: AsRef<web_sys::HtmlTableElement>,
{
}
pub trait HtmlTableRowElement<State, Action = ()>:
HtmlElement<State, Action, DomNode: AsRef<web_sys::HtmlTableRowElement>>
{
}
impl<State, Action, T> HtmlTableRowElement<State, Action> for T
where
T: HtmlElement<State, Action>,
T::DomNode: AsRef<web_sys::HtmlTableRowElement>,
{
}
pub trait HtmlTableSectionElement<State, Action = ()>:
HtmlElement<State, Action, DomNode: AsRef<web_sys::HtmlTableSectionElement>>
{
}
impl<State, Action, T> HtmlTableSectionElement<State, Action> for T
where
T: HtmlElement<State, Action>,
T::DomNode: AsRef<web_sys::HtmlTableSectionElement>,
{
}
pub trait HtmlTemplateElement<State, Action = ()>:
HtmlElement<State, Action, DomNode: AsRef<web_sys::HtmlTemplateElement>>
{
}
impl<State, Action, T> HtmlTemplateElement<State, Action> for T
where
T: HtmlElement<State, Action>,
T::DomNode: AsRef<web_sys::HtmlTemplateElement>,
{
}
pub trait HtmlTimeElement<State, Action = ()>:
HtmlElement<State, Action, DomNode: AsRef<web_sys::HtmlTimeElement>>
{
}
impl<State, Action, T> HtmlTimeElement<State, Action> for T
where
T: HtmlElement<State, Action>,
T::DomNode: AsRef<web_sys::HtmlTimeElement>,
{
}
pub trait HtmlTextAreaElement<State, Action = ()>:
HtmlElement<State, Action, DomNode: AsRef<web_sys::HtmlTextAreaElement>>
{
}
impl<State, Action, T> HtmlTextAreaElement<State, Action> for T
where
T: HtmlElement<State, Action>,
T::DomNode: AsRef<web_sys::HtmlTextAreaElement>,
{
}
pub trait HtmlTrackElement<State, Action = ()>:
HtmlElement<State, Action, DomNode: AsRef<web_sys::HtmlTrackElement>>
{
}
impl<State, Action, T> HtmlTrackElement<State, Action> for T
where
T: HtmlElement<State, Action>,
T::DomNode: AsRef<web_sys::HtmlTrackElement>,
{
}
pub trait HtmlUListElement<State, Action = ()>:
HtmlElement<State, Action, DomNode: AsRef<web_sys::HtmlUListElement>>
{
}
impl<State, Action, T> HtmlUListElement<State, Action> for T
where
T: HtmlElement<State, Action>,
T::DomNode: AsRef<web_sys::HtmlUListElement>,
{
}
pub trait HtmlVideoElement<State, Action = ()>:
HtmlMediaElement<State, Action, DomNode: AsRef<web_sys::HtmlVideoElement>>
{
}
impl<State, Action, T> HtmlVideoElement<State, Action> for T
where
T: HtmlMediaElement<State, Action>,
T::DomNode: AsRef<web_sys::HtmlVideoElement>,
{
}
pub trait SvgaElement<State, Action = ()>:
SvgGraphicsElement<State, Action, DomNode: AsRef<web_sys::SvgaElement>>
{
}
impl<State, Action, T> SvgaElement<State, Action> for T
where
T: SvgGraphicsElement<State, Action>,
T::DomNode: AsRef<web_sys::SvgaElement>,
{
}
pub trait SvgAnimateElement<State, Action = ()>:
SvgAnimationElement<State, Action, DomNode: AsRef<web_sys::SvgAnimateElement>>
{
}
impl<State, Action, T> SvgAnimateElement<State, Action> for T
where
T: SvgAnimationElement<State, Action>,
T::DomNode: AsRef<web_sys::SvgAnimateElement>,
{
}
pub trait SvgAnimateMotionElement<State, Action = ()>:
SvgAnimationElement<State, Action, DomNode: AsRef<web_sys::SvgAnimateMotionElement>>
{
}
impl<State, Action, T> SvgAnimateMotionElement<State, Action> for T
where
T: SvgAnimationElement<State, Action>,
T::DomNode: AsRef<web_sys::SvgAnimateMotionElement>,
{
}
pub trait SvgAnimateTransformElement<State, Action = ()>:
SvgAnimationElement<State, Action, DomNode: AsRef<web_sys::SvgAnimateTransformElement>>
{
}
impl<State, Action, T> SvgAnimateTransformElement<State, Action> for T
where
T: SvgAnimationElement<State, Action>,
T::DomNode: AsRef<web_sys::SvgAnimateTransformElement>,
{
}
pub trait SvgAnimationElement<State, Action = ()>:
SvgElement<State, Action, DomNode: AsRef<web_sys::SvgAnimationElement>>
{
}
impl<State, Action, T> SvgAnimationElement<State, Action> for T
where
T: SvgElement<State, Action>,
T::DomNode: AsRef<web_sys::SvgAnimationElement>,
{
}
pub trait SvgCircleElement<State, Action = ()>:
SvgGeometryElement<State, Action, DomNode: AsRef<web_sys::SvgCircleElement>>
{
fn fill(self, brush: impl Into<peniko::Brush>) -> crate::svg::Fill<Self, State, Action> {
crate::svg::fill(self, brush)
}
}
impl<State, Action, T> SvgCircleElement<State, Action> for T
where
T: SvgGeometryElement<State, Action>,
T::DomNode: AsRef<web_sys::SvgCircleElement>,
{
}
pub trait SvgClipPathElement<State, Action = ()>:
SvgElement<State, Action, DomNode: AsRef<web_sys::SvgClipPathElement>>
{
}
impl<State, Action, T> SvgClipPathElement<State, Action> for T
where
T: SvgElement<State, Action>,
T::DomNode: AsRef<web_sys::SvgClipPathElement>,
{
}
pub trait SvgComponentTransferFunctionElement<State, Action = ()>:
SvgElement<State, Action, DomNode: AsRef<web_sys::SvgComponentTransferFunctionElement>>
{
}
impl<State, Action, T> SvgComponentTransferFunctionElement<State, Action> for T
where
T: SvgElement<State, Action>,
T::DomNode: AsRef<web_sys::SvgComponentTransferFunctionElement>,
{
}
pub trait SvgDefsElement<State, Action = ()>:
SvgGraphicsElement<State, Action, DomNode: AsRef<web_sys::SvgDefsElement>>
{
}
impl<State, Action, T> SvgDefsElement<State, Action> for T
where
T: SvgGraphicsElement<State, Action>,
T::DomNode: AsRef<web_sys::SvgDefsElement>,
{
}
pub trait SvgDescElement<State, Action = ()>:
SvgElement<State, Action, DomNode: AsRef<web_sys::SvgDescElement>>
{
}
impl<State, Action, T> SvgDescElement<State, Action> for T
where
T: SvgElement<State, Action>,
T::DomNode: AsRef<web_sys::SvgDescElement>,
{
}
pub trait SvgElement<State, Action = ()>:
Element<State, Action, DomNode: AsRef<web_sys::SvgElement>>
{
}
impl<State, Action, T> SvgElement<State, Action> for T
where
T: Element<State, Action>,
T::DomNode: AsRef<web_sys::SvgElement>,
{
}
pub trait SvgEllipseElement<State, Action = ()>:
SvgGeometryElement<State, Action, DomNode: AsRef<web_sys::SvgEllipseElement>>
{
fn fill(self, brush: impl Into<peniko::Brush>) -> crate::svg::Fill<Self, State, Action> {
crate::svg::fill(self, brush)
}
}
impl<State, Action, T> SvgEllipseElement<State, Action> for T
where
T: SvgGeometryElement<State, Action>,
T::DomNode: AsRef<web_sys::SvgEllipseElement>,
{
}
pub trait SvgfeBlendElement<State, Action = ()>:
SvgElement<State, Action, DomNode: AsRef<web_sys::SvgfeBlendElement>>
{
}
impl<State, Action, T> SvgfeBlendElement<State, Action> for T
where
T: SvgElement<State, Action>,
T::DomNode: AsRef<web_sys::SvgfeBlendElement>,
{
}
pub trait SvgfeColorMatrixElement<State, Action = ()>:
SvgElement<State, Action, DomNode: AsRef<web_sys::SvgfeColorMatrixElement>>
{
}
impl<State, Action, T> SvgfeColorMatrixElement<State, Action> for T
where
T: SvgElement<State, Action>,
T::DomNode: AsRef<web_sys::SvgfeColorMatrixElement>,
{
}
pub trait SvgfeComponentTransferElement<State, Action = ()>:
SvgElement<State, Action, DomNode: AsRef<web_sys::SvgfeComponentTransferElement>>
{
}
impl<State, Action, T> SvgfeComponentTransferElement<State, Action> for T
where
T: SvgElement<State, Action>,
T::DomNode: AsRef<web_sys::SvgfeComponentTransferElement>,
{
}
pub trait SvgfeCompositeElement<State, Action = ()>:
SvgElement<State, Action, DomNode: AsRef<web_sys::SvgfeCompositeElement>>
{
}
impl<State, Action, T> SvgfeCompositeElement<State, Action> for T
where
T: SvgElement<State, Action>,
T::DomNode: AsRef<web_sys::SvgfeCompositeElement>,
{
}
pub trait SvgfeConvolveMatrixElement<State, Action = ()>:
SvgElement<State, Action, DomNode: AsRef<web_sys::SvgfeConvolveMatrixElement>>
{
}
impl<State, Action, T> SvgfeConvolveMatrixElement<State, Action> for T
where
T: SvgElement<State, Action>,
T::DomNode: AsRef<web_sys::SvgfeConvolveMatrixElement>,
{
}
pub trait SvgfeDiffuseLightingElement<State, Action = ()>:
SvgElement<State, Action, DomNode: AsRef<web_sys::SvgfeDiffuseLightingElement>>
{
}
impl<State, Action, T> SvgfeDiffuseLightingElement<State, Action> for T
where
T: SvgElement<State, Action>,
T::DomNode: AsRef<web_sys::SvgfeDiffuseLightingElement>,
{
}
pub trait SvgfeDisplacementMapElement<State, Action = ()>:
SvgElement<State, Action, DomNode: AsRef<web_sys::SvgfeDisplacementMapElement>>
{
}
impl<State, Action, T> SvgfeDisplacementMapElement<State, Action> for T
where
T: SvgElement<State, Action>,
T::DomNode: AsRef<web_sys::SvgfeDisplacementMapElement>,
{
}
pub trait SvgfeDistantLightElement<State, Action = ()>:
SvgElement<State, Action, DomNode: AsRef<web_sys::SvgfeDistantLightElement>>
{
}
impl<State, Action, T> SvgfeDistantLightElement<State, Action> for T
where
T: SvgElement<State, Action>,
T::DomNode: AsRef<web_sys::SvgfeDistantLightElement>,
{
}
pub trait SvgfeDropShadowElement<State, Action = ()>:
SvgElement<State, Action, DomNode: AsRef<web_sys::SvgfeDropShadowElement>>
{
}
impl<State, Action, T> SvgfeDropShadowElement<State, Action> for T
where
T: SvgElement<State, Action>,
T::DomNode: AsRef<web_sys::SvgfeDropShadowElement>,
{
}
pub trait SvgfeFloodElement<State, Action = ()>:
SvgElement<State, Action, DomNode: AsRef<web_sys::SvgfeFloodElement>>
{
}
impl<State, Action, T> SvgfeFloodElement<State, Action> for T
where
T: SvgElement<State, Action>,
T::DomNode: AsRef<web_sys::SvgfeFloodElement>,
{
}
pub trait SvgfeFuncAElement<State, Action = ()>:
SvgComponentTransferFunctionElement<State, Action, DomNode: AsRef<web_sys::SvgfeFuncAElement>>
{
}
impl<State, Action, T> SvgfeFuncAElement<State, Action> for T
where
T: SvgComponentTransferFunctionElement<State, Action>,
T::DomNode: AsRef<web_sys::SvgfeFuncAElement>,
{
}
pub trait SvgfeFuncBElement<State, Action = ()>:
SvgComponentTransferFunctionElement<State, Action, DomNode: AsRef<web_sys::SvgfeFuncBElement>>
{
}
impl<State, Action, T> SvgfeFuncBElement<State, Action> for T
where
T: SvgComponentTransferFunctionElement<State, Action>,
T::DomNode: AsRef<web_sys::SvgfeFuncBElement>,
{
}
pub trait SvgfeFuncGElement<State, Action = ()>:
SvgComponentTransferFunctionElement<State, Action, DomNode: AsRef<web_sys::SvgfeFuncGElement>>
{
}
impl<State, Action, T> SvgfeFuncGElement<State, Action> for T
where
T: SvgComponentTransferFunctionElement<State, Action>,
T::DomNode: AsRef<web_sys::SvgfeFuncGElement>,
{
}
pub trait SvgfeFuncRElement<State, Action = ()>:
SvgComponentTransferFunctionElement<State, Action, DomNode: AsRef<web_sys::SvgfeFuncRElement>>
{
}
impl<State, Action, T> SvgfeFuncRElement<State, Action> for T
where
T: SvgComponentTransferFunctionElement<State, Action>,
T::DomNode: AsRef<web_sys::SvgfeFuncRElement>,
{
}
pub trait SvgfeGaussianBlurElement<State, Action = ()>:
SvgElement<State, Action, DomNode: AsRef<web_sys::SvgfeGaussianBlurElement>>
{
}
impl<State, Action, T> SvgfeGaussianBlurElement<State, Action> for T
where
T: SvgElement<State, Action>,
T::DomNode: AsRef<web_sys::SvgfeGaussianBlurElement>,
{
}
pub trait SvgfeImageElement<State, Action = ()>:
SvgElement<State, Action, DomNode: AsRef<web_sys::SvgfeImageElement>>
{
}
impl<State, Action, T> SvgfeImageElement<State, Action> for T
where
T: SvgElement<State, Action>,
T::DomNode: AsRef<web_sys::SvgfeImageElement>,
{
}
pub trait SvgfeMergeElement<State, Action = ()>:
SvgElement<State, Action, DomNode: AsRef<web_sys::SvgfeMergeElement>>
{
}
impl<State, Action, T> SvgfeMergeElement<State, Action> for T
where
T: SvgElement<State, Action>,
T::DomNode: AsRef<web_sys::SvgfeMergeElement>,
{
}
pub trait SvgfeMergeNodeElement<State, Action = ()>:
SvgElement<State, Action, DomNode: AsRef<web_sys::SvgfeMergeNodeElement>>
{
}
impl<State, Action, T> SvgfeMergeNodeElement<State, Action> for T
where
T: SvgElement<State, Action>,
T::DomNode: AsRef<web_sys::SvgfeMergeNodeElement>,
{
}
pub trait SvgfeMorphologyElement<State, Action = ()>:
SvgElement<State, Action, DomNode: AsRef<web_sys::SvgfeMorphologyElement>>
{
}
impl<State, Action, T> SvgfeMorphologyElement<State, Action> for T
where
T: SvgElement<State, Action>,
T::DomNode: AsRef<web_sys::SvgfeMorphologyElement>,
{
}
pub trait SvgfeOffsetElement<State, Action = ()>:
SvgElement<State, Action, DomNode: AsRef<web_sys::SvgfeOffsetElement>>
{
}
impl<State, Action, T> SvgfeOffsetElement<State, Action> for T
where
T: SvgElement<State, Action>,
T::DomNode: AsRef<web_sys::SvgfeOffsetElement>,
{
}
pub trait SvgfePointLightElement<State, Action = ()>:
SvgElement<State, Action, DomNode: AsRef<web_sys::SvgfePointLightElement>>
{
}
impl<State, Action, T> SvgfePointLightElement<State, Action> for T
where
T: SvgElement<State, Action>,
T::DomNode: AsRef<web_sys::SvgfePointLightElement>,
{
}
pub trait SvgfeSpecularLightingElement<State, Action = ()>:
SvgElement<State, Action, DomNode: AsRef<web_sys::SvgfeSpecularLightingElement>>
{
}
impl<State, Action, T> SvgfeSpecularLightingElement<State, Action> for T
where
T: SvgElement<State, Action>,
T::DomNode: AsRef<web_sys::SvgfeSpecularLightingElement>,
{
}
pub trait SvgfeSpotLightElement<State, Action = ()>:
SvgElement<State, Action, DomNode: AsRef<web_sys::SvgfeSpotLightElement>>
{
}
impl<State, Action, T> SvgfeSpotLightElement<State, Action> for T
where
T: SvgElement<State, Action>,
T::DomNode: AsRef<web_sys::SvgfeSpotLightElement>,
{
}
pub trait SvgfeTileElement<State, Action = ()>:
SvgElement<State, Action, DomNode: AsRef<web_sys::SvgfeTileElement>>
{
}
impl<State, Action, T> SvgfeTileElement<State, Action> for T
where
T: SvgElement<State, Action>,
T::DomNode: AsRef<web_sys::SvgfeTileElement>,
{
}
pub trait SvgfeTurbulenceElement<State, Action = ()>:
SvgElement<State, Action, DomNode: AsRef<web_sys::SvgfeTurbulenceElement>>
{
}
impl<State, Action, T> SvgfeTurbulenceElement<State, Action> for T
where
T: SvgElement<State, Action>,
T::DomNode: AsRef<web_sys::SvgfeTurbulenceElement>,
{
}
pub trait SvgFilterElement<State, Action = ()>:
SvgElement<State, Action, DomNode: AsRef<web_sys::SvgFilterElement>>
{
}
impl<State, Action, T> SvgFilterElement<State, Action> for T
where
T: SvgElement<State, Action>,
T::DomNode: AsRef<web_sys::SvgFilterElement>,
{
}
pub trait SvgForeignObjectElement<State, Action = ()>:
SvgGraphicsElement<State, Action, DomNode: AsRef<web_sys::SvgForeignObjectElement>>
{
}
impl<State, Action, T> SvgForeignObjectElement<State, Action> for T
where
T: SvgGraphicsElement<State, Action>,
T::DomNode: AsRef<web_sys::SvgForeignObjectElement>,
{
}
pub trait SvggElement<State, Action = ()>:
SvgGraphicsElement<State, Action, DomNode: AsRef<web_sys::SvggElement>>
{
fn fill(self, brush: impl Into<peniko::Brush>) -> crate::svg::Fill<Self, State, Action> {
crate::svg::fill(self, brush)
}
fn stroke(
self,
brush: impl Into<peniko::Brush>,
style: peniko::kurbo::Stroke,
) -> crate::svg::Stroke<Self, State, Action> {
crate::svg::stroke(self, brush, style)
}
}
impl<State, Action, T> SvggElement<State, Action> for T
where
T: SvgGraphicsElement<State, Action>,
T::DomNode: AsRef<web_sys::SvggElement>,
{
}
pub trait SvgGeometryElement<State, Action = ()>:
SvgGraphicsElement<State, Action, DomNode: AsRef<web_sys::SvgGeometryElement>>
{
fn stroke(
self,
brush: impl Into<peniko::Brush>,
style: peniko::kurbo::Stroke,
) -> crate::svg::Stroke<Self, State, Action> {
crate::svg::stroke(self, brush, style)
}
}
impl<State, Action, T> SvgGeometryElement<State, Action> for T
where
T: SvgGraphicsElement<State, Action>,
T::DomNode: AsRef<web_sys::SvgGeometryElement>,
{
}
pub trait SvgGradientElement<State, Action = ()>:
SvgElement<State, Action, DomNode: AsRef<web_sys::SvgGradientElement>>
{
}
impl<State, Action, T> SvgGradientElement<State, Action> for T
where
T: SvgElement<State, Action>,
T::DomNode: AsRef<web_sys::SvgGradientElement>,
{
}
pub trait SvgGraphicsElement<State, Action = ()>:
SvgElement<State, Action, DomNode: AsRef<web_sys::SvgGraphicsElement>>
{
}
impl<State, Action, T> SvgGraphicsElement<State, Action> for T
where
T: SvgElement<State, Action>,
T::DomNode: AsRef<web_sys::SvgGraphicsElement>,
{
}
pub trait SvgImageElement<State, Action = ()>:
SvgGraphicsElement<State, Action, DomNode: AsRef<web_sys::SvgImageElement>>
{
}
impl<State, Action, T> SvgImageElement<State, Action> for T
where
T: SvgGraphicsElement<State, Action>,
T::DomNode: AsRef<web_sys::SvgImageElement>,
{
}
pub trait SvgLinearGradientElement<State, Action = ()>:
SvgGradientElement<State, Action, DomNode: AsRef<web_sys::SvgLinearGradientElement>>
{
}
impl<State, Action, T> SvgLinearGradientElement<State, Action> for T
where
T: SvgGradientElement<State, Action>,
T::DomNode: AsRef<web_sys::SvgLinearGradientElement>,
{
}
pub trait SvgLineElement<State, Action = ()>:
SvgGeometryElement<State, Action, DomNode: AsRef<web_sys::SvgLineElement>>
{
}
impl<State, Action, T> SvgLineElement<State, Action> for T
where
T: SvgGeometryElement<State, Action>,
T::DomNode: AsRef<web_sys::SvgLineElement>,
{
}
pub trait SvgMarkerElement<State, Action = ()>:
SvgElement<State, Action, DomNode: AsRef<web_sys::SvgMarkerElement>>
{
}
impl<State, Action, T> SvgMarkerElement<State, Action> for T
where
T: SvgElement<State, Action>,
T::DomNode: AsRef<web_sys::SvgMarkerElement>,
{
}
pub trait SvgMaskElement<State, Action = ()>:
SvgElement<State, Action, DomNode: AsRef<web_sys::SvgMaskElement>>
{
}
impl<State, Action, T> SvgMaskElement<State, Action> for T
where
T: SvgElement<State, Action>,
T::DomNode: AsRef<web_sys::SvgMaskElement>,
{
}
pub trait SvgMetadataElement<State, Action = ()>:
SvgElement<State, Action, DomNode: AsRef<web_sys::SvgMetadataElement>>
{
}
impl<State, Action, T> SvgMetadataElement<State, Action> for T
where
T: SvgElement<State, Action>,
T::DomNode: AsRef<web_sys::SvgMetadataElement>,
{
}
pub trait SvgmPathElement<State, Action = ()>:
SvgElement<State, Action, DomNode: AsRef<web_sys::SvgmPathElement>>
{
}
impl<State, Action, T> SvgmPathElement<State, Action> for T
where
T: SvgElement<State, Action>,
T::DomNode: AsRef<web_sys::SvgmPathElement>,
{
}
pub trait SvgPathElement<State, Action = ()>:
SvgGeometryElement<State, Action, DomNode: AsRef<web_sys::SvgPathElement>>
{
fn fill(self, brush: impl Into<peniko::Brush>) -> crate::svg::Fill<Self, State, Action> {
crate::svg::fill(self, brush)
}
}
impl<State, Action, T> SvgPathElement<State, Action> for T
where
T: SvgGeometryElement<State, Action>,
T::DomNode: AsRef<web_sys::SvgPathElement>,
{
}
pub trait SvgPatternElement<State, Action = ()>:
SvgElement<State, Action, DomNode: AsRef<web_sys::SvgPatternElement>>
{
}
impl<State, Action, T> SvgPatternElement<State, Action> for T
where
T: SvgElement<State, Action>,
T::DomNode: AsRef<web_sys::SvgPatternElement>,
{
}
pub trait SvgPolygonElement<State, Action = ()>:
SvgGeometryElement<State, Action, DomNode: AsRef<web_sys::SvgPolygonElement>>
{
fn fill(self, brush: impl Into<peniko::Brush>) -> crate::svg::Fill<Self, State, Action> {
crate::svg::fill(self, brush)
}
}
impl<State, Action, T> SvgPolygonElement<State, Action> for T
where
T: SvgGeometryElement<State, Action>,
T::DomNode: AsRef<web_sys::SvgPolygonElement>,
{
}
pub trait SvgPolylineElement<State, Action = ()>:
SvgGeometryElement<State, Action, DomNode: AsRef<web_sys::SvgPolylineElement>>
{
fn fill(self, brush: impl Into<peniko::Brush>) -> crate::svg::Fill<Self, State, Action> {
crate::svg::fill(self, brush)
}
}
impl<State, Action, T> SvgPolylineElement<State, Action> for T
where
T: SvgGeometryElement<State, Action>,
T::DomNode: AsRef<web_sys::SvgPolylineElement>,
{
}
pub trait SvgRectElement<State, Action = ()>:
SvgGeometryElement<State, Action, DomNode: AsRef<web_sys::SvgRectElement>>
{
fn fill(self, brush: impl Into<peniko::Brush>) -> crate::svg::Fill<Self, State, Action> {
crate::svg::fill(self, brush)
}
}
impl<State, Action, T> SvgRectElement<State, Action> for T
where
T: SvgGeometryElement<State, Action>,
T::DomNode: AsRef<web_sys::SvgRectElement>,
{
}
pub trait SvgScriptElement<State, Action = ()>:
SvgElement<State, Action, DomNode: AsRef<web_sys::SvgScriptElement>>
{
}
impl<State, Action, T> SvgScriptElement<State, Action> for T
where
T: SvgElement<State, Action>,
T::DomNode: AsRef<web_sys::SvgScriptElement>,
{
}
pub trait SvgSetElement<State, Action = ()>:
SvgAnimationElement<State, Action, DomNode: AsRef<web_sys::SvgSetElement>>
{
}
impl<State, Action, T> SvgSetElement<State, Action> for T
where
T: SvgAnimationElement<State, Action>,
T::DomNode: AsRef<web_sys::SvgSetElement>,
{
}
pub trait SvgStopElement<State, Action = ()>:
SvgElement<State, Action, DomNode: AsRef<web_sys::SvgStopElement>>
{
}
impl<State, Action, T> SvgStopElement<State, Action> for T
where
T: SvgElement<State, Action>,
T::DomNode: AsRef<web_sys::SvgStopElement>,
{
}
pub trait SvgStyleElement<State, Action = ()>:
SvgElement<State, Action, DomNode: AsRef<web_sys::SvgStyleElement>>
{
}
impl<State, Action, T> SvgStyleElement<State, Action> for T
where
T: SvgElement<State, Action>,
T::DomNode: AsRef<web_sys::SvgStyleElement>,
{
}
pub trait SvgSwitchElement<State, Action = ()>:
SvgGraphicsElement<State, Action, DomNode: AsRef<web_sys::SvgSwitchElement>>
{
}
impl<State, Action, T> SvgSwitchElement<State, Action> for T
where
T: SvgGraphicsElement<State, Action>,
T::DomNode: AsRef<web_sys::SvgSwitchElement>,
{
}
pub trait SvgSymbolElement<State, Action = ()>:
SvgElement<State, Action, DomNode: AsRef<web_sys::SvgSymbolElement>>
{
}
impl<State, Action, T> SvgSymbolElement<State, Action> for T
where
T: SvgElement<State, Action>,
T::DomNode: AsRef<web_sys::SvgSymbolElement>,
{
}
pub trait SvgTextContentElement<State, Action = ()>:
SvgGraphicsElement<State, Action, DomNode: AsRef<web_sys::SvgTextContentElement>>
{
fn fill(self, brush: impl Into<peniko::Brush>) -> crate::svg::Fill<Self, State, Action> {
crate::svg::fill(self, brush)
}
fn stroke(
self,
brush: impl Into<peniko::Brush>,
style: peniko::kurbo::Stroke,
) -> crate::svg::Stroke<Self, State, Action> {
crate::svg::stroke(self, brush, style)
}
}
impl<State, Action, T> SvgTextContentElement<State, Action> for T
where
T: SvgGraphicsElement<State, Action>,
T::DomNode: AsRef<web_sys::SvgTextContentElement>,
{
}
pub trait SvgTextPathElement<State, Action = ()>:
SvgTextContentElement<State, Action, DomNode: AsRef<web_sys::SvgTextPathElement>>
{
}
impl<State, Action, T> SvgTextPathElement<State, Action> for T
where
T: SvgTextContentElement<State, Action>,
T::DomNode: AsRef<web_sys::SvgTextPathElement>,
{
}
pub trait SvgTextPositioningElement<State, Action = ()>:
SvgTextContentElement<State, Action, DomNode: AsRef<web_sys::SvgTextPositioningElement>>
{
}
impl<State, Action, T> SvgTextPositioningElement<State, Action> for T
where
T: SvgTextContentElement<State, Action>,
T::DomNode: AsRef<web_sys::SvgTextPositioningElement>,
{
}
pub trait SvgtSpanElement<State, Action = ()>:
SvgTextPositioningElement<State, Action, DomNode: AsRef<web_sys::SvgtSpanElement>>
{
}
impl<State, Action, T> SvgtSpanElement<State, Action> for T
where
T: SvgTextPositioningElement<State, Action>,
T::DomNode: AsRef<web_sys::SvgtSpanElement>,
{
}
pub trait SvgViewElement<State, Action = ()>:
SvgElement<State, Action, DomNode: AsRef<web_sys::SvgViewElement>>
{
}
impl<State, Action, T> SvgViewElement<State, Action> for T
where
T: SvgElement<State, Action>,
T::DomNode: AsRef<web_sys::SvgViewElement>,
{
}
pub trait SvgRadialGradientElement<State, Action = ()>:
SvgGradientElement<State, Action, DomNode: AsRef<web_sys::SvgRadialGradientElement>>
{
}
impl<State, Action, T> SvgRadialGradientElement<State, Action> for T
where
T: SvgGradientElement<State, Action>,
T::DomNode: AsRef<web_sys::SvgRadialGradientElement>,
{
}
pub trait SvgsvgElement<State, Action = ()>:
SvgGraphicsElement<State, Action, DomNode: AsRef<web_sys::SvgsvgElement>>
{
}
impl<State, Action, T> SvgsvgElement<State, Action> for T
where
T: SvgGraphicsElement<State, Action>,
T::DomNode: AsRef<web_sys::SvgsvgElement>,
{
}
pub trait SvgTextElement<State, Action = ()>:
SvgTextPositioningElement<State, Action, DomNode: AsRef<web_sys::SvgTextElement>>
{
}
impl<State, Action, T> SvgTextElement<State, Action> for T
where
T: SvgTextPositioningElement<State, Action>,
T::DomNode: AsRef<web_sys::SvgTextElement>,
{
}
pub trait SvgTitleElement<State, Action = ()>:
SvgElement<State, Action, DomNode: AsRef<web_sys::SvgTitleElement>>
{
}
impl<State, Action, T> SvgTitleElement<State, Action> for T
where
T: SvgElement<State, Action>,
T::DomNode: AsRef<web_sys::SvgTitleElement>,
{
}
pub trait SvgUseElement<State, Action = ()>:
SvgGraphicsElement<State, Action, DomNode: AsRef<web_sys::SvgUseElement>>
{
}
impl<State, Action, T> SvgUseElement<State, Action> for T
where
T: SvgGraphicsElement<State, Action>,
T::DomNode: AsRef<web_sys::SvgUseElement>,
{
}