mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 21:08:12 +00:00
LibWeb: Fix child wrapping in table fix up
- Wrapped sequence should be inserted before first non-match node instead of next sibling of first non-match node - If sequence is not empty after sibling traversal it should be wrapped
This commit is contained in:
parent
1a81521dd9
commit
2e1113cb88
1 changed files with 3 additions and 5 deletions
|
@ -460,20 +460,18 @@ static void for_each_sequence_of_consecutive_children_matching(NodeWithStyle& pa
|
|||
return true;
|
||||
};
|
||||
|
||||
Node* next_sibling = nullptr;
|
||||
for (auto child = parent.first_child(); child; child = next_sibling) {
|
||||
next_sibling = child->next_sibling();
|
||||
for (auto child = parent.first_child(); child; child = child->next_sibling()) {
|
||||
if (matcher(*child)) {
|
||||
sequence.append(*child);
|
||||
} else {
|
||||
if (!sequence.is_empty()) {
|
||||
if (!sequence_is_all_ignorable_whitespace())
|
||||
callback(sequence, next_sibling);
|
||||
callback(sequence, child);
|
||||
sequence.clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (sequence.is_empty() && !sequence_is_all_ignorable_whitespace())
|
||||
if (!sequence.is_empty() && !sequence_is_all_ignorable_whitespace())
|
||||
callback(sequence, nullptr);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue