mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-16 07:11:52 +00:00
LibWeb: Implement HTMLMarqueeElement.scrollDelay
This commit is contained in:
parent
2a408ecfbc
commit
a917f8124c
Notes:
sideshowbarker
2024-07-17 07:25:39 +09:00
Author: https://github.com/jamierocks
Commit: a917f8124c
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/608
4 changed files with 22 additions and 1 deletions
|
@ -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)));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue