Преглед на файлове

LibWeb: Look for targetStepSHE in parent while creating child navigable

Reported issue in the spec https://github.com/whatwg/html/issues/9686
Aliaksandr Kalenik преди 1 година
родител
ревизия
cf985afdcb
променени са 1 файла, в които са добавени 2 реда и са изтрити 1 реда
  1. 2 1
      Userland/Libraries/LibWeb/HTML/NavigableContainer.cpp

+ 2 - 1
Userland/Libraries/LibWeb/HTML/NavigableContainer.cpp

@@ -109,7 +109,8 @@ WebIDL::ExceptionOr<void> NavigableContainer::create_new_child_navigable()
         auto parent_doc_state = parent_navigable->active_session_history_entry()->document_state;
         auto parent_doc_state = parent_navigable->active_session_history_entry()->document_state;
 
 
         // 2. Let targetStepSHE be the first session history entry in traversable's session history entries whose document state equals parentDocState.
         // 2. Let targetStepSHE be the first session history entry in traversable's session history entries whose document state equals parentDocState.
-        auto target_step_she = *(traversable->session_history_entries().find_if([parent_doc_state](auto& entry) {
+        // NOTE: We need to look for parent document state in parent navigable instead of traversable as specification says. https://github.com/whatwg/html/issues/9686
+        auto target_step_she = *(parent_navigable->get_session_history_entries().find_if([parent_doc_state](auto& entry) {
             return entry->document_state == parent_doc_state;
             return entry->document_state == parent_doc_state;
         }));
         }));