Class CSSRuleList
- Namespace
- CSharpToJavaScript.APIs.JS
- Assembly
- CSharpToJavaScript.dll
A CSSRuleList represents an ordered collection of read-only CSSRule objects.
[Value("CSSRuleList")]
public class CSSRuleList
- Inheritance
-
CSSRuleList
- Inherited Members
Remarks
While the CSSRuleList object is read-only, and cannot be directly modified, it is considered a live object, as the content can change over time.
To edit the underlying rules returned by CSSRule objects, use InsertRule(string, ulong) and DeleteRule(ulong), which are methods of CSSStyleSheet.
This interface was an attempt to create an unmodifiable list and only continues to be supported to not break code that's already using it. Modern APIs represent list structures using types based on JavaScript arrays, thus making many array methods available, and at the same time imposing additional semantics on their usage (such as making their items read-only).
These historical reasons do not mean that you as a developer should avoid CSSRuleList. You don't create CSSRuleList objects yourself, but you get them from APIs such as CssRules and CssRules, and these APIs are not deprecated. However, be careful of the semantic differences from a real array.
Constructors
CSSRuleList()
public CSSRuleList()
Properties
Length
The length property of the CSSRuleList interface returns the number of CSSRule objects in the list.
[Value("length")]
public ulong Length { get; }
Property Value
- ulong
An integer.