mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-09 17:49:40 +00:00
LibWeb: Verify something was removed in StyleSheetList::remove_sheet()
This would have saved me an hour of debugging, so putting it here for the next person. :^)
This commit is contained in:
parent
835986de7b
commit
ebacb921da
Notes:
github-actions[bot]
2024-07-23 09:13:16 +00:00
Author: https://github.com/awesomekling
Commit: ebacb921da
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/784
1 changed files with 2 additions and 1 deletions
|
@ -115,7 +115,8 @@ void StyleSheetList::add_sheet(CSSStyleSheet& sheet)
|
|||
void StyleSheetList::remove_sheet(CSSStyleSheet& sheet)
|
||||
{
|
||||
sheet.set_style_sheet_list({}, nullptr);
|
||||
m_sheets.remove_first_matching([&](auto& entry) { return entry.ptr() == &sheet; });
|
||||
bool did_remove = m_sheets.remove_first_matching([&](auto& entry) { return entry.ptr() == &sheet; });
|
||||
VERIFY(did_remove);
|
||||
|
||||
if (sheet.rules().length() == 0) {
|
||||
// NOTE: If the removed sheet had no rules, we don't have to invalidate anything.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue