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

LibJS+LibWeb: Wrap raw JS::Cell*/& fields in GCPtr/NonnullGCPtr

This commit is contained in:
Matthew Olsson 2023-02-26 16:09:02 -07:00 committed by Andreas Kling
parent 1df3652e27
commit 7c0c1c8f49
214 changed files with 825 additions and 827 deletions

View file

@ -32,26 +32,23 @@ public:
{
if (index >= length())
return nullptr;
return &m_rules[index];
return m_rules[index];
}
CSSRule* item(size_t index)
{
if (index >= length())
return nullptr;
return &m_rules[index];
return m_rules[index];
}
size_t length() const { return m_rules.size(); }
using ConstIterator = AK::SimpleIterator<Vector<CSSRule&> const, CSSRule const>;
using Iterator = AK::SimpleIterator<Vector<CSSRule&>, CSSRule>;
auto begin() const { return m_rules.begin(); }
auto begin() { return m_rules.begin(); }
ConstIterator const begin() const { return m_rules.begin(); }
Iterator begin() { return m_rules.begin(); }
ConstIterator const end() const { return m_rules.end(); }
Iterator end() { return m_rules.end(); }
auto end() const { return m_rules.end(); }
auto end() { return m_rules.end(); }
virtual bool is_supported_property_index(u32 index) const override;
virtual WebIDL::ExceptionOr<JS::Value> item_value(size_t index) const override;
@ -82,7 +79,7 @@ private:
virtual bool named_property_setter_has_identifier() const override { return false; }
virtual bool named_property_deleter_has_identifier() const override { return false; }
Vector<CSSRule&> m_rules;
Vector<JS::NonnullGCPtr<CSSRule>> m_rules;
};
}