mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 09:07:45 +00:00
LibCore: Make LocalServer::take_over_from_system_server() return ErrorOr
This allows us to use TRY() or MUST() when calling it.
This commit is contained in:
parent
229a45ab14
commit
81047d8f9c
13 changed files with 41 additions and 53 deletions
|
@ -44,9 +44,12 @@ bool MediaQueryList::matches() const
|
|||
|
||||
bool MediaQueryList::evaluate()
|
||||
{
|
||||
if (!m_document)
|
||||
return false;
|
||||
|
||||
bool now_matches = false;
|
||||
for (auto& media : m_media) {
|
||||
now_matches = now_matches || media.evaluate(m_document.window());
|
||||
now_matches = now_matches || media.evaluate(m_document->window());
|
||||
}
|
||||
|
||||
return now_matches;
|
||||
|
|
|
@ -54,7 +54,7 @@ public:
|
|||
private:
|
||||
MediaQueryList(DOM::Document&, NonnullRefPtrVector<MediaQuery>&&);
|
||||
|
||||
DOM::Document& m_document;
|
||||
WeakPtr<DOM::Document> m_document;
|
||||
NonnullRefPtrVector<MediaQuery> m_media;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue