mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-28 12:18:25 +00:00
LibWeb: Don't lose change events on MediaQueryList internal state change
MediaQueryList will now remember if a state change occurred when evaluating its match state. This memory can then be used by the document later on when it's updating all queries, to ensure that we don't forget to fire at least one change event. This also required plumbing the system visibility state to initial about:blank documents, since otherwise they would be stuck in "hidden" state indefinitely and never evaluate their media queries.
This commit is contained in:
committed by
Andreas Kling
parent
6fd24c2a68
commit
c9cd795257
@@ -109,6 +109,9 @@ WebIDL::ExceptionOr<void> NavigableContainer::create_new_child_navigable(GC::Ptr
|
||||
// 11. Let traversable be parentNavigable's traversable navigable.
|
||||
auto traversable = parent_navigable->traversable_navigable();
|
||||
|
||||
// AD-HOC: Let the initial about:blank document inherit the system visibility state from traversable.
|
||||
document->update_the_visibility_state(traversable->system_visibility_state());
|
||||
|
||||
// 12. Append the following session history traversal steps to traversable:
|
||||
traversable->append_session_history_traversal_steps(GC::create_function(heap(), [traversable, navigable, parent_navigable, history_entry, after_session_history_update] {
|
||||
// 1. Let parentDocState be parentNavigable's active session history entry's document state.
|
||||
|
||||
Reference in New Issue
Block a user