mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-04 15:45:25 +00:00
LibWeb: Make MediaQueryList store MediaQueries instead of a String
This commit is contained in:
committed by
Andreas Kling
parent
5bbbdb81dc
commit
f1af136925
@@ -13,7 +13,7 @@
|
||||
|
||||
namespace Web::CSS {
|
||||
|
||||
MediaQueryList::MediaQueryList(DOM::Document& document, String media)
|
||||
MediaQueryList::MediaQueryList(DOM::Document& document, NonnullRefPtrVector<MediaQuery>&& media)
|
||||
: DOM::EventTarget(static_cast<Bindings::ScriptExecutionContext&>(document))
|
||||
, m_document(document)
|
||||
, m_media(move(media))
|
||||
@@ -27,8 +27,9 @@ MediaQueryList::~MediaQueryList()
|
||||
// https://drafts.csswg.org/cssom-view/#dom-mediaquerylist-media
|
||||
String MediaQueryList::media() const
|
||||
{
|
||||
// TODO: Replace this with a "media query list" and serialize on demand
|
||||
return m_media;
|
||||
StringBuilder builder;
|
||||
builder.join(", ", m_media);
|
||||
return builder.to_string();
|
||||
}
|
||||
|
||||
// https://drafts.csswg.org/cssom-view/#dom-mediaquerylist-matches
|
||||
|
||||
Reference in New Issue
Block a user