mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 14:28:12 +00:00
LibWeb: Make MediaQueryList store MediaQueries instead of a String
This commit is contained in:
parent
5bbbdb81dc
commit
f1af136925
3 changed files with 11 additions and 8 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue