mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-20 09:49:15 +03:00
LibWeb: Add fast_is<T>() for Layout::Label
Spotted this in a profile while wheel scrolling up & down.
This commit is contained in:
parent
8554952690
commit
c908fa83e3
Notes:
sideshowbarker
2024-07-18 01:51:02 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/c908fa83e34
@ -11,7 +11,7 @@
|
||||
|
||||
namespace Web::Layout {
|
||||
|
||||
class Label : public BlockContainer {
|
||||
class Label final : public BlockContainer {
|
||||
public:
|
||||
Label(DOM::Document&, HTML::HTMLLabelElement*, NonnullRefPtr<CSS::StyleProperties>);
|
||||
virtual ~Label() override;
|
||||
@ -27,10 +27,15 @@ public:
|
||||
void handle_mousemove_on_label(Badge<TextNode>, const Gfx::IntPoint&, unsigned button);
|
||||
|
||||
private:
|
||||
virtual bool is_label() const override { return true; }
|
||||
|
||||
static Label* label_for_control_node(LabelableNode&);
|
||||
LabelableNode* control_node();
|
||||
|
||||
bool m_tracking_mouse { false };
|
||||
};
|
||||
|
||||
template<>
|
||||
inline bool Node::fast_is<Label>() const { return is_label(); }
|
||||
|
||||
}
|
||||
|
@ -104,6 +104,7 @@ public:
|
||||
virtual bool is_initial_containing_block_box() const { return false; }
|
||||
virtual bool is_svg_box() const { return false; }
|
||||
virtual bool is_svg_path_box() const { return false; }
|
||||
virtual bool is_label() const { return false; }
|
||||
|
||||
template<typename T>
|
||||
bool fast_is() const = delete;
|
||||
|
Loading…
Reference in New Issue
Block a user