LibWeb: Implement HTMLMarqueeElement.scrollDelay

This commit is contained in:
Jamie Mansfield 2024-07-13 00:33:26 +01:00 committed by Andreas Kling
parent 2a408ecfbc
commit a917f8124c
Notes: sideshowbarker 2024-07-17 07:25:39 +09:00
4 changed files with 22 additions and 1 deletions

View file

@ -60,4 +60,21 @@ WebIDL::ExceptionOr<void> HTMLMarqueeElement::set_scroll_amount(WebIDL::Unsigned
return set_attribute(HTML::AttributeNames::scrollamount, MUST(String::number(value)));
}
// https://html.spec.whatwg.org/multipage/obsolete.html#dom-marquee-scrolldelay
WebIDL::UnsignedLong HTMLMarqueeElement::scroll_delay()
{
// The scrollDelay IDL attribute must reflect the scrolldelay content attribute. The default value is 85.
if (auto scroll_delay_string = get_attribute(HTML::AttributeNames::scrolldelay); scroll_delay_string.has_value()) {
if (auto scroll_delay = parse_non_negative_integer(*scroll_delay_string); scroll_delay.has_value())
return *scroll_delay;
}
return 85;
}
// https://html.spec.whatwg.org/multipage/obsolete.html#dom-marquee-scrolldelay
WebIDL::ExceptionOr<void> HTMLMarqueeElement::set_scroll_delay(WebIDL::UnsignedLong value)
{
return set_attribute(HTML::AttributeNames::scrolldelay, MUST(String::number(value)));
}
}