mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-20 19:45:12 +00:00
LibWeb: Invalidate style when HTMLDialogElement modal state changes
This fixes Layout/input/dialog-open-modal.html which began flaking super hard after the preceding commits that reduced style invalidation for focus-related pseudo class selectors.
This commit is contained in:
parent
f4511928bc
commit
89bf24d72b
2 changed files with 11 additions and 2 deletions
|
@ -223,7 +223,7 @@ WebIDL::ExceptionOr<void> HTMLDialogElement::show_a_modal_dialog(HTMLDialogEleme
|
|||
TRY(subject.set_attribute(AttributeNames::open, {}));
|
||||
|
||||
// 12. Set is modal of subject to true.
|
||||
subject.m_is_modal = true;
|
||||
subject.set_is_modal(true);
|
||||
|
||||
// FIXME: 13. Assert: subject's node document's open dialogs list does not contain subject.
|
||||
// FIXME: 14. Add subject to subject's node document's open dialogs list.
|
||||
|
@ -338,7 +338,7 @@ void HTMLDialogElement::close_the_dialog(Optional<String> result)
|
|||
// FIXME: 7. Let wasModal be the value of subject's is modal flag.
|
||||
|
||||
// 8. Set the is modal flag of subject to false.
|
||||
m_is_modal = false;
|
||||
set_is_modal(false);
|
||||
|
||||
// FIXME: 9. Remove subject from subject's node document's open dialogs list.
|
||||
|
||||
|
@ -435,4 +435,12 @@ void HTMLDialogElement::run_dialog_focusing_steps()
|
|||
// FIXME: 10. Set topDocument's autofocus processed flag to true.
|
||||
}
|
||||
|
||||
void HTMLDialogElement::set_is_modal(bool is_modal)
|
||||
{
|
||||
if (m_is_modal == is_modal)
|
||||
return;
|
||||
m_is_modal = is_modal;
|
||||
invalidate_style(DOM::StyleInvalidationReason::NodeRemove);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -37,6 +37,7 @@ public:
|
|||
virtual Optional<ARIA::Role> default_role() const override { return ARIA::Role::dialog; }
|
||||
|
||||
bool is_modal() const { return m_is_modal; }
|
||||
void set_is_modal(bool);
|
||||
|
||||
private:
|
||||
HTMLDialogElement(DOM::Document&, DOM::QualifiedName);
|
||||
|
|
Loading…
Add table
Reference in a new issue