mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
LibWeb: Add fast_is<Layout::InitialContainingBlockBox>
This is used by Layout::Node::containing_block() which is fairly hot.
This commit is contained in:
parent
1268b39ba0
commit
a401a0f8fe
Notes:
sideshowbarker
2024-07-18 05:32:34 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/a401a0f8fe9
2 changed files with 6 additions and 0 deletions
|
@ -31,7 +31,12 @@ public:
|
|||
void recompute_selection_states();
|
||||
|
||||
private:
|
||||
virtual bool is_initial_containing_block_box() const override { return true; }
|
||||
|
||||
LayoutRange m_selection;
|
||||
};
|
||||
|
||||
template<>
|
||||
inline bool Node::fast_is<InitialContainingBlockBox>() const { return is_initial_containing_block_box(); }
|
||||
|
||||
}
|
||||
|
|
|
@ -100,6 +100,7 @@ public:
|
|||
virtual bool is_box() const { return false; }
|
||||
virtual bool is_block_box() const { return false; }
|
||||
virtual bool is_text_node() const { return false; }
|
||||
virtual bool is_initial_containing_block_box() const { return false; }
|
||||
|
||||
template<typename T>
|
||||
bool fast_is() const = delete;
|
||||
|
|
Loading…
Reference in a new issue