Repository: LadybirdBrowser/ladybird
File: Libraries/LibWeb/HTML/HTMLSelectElement.h (C/C++)

Code before:
    HTMLSelectElement(DOM::Document&, DOM::QualifiedName);

    virtual void initialize(JS::Realm&) override;
    virtual void visit_edges(Cell::Visitor&) override;

    // ^DOM::Element
    virtual i32 default_tab_index_value() const override;

    virtual void computed_properties_changed() override;

    virtual void children_changed(ChildrenChangedMetadata const*) override;
    bool can_skip_children_changed_selectedness_update(ChildrenChangedMetadata const& metadata) const;

    void update_cached_list_of_options() const;
    void show_the_picker_if_applicable();

    void create_shadow_tree_if_needed();
    void update_inner_text_element();
    void queue_input_and_change_events();

    u32 display_size() const;

    mutable Vector<GC::Ref<HTMLOptionElement>> m_cached_list_of_options;
    mutable size_t m_cached_number_of_selected_options { 0 };

    GC::Ptr<HTMLOptionsCollection> mutable m_options;
    GC::Ptr<DOM::HTMLCollection> m_selected_options;
    bool m_is_open { false };
    Vector<SelectItem> m_select_items;
    GC::Ptr<DOM::Element> m_inner_text_element;
    GC::Ptr<DOM::Element> m_chevron_icon_element;

    // https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#user-validity
    bool m_user_validity { false };
};

}


Review comment (suggestion):
We put `mutable` in front of the type, not after it. (See the lines above this one)

Code after:
    void clear_non_primary_selectedcontent();

    // https://html.spec.whatwg.org/multipage/form-elements.html#update-a-select%27s-selectedcontent
    WebIDL::ExceptionOr<void> update_selectedcontent();

    // https://html.spec.whatwg.org/multipage/form-elements.html#the-select-element%3Asuffering-from-being-missing
    virtual bool suffering_from_being_missing() const override;

    virtual bool is_mutable() const override;

private:
    HTMLSelectElement(DOM::Document&, DOM::QualifiedName);

    virtual void initialize(JS::Realm&) override;
    virtual void visit_edges(Cell::Visitor&) override;

    // ^DOM::Element
    virtual i32 default_tab_index_value() const override;

    virtual void computed_properties_changed() override;

    virtual void children_changed(ChildrenChangedMetadata const*) override;
    bool can_skip_children_changed_selectedness_update(ChildrenChangedMetadata const& metadata) const;

    void update_cached_list_of_options() const;
    void show_the_picker_if_applicable();

    void create_shadow_tree_if_needed();
    void update_inner_text_element();
    // https://html.spec.whatwg.org/multipage/form-elements.html#send-select-update-notifications
    void send_select_update_notifications();

    u32 display_size() const;

    mutable Vector<GC::Ref<HTMLOptionElement>> m_cached_list_of_options;
    mutable size_t m_cached_number_of_selected_options { 0 };

    mutable GC::Ptr<HTMLOptionsCollection> m_options;
    GC::Ptr<DOM::HTMLCollection> m_selected_options;
    bool m_is_open { false };
    Vector<SelectItem> m_select_items;
    GC::Ptr<DOM::Element> m_inner_text_element;
    GC::Ptr<DOM::Element> m_chevron_icon_element;

    // https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#user-validity
    bool m_user_validity { false };
};

}

namespace Web::DOM {