1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:57:35 +00:00

LibWeb: Make CSSRule and CSSRuleList available to JavaScript :^)

This patch makes both of these classes inherit from RefCounted and
Bindings::Wrappable, plus some minimal rejigging to allow us to keep
using them internally while also exposing them to web content.
This commit is contained in:
Andreas Kling 2021-09-29 19:41:46 +02:00
parent 87f0059088
commit 3a4565beec
15 changed files with 64 additions and 13 deletions

View file

@ -9,7 +9,7 @@
namespace Web::CSS {
CSSRuleList::CSSRuleList(NonnullRefPtrVector<CSSRule>&& rules)
: m_rules(rules)
: m_rules(move(rules))
{
}
@ -17,4 +17,11 @@ CSSRuleList::~CSSRuleList()
{
}
bool CSSRuleList::is_supported_property_index(u32 index) const
{
// The objects supported property indices are the numbers in the range zero to one less than the number of CSSRule objects represented by the collection.
// If there are no such CSSRule objects, then there are no supported property indices.
return index < m_rules.size();
}
}