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: https://github.com/LadybirdBrowser/ladybird/commit/a917f8124c Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/608
4 changed files with 22 additions and 1 deletions
|
@ -225,6 +225,7 @@ namespace AttributeNames {
|
|||
__ENUMERATE_HTML_ATTRIBUTE(rules) \
|
||||
__ENUMERATE_HTML_ATTRIBUTE(scheme) \
|
||||
__ENUMERATE_HTML_ATTRIBUTE(scrollamount) \
|
||||
__ENUMERATE_HTML_ATTRIBUTE(scrolldelay) \
|
||||
__ENUMERATE_HTML_ATTRIBUTE(scrolling) \
|
||||
__ENUMERATE_HTML_ATTRIBUTE(selected) \
|
||||
__ENUMERATE_HTML_ATTRIBUTE(shadowrootclonable) \
|
||||
|
|
|
@ -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)));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -23,6 +23,9 @@ public:
|
|||
WebIDL::UnsignedLong scroll_amount();
|
||||
WebIDL::ExceptionOr<void> set_scroll_amount(WebIDL::UnsignedLong);
|
||||
|
||||
WebIDL::UnsignedLong scroll_delay();
|
||||
WebIDL::ExceptionOr<void> set_scroll_delay(WebIDL::UnsignedLong);
|
||||
|
||||
private:
|
||||
HTMLMarqueeElement(DOM::Document&, DOM::QualifiedName);
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ interface HTMLMarqueeElement : HTMLElement {
|
|||
[CEReactions, Reflect] attribute unsigned long hspace;
|
||||
[FIXME, CEReactions] attribute long loop;
|
||||
[CEReactions] attribute unsigned long scrollAmount;
|
||||
[FIXME, CEReactions] attribute unsigned long scrollDelay;
|
||||
[CEReactions] attribute unsigned long scrollDelay;
|
||||
[FIXME, CEReactions] attribute boolean trueSpeed;
|
||||
[CEReactions, Reflect] attribute unsigned long vspace;
|
||||
[CEReactions, Reflect] attribute DOMString width;
|
||||
|
|
Loading…
Add table
Reference in a new issue