Bindings: Implement is_supported_property_index in terms of item_value

Greatly simplifying the code :^)
This commit is contained in:
Shannon Booth 2024-07-25 18:30:29 +12:00 committed by Andreas Kling
commit 9b1af542e7
Notes: github-actions[bot] 2024-07-26 12:27:15 +00:00
34 changed files with 4 additions and 138 deletions

View file

@ -74,14 +74,6 @@ Vector<FlyString> Plugin::supported_property_names() const
return mime_types;
}
// https://html.spec.whatwg.org/multipage/system-state.html#pdf-viewing-support:supports-indexed-properties-3
bool Plugin::is_supported_property_index(u32 index) const
{
// The Plugin interface supports indexed properties. The supported property indices are the indices of this's relevant global object's PDF viewer mime type objects.
auto& window = verify_cast<HTML::Window>(HTML::relevant_global_object(*this));
return index < window.pdf_viewer_mime_type_objects().size();
}
// https://html.spec.whatwg.org/multipage/system-state.html#dom-plugin-length
size_t Plugin::length() const
{