mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 09:27:35 +00:00
LibWeb: Respect media attribute of style tag
This commit is contained in:
parent
bd4bb4fd51
commit
93238edf8f
7 changed files with 44 additions and 15 deletions
|
@ -8,6 +8,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <LibWeb/Bindings/PlatformObject.h>
|
||||
#include <LibWeb/CSS/MediaList.h>
|
||||
#include <LibWeb/Forward.h>
|
||||
|
||||
namespace Web::CSS {
|
||||
|
@ -32,7 +33,16 @@ public:
|
|||
void set_title(String title) { m_title = move(title); }
|
||||
|
||||
void set_type(String type) { m_type_string = move(type); }
|
||||
void set_media(String media) { m_media_string = move(media); }
|
||||
|
||||
MediaList* media() const
|
||||
{
|
||||
return &m_media;
|
||||
}
|
||||
|
||||
void set_media(String media)
|
||||
{
|
||||
m_media.set_media_text(media);
|
||||
}
|
||||
|
||||
bool is_alternate() const { return m_alternate; }
|
||||
void set_alternate(bool alternate) { m_alternate = alternate; }
|
||||
|
@ -46,9 +56,11 @@ public:
|
|||
void set_parent_css_style_sheet(CSSStyleSheet*);
|
||||
|
||||
protected:
|
||||
explicit StyleSheet(JS::Realm&);
|
||||
explicit StyleSheet(JS::Realm&, MediaList& media);
|
||||
virtual void visit_edges(Cell::Visitor&) override;
|
||||
|
||||
MediaList& m_media;
|
||||
|
||||
private:
|
||||
JS::GCPtr<DOM::Element> m_owner_node;
|
||||
JS::GCPtr<CSSStyleSheet> m_parent_style_sheet;
|
||||
|
@ -56,7 +68,6 @@ private:
|
|||
String m_location;
|
||||
String m_title;
|
||||
String m_type_string;
|
||||
String m_media_string;
|
||||
|
||||
bool m_disabled { false };
|
||||
bool m_alternate { false };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue