mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 17:10:23 +00:00
LibWeb: Support Document.onvisibilitychange
We don't have a way to trigger this from a test, but the fix is so simple that we might as well get it in. :^)
This commit is contained in:
parent
26be8f865a
commit
274411db97
Notes:
github-actions[bot]
2024-10-08 16:50:04 +00:00
Author: https://github.com/awesomekling Commit: https://github.com/LadybirdBrowser/ladybird/commit/274411db975 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1683
3 changed files with 14 additions and 1 deletions
|
@ -5676,4 +5676,14 @@ void Document::set_onreadystatechange(WebIDL::CallbackType* value)
|
||||||
set_event_handler_attribute(HTML::EventNames::readystatechange, value);
|
set_event_handler_attribute(HTML::EventNames::readystatechange, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WebIDL::CallbackType* Document::onvisibilitychange()
|
||||||
|
{
|
||||||
|
return event_handler_attribute(HTML::EventNames::visibilitychange);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Document::set_onvisibilitychange(WebIDL::CallbackType* value)
|
||||||
|
{
|
||||||
|
set_event_handler_attribute(HTML::EventNames::visibilitychange, value);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -734,6 +734,9 @@ public:
|
||||||
[[nodiscard]] WebIDL::CallbackType* onreadystatechange();
|
[[nodiscard]] WebIDL::CallbackType* onreadystatechange();
|
||||||
void set_onreadystatechange(WebIDL::CallbackType*);
|
void set_onreadystatechange(WebIDL::CallbackType*);
|
||||||
|
|
||||||
|
[[nodiscard]] WebIDL::CallbackType* onvisibilitychange();
|
||||||
|
void set_onvisibilitychange(WebIDL::CallbackType*);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void initialize(JS::Realm&) override;
|
virtual void initialize(JS::Realm&) override;
|
||||||
virtual void visit_edges(Cell::Visitor&) override;
|
virtual void visit_edges(Cell::Visitor&) override;
|
||||||
|
|
|
@ -152,7 +152,7 @@ interface Document : Node {
|
||||||
|
|
||||||
// special event handler IDL attributes that only apply to Document objects
|
// special event handler IDL attributes that only apply to Document objects
|
||||||
[LegacyLenientThis] attribute EventHandler onreadystatechange;
|
[LegacyLenientThis] attribute EventHandler onreadystatechange;
|
||||||
[FIXME] attribute EventHandler onvisibilitychange;
|
attribute EventHandler onvisibilitychange;
|
||||||
};
|
};
|
||||||
|
|
||||||
dictionary ElementCreationOptions {
|
dictionary ElementCreationOptions {
|
||||||
|
|
Loading…
Reference in a new issue