mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 09:27:35 +00:00
LibWeb: Support Document.hidden and Document.visibilityState
These just act as if the document is always visible for now.
This commit is contained in:
parent
484f6a7cfa
commit
e26e85a3d2
3 changed files with 18 additions and 0 deletions
|
@ -1062,4 +1062,16 @@ Bindings::LocationObject* Document::location()
|
||||||
return window().wrapper()->location_object();
|
return window().wrapper()->location_object();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// https://w3c.github.io/page-visibility/#hidden-attribute
|
||||||
|
bool Document::hidden() const
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// https://w3c.github.io/page-visibility/#visibilitystate-attribute
|
||||||
|
String Document::visibility_state() const
|
||||||
|
{
|
||||||
|
return hidden() ? "hidden" : "visible";
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -298,6 +298,9 @@ public:
|
||||||
bool page_showing() const { return m_page_showing; }
|
bool page_showing() const { return m_page_showing; }
|
||||||
void set_page_showing(bool value) { m_page_showing = value; }
|
void set_page_showing(bool value) { m_page_showing = value; }
|
||||||
|
|
||||||
|
bool hidden() const;
|
||||||
|
String visibility_state() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
explicit Document(const AK::URL&);
|
explicit Document(const AK::URL&);
|
||||||
|
|
||||||
|
|
|
@ -139,4 +139,7 @@ interface Document : Node {
|
||||||
attribute EventHandler onwebkittransitionend;
|
attribute EventHandler onwebkittransitionend;
|
||||||
attribute EventHandler onwheel;
|
attribute EventHandler onwheel;
|
||||||
|
|
||||||
|
readonly boolean hidden;
|
||||||
|
readonly DOMString visibilityState;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue