1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 03:37:45 +00:00

LibWeb: Add CSSStyleSheet.ownerRule attribute

This returns the `CSSImportRule` corresponding to the `@import` at-rule
that imported the stylesheet into the document. If the stylesheet
wasn't imported then this property is null.
This commit is contained in:
Tim Ledbetter 2024-02-24 07:46:59 +00:00 committed by Andreas Kling
parent 588a031e2d
commit 9b1ea4e2fc
3 changed files with 5 additions and 1 deletions

View file

@ -1,5 +1,6 @@
/*
* Copyright (c) 2019-2021, Andreas Kling <kling@serenityos.org>
* Copyright (c) 2024, Tim Ledbetter <timledbetter@gmail.com>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
@ -28,6 +29,8 @@ public:
virtual ~CSSStyleSheet() override = default;
JS::GCPtr<CSSRule const> owner_rule() const { return m_owner_css_rule; }
JS::GCPtr<CSSRule> owner_rule() { return m_owner_css_rule; }
void set_owner_css_rule(CSSRule* rule) { m_owner_css_rule = rule; }
virtual String type() const override { return "text/css"_string; }