mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-22 04:25:13 +00:00
LibWeb/CSS: Implement the CSSImportRule.media
attribute
This commit is contained in:
parent
c7452a2057
commit
807accdfa1
3 changed files with 11 additions and 1 deletions
|
@ -174,6 +174,15 @@ void CSSImportRule::set_style_sheet(GC::Ref<CSSStyleSheet> style_sheet)
|
|||
m_document->invalidate_style(DOM::StyleInvalidationReason::CSSImportRule);
|
||||
}
|
||||
|
||||
// https://drafts.csswg.org/cssom/#dom-cssimportrule-media
|
||||
GC::Ptr<MediaList> CSSImportRule::media() const
|
||||
{
|
||||
// The media attribute must return the value of the media attribute of the associated CSS style sheet.
|
||||
if (!m_style_sheet)
|
||||
return nullptr;
|
||||
return m_style_sheet->media();
|
||||
}
|
||||
|
||||
Optional<String> CSSImportRule::supports_text() const
|
||||
{
|
||||
if (!m_supports)
|
||||
|
|
|
@ -31,6 +31,7 @@ public:
|
|||
|
||||
CSSStyleSheet* loaded_style_sheet() { return m_style_sheet; }
|
||||
CSSStyleSheet const* loaded_style_sheet() const { return m_style_sheet; }
|
||||
GC::Ptr<MediaList> media() const;
|
||||
CSSStyleSheet* style_sheet_for_bindings() { return m_style_sheet; }
|
||||
|
||||
Optional<String> supports_text() const;
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
[Exposed=Window]
|
||||
interface CSSImportRule : CSSRule {
|
||||
readonly attribute USVString href;
|
||||
// FIXME: [SameObject, PutForwards=mediaText] readonly attribute MediaList media;
|
||||
[SameObject, PutForwards=mediaText] readonly attribute MediaList media;
|
||||
[SameObject, ImplementedAs=style_sheet_for_bindings] readonly attribute CSSStyleSheet? styleSheet;
|
||||
[FIXME] readonly attribute CSSOMString? layerName;
|
||||
readonly attribute CSSOMString? supportsText;
|
||||
|
|
Loading…
Add table
Reference in a new issue