mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02:00
LibWeb: Add style invalidation for :open pseudo-class
Add proper style invalidation when the `open` attribute changes on HTMLDetailsElement and HTMLDialogElement. The :open pseudo-class can affect sibling selectors (e.g., `dialog:open + sibling`), so we need full subtree + sibling invalidation.
This commit is contained in:
committed by
Andreas Kling
parent
c0c8d35786
commit
5fc276872a
Notes:
github-actions[bot]
2026-02-06 11:06:52 +00:00
Author: https://github.com/awesomekling Commit: https://github.com/LadybirdBrowser/ladybird/commit/5fc276872af Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/7623 Reviewed-by: https://github.com/tcl3
@@ -675,6 +675,10 @@ void HTMLDialogElement::attribute_changed(FlyString const& local_name, Optional<
|
||||
if (local_name != "open"_fly_string)
|
||||
return;
|
||||
|
||||
// The :open pseudo-class can affect sibling selectors (e.g., dialog:open + sibling),
|
||||
// so we need full subtree + sibling invalidation, not just targeted invalidation.
|
||||
invalidate_style(DOM::StyleInvalidationReason::HTMLDetailsOrDialogOpenAttributeChange);
|
||||
|
||||
// 3. If value is null and oldValue is not null, then run the dialog cleanup steps given element.
|
||||
if (!value.has_value() && old_value.has_value())
|
||||
run_dialog_cleanup_steps();
|
||||
|
||||
Reference in New Issue
Block a user