Skip to content

Commit 5997a79

Browse files
committed
LibWeb/DOM: Add spec steps for WebDriver BiDi to document history algo
This is "update document for history step application" but that's too long for the commit title. :^) No code changes, just adding more FIXME comments for the new steps. (And indented step 7's substeps for clarity.) Corresponds to whatwg/html#10910
1 parent 8dfd382 commit 5997a79

File tree

1 file changed

+18
-13
lines changed

1 file changed

+18
-13
lines changed

Libraries/LibWeb/DOM/Document.cpp

+18-13
Original file line numberDiff line numberDiff line change
@@ -4973,26 +4973,31 @@ void Document::update_for_history_step_application(GC::Ref<HTML::SessionHistoryE
49734973
// - previousEntryForActivation is given;
49744974
// - navigationType is non-null; and
49754975
// - navigationType is "reload" or previousEntryForActivation's document is not document, then:
4976+
{
4977+
// FIXME: 1. If navigation's activation is null, then set navigation's activation to a new NavigationActivation object in navigation's relevant realm.
4978+
// FIXME: 2. Let previousEntryIndex be the result of getting the navigation API entry index of previousEntryForActivation within navigation.
4979+
// FIXME: 3. If previousEntryIndex is non-negative, then set activation's old entry to navigation's entry list[previousEntryIndex].
49764980

4977-
// FIXME: 1. If navigation's activation is null, then set navigation's activation to a new NavigationActivation object in navigation's relevant realm.
4978-
// FIXME: 2. Let previousEntryIndex be the result of getting the navigation API entry index of previousEntryForActivation within navigation.
4979-
// FIXME: 3. If previousEntryIndex is non-negative, then set activation's old entry to navigation's entry list[previousEntryIndex].
4980-
4981-
// FIXME: 4. Otherwise, if all the following are true:
4982-
// - navigationType is "replace";
4983-
// - previousEntryForActivation's document state's origin is same origin with document's origin; and
4984-
// - previousEntryForActivation's document's initial about:blank is false,
4985-
// then set activation's old entry to a new NavigationHistoryEntry in navigation's relevant realm, whose session history entry is previousEntryForActivation.
4981+
// FIXME: 4. Otherwise, if all the following are true:
4982+
// - navigationType is "replace";
4983+
// - previousEntryForActivation's document state's origin is same origin with document's origin; and
4984+
// - previousEntryForActivation's document's initial about:blank is false,
4985+
// then set activation's old entry to a new NavigationHistoryEntry in navigation's relevant realm, whose session history entry is previousEntryForActivation.
49864986

4987-
// FIXME: 5. Set activation's new entry to navigation's current entry.
4988-
// FIXME: 6. Set activation's navigation type to navigationType.
4987+
// FIXME: 5. Set activation's new entry to navigation's current entry.
4988+
// FIXME: 6. Set activation's navigation type to navigationType.
4989+
}
49894990

49904991
// 8. If documentIsNew is true, then:
49914992
if (document_is_new) {
4992-
// 1. Try to scroll to the fragment for document.
4993+
// FIXME: 1. Assert: document's during-loading navigation ID for WebDriver BiDi is not null.
4994+
// FIXME: 2. Invoke WebDriver BiDi navigation committed with navigable and a new WebDriver BiDi navigation
4995+
// status whose id is document's during-loading navigation ID for WebDriver BiDi, status is "committed", and url is document's URL
4996+
4997+
// 3. Try to scroll to the fragment for document.
49934998
try_to_scroll_to_the_fragment();
49944999

4995-
// 2. At this point scripts may run for the newly-created document document.
5000+
// 4. At this point scripts may run for the newly-created document document.
49965001
m_ready_to_run_scripts = true;
49975002
}
49985003

0 commit comments

Comments
 (0)