mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-11 18:50:50 +00:00
Bindings: Implement is_supported_property_index in terms of item_value
Greatly simplifying the code :^)
This commit is contained in:
parent
c5c1a8fcc7
commit
9b1af542e7
Notes:
github-actions[bot]
2024-07-26 12:27:15 +00:00
Author: https://github.com/shannonbooth
Commit: 9b1af542e7
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/827
34 changed files with 4 additions and 138 deletions
|
@ -153,17 +153,6 @@ void StyleSheetList::visit_edges(Cell::Visitor& visitor)
|
|||
visitor.visit(m_sheets);
|
||||
}
|
||||
|
||||
// https://www.w3.org/TR/cssom/#ref-for-dfn-supported-property-indices%E2%91%A1
|
||||
bool StyleSheetList::is_supported_property_index(u32 index) const
|
||||
{
|
||||
// The object’s supported property indices are the numbers in the range zero to one less than the number of CSS style sheets represented by the collection.
|
||||
// If there are no such CSS style sheets, then there are no supported property indices.
|
||||
if (m_sheets.is_empty())
|
||||
return false;
|
||||
|
||||
return index < m_sheets.size();
|
||||
}
|
||||
|
||||
Optional<JS::Value> StyleSheetList::item_value(size_t index) const
|
||||
{
|
||||
if (index >= m_sheets.size())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue