mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 09:27:34 +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:
parent
588a031e2d
commit
9b1ea4e2fc
3 changed files with 5 additions and 1 deletions
|
@ -1,5 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2019-2022, Andreas Kling <kling@serenityos.org>
|
* Copyright (c) 2019-2022, Andreas Kling <kling@serenityos.org>
|
||||||
|
* Copyright (c) 2024, Tim Ledbetter <timledbetter@gmail.com>
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: BSD-2-Clause
|
* SPDX-License-Identifier: BSD-2-Clause
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2019-2021, Andreas Kling <kling@serenityos.org>
|
* Copyright (c) 2019-2021, Andreas Kling <kling@serenityos.org>
|
||||||
|
* Copyright (c) 2024, Tim Ledbetter <timledbetter@gmail.com>
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: BSD-2-Clause
|
* SPDX-License-Identifier: BSD-2-Clause
|
||||||
*/
|
*/
|
||||||
|
@ -28,6 +29,8 @@ public:
|
||||||
|
|
||||||
virtual ~CSSStyleSheet() override = default;
|
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; }
|
void set_owner_css_rule(CSSRule* rule) { m_owner_css_rule = rule; }
|
||||||
|
|
||||||
virtual String type() const override { return "text/css"_string; }
|
virtual String type() const override { return "text/css"_string; }
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
interface CSSStyleSheet : StyleSheet {
|
interface CSSStyleSheet : StyleSheet {
|
||||||
// FIXME: constructor(optional CSSStyleSheetInit options = {});
|
// FIXME: constructor(optional CSSStyleSheetInit options = {});
|
||||||
|
|
||||||
// FIXME: readonly attribute CSSRule? ownerRule;
|
readonly attribute CSSRule? ownerRule;
|
||||||
[SameObject] readonly attribute CSSRuleList cssRules;
|
[SameObject] readonly attribute CSSRuleList cssRules;
|
||||||
unsigned long insertRule(CSSOMString rule, optional unsigned long index = 0);
|
unsigned long insertRule(CSSOMString rule, optional unsigned long index = 0);
|
||||||
undefined deleteRule(unsigned long index);
|
undefined deleteRule(unsigned long index);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue