mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-11 13:42:52 +00:00
LibHTML: Add typed child/sibling traversal helpers for LayoutNode
Also add some special variants for the table classes, to make it a bit more pleasant to write table code. :^)
This commit is contained in:
parent
6202a0ab32
commit
65ad6c35f0
Notes:
sideshowbarker
2024-07-19 11:39:19 +09:00
Author: https://github.com/awesomekling
Commit: 65ad6c35f0
6 changed files with 101 additions and 0 deletions
|
@ -1,4 +1,5 @@
|
|||
#include <LibHTML/DOM/Element.h>
|
||||
#include <LibHTML/Layout/LayoutTableCell.h>
|
||||
#include <LibHTML/Layout/LayoutTableRow.h>
|
||||
|
||||
LayoutTableRow::LayoutTableRow(const Element& element, NonnullRefPtr<StyleProperties> style)
|
||||
|
@ -14,3 +15,23 @@ void LayoutTableRow::layout()
|
|||
{
|
||||
LayoutBox::layout();
|
||||
}
|
||||
|
||||
LayoutTableCell* LayoutTableRow::first_cell()
|
||||
{
|
||||
return first_child_of_type<LayoutTableCell>();
|
||||
}
|
||||
|
||||
const LayoutTableCell* LayoutTableRow::first_cell() const
|
||||
{
|
||||
return first_child_of_type<LayoutTableCell>();
|
||||
}
|
||||
|
||||
LayoutTableRow* LayoutTableRow::next_row()
|
||||
{
|
||||
return next_sibling_of_type<LayoutTableRow>();
|
||||
}
|
||||
|
||||
const LayoutTableRow* LayoutTableRow::next_row() const
|
||||
{
|
||||
return next_sibling_of_type<LayoutTableRow>();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue