Closed Bug 1906051 Opened 1 year ago Closed 9 months ago

Implement "browsingContext.historyUpdated" event

Categories

(Remote Protocol :: WebDriver BiDi, task, P2)

task
Points:
5

Tracking

(firefox141 fixed)

RESOLVED FIXED
141 Branch
Tracking Status
firefox141 --- fixed

People

(Reporter: whimboo, Assigned: jdescottes)

References

(Blocks 2 open bugs)

Details

(Whiteboard: [webdriver:m16][wptsync upstream][webdriver:relnote])

Attachments

(6 files)

This bug is used to implement the browsingContext.historyUpdated event. We can start the work once https://github.com/w3c/webdriver-bidi/pull/740 got merged.

Points: --- → 5
Priority: -- → P2
Whiteboard: [webdriver:backlog]

Tests will be downstream syned via bug 1921181.

Depends on: 1921181
Whiteboard: [webdriver:backlog] → [webdriver:m13]

I will be watching for when this bug is ready to be worked on

Whiteboard: [webdriver:m13] → [webdriver:m14]
Whiteboard: [webdriver:m14] → [webdriver:m15]
Depends on: 1942474
Whiteboard: [webdriver:m15] → [webdriver:m16]
Assignee: nobody → jdescottes
Status: NEW → ASSIGNED
See Also: → 1968705
See Also: → 1844517
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/52869 for changes under testing/web-platform/tests
Whiteboard: [webdriver:m16] → [webdriver:m16], [wptsync upstream]
Pushed by jdescottes@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/07cb8711aab8 https://hg.mozilla.org/integration/autoland/rev/bdfd9f79be9c [bidi] Implement browsingContext.historyUpdated r=webdriver-reviewers,Sasha https://github.com/mozilla-firefox/firefox/commit/9fc589698b0e https://hg.mozilla.org/integration/autoland/rev/b3c3b1bb56ed [wdspec] Update wdspec tests for fragment navigated to check event counts with iframes r=webdriver-reviewers,Sasha https://github.com/mozilla-firefox/firefox/commit/e95736587216 https://hg.mozilla.org/integration/autoland/rev/70e1a3290bf9 [wdspec] Update document open test case in history updated test to add missing event r=webdriver-reviewers,Sasha
Pushed by amarc@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/5238f063ea8d https://hg.mozilla.org/integration/autoland/rev/46bc88fc05d0 Revert "Bug 1906051 - [wdspec] Update document open test case in history updated test to add missing event r=webdriver-reviewers,Sasha" for causing puppeteer failures @ navigation.spec.js

Backed out for causing puppeteer failures @ navigation.spec.js

Flags: needinfo?(jdescottes)

I missed the puppeteer failures on my try push, sorry about that.

For the first issue, we seem to run into the same issue as for Puppeteer with Chrome https://searchfox.org/mozilla-central/rev/b5ab48b8c33faf53817cb2ef64c8523a469ef695/remote/test/puppeteer/test/TestExpectations.json#1311-1317

{
  "testIdPattern": "[navigation.spec] navigation Page.goto should work when reload causes history API in beforeunload",
  "platforms": ["darwin", "linux", "win32"],
  "parameters": ["chrome", "webDriverBiDi"],
  "expectations": ["FAIL"],
  "comment": "https://github.com/GoogleChromeLabs/chromium-bidi/issues/2856 historyUpdated from beforeunload incorrectly comes before navigationStarted."
},

We get historyUpdated before navigationStarted, which mostly relates to Bug 1908952 (see my last comment there).

For the second issue, we fail to emit historyUpdated events when using history.back() / forward() if the history navigation only updates the state.

Basically if I do

history.pushState({}, "", "1");
history.pushState({}, "", "2");
history.back();

I should get 3 historyUpdated events, but the location change for history.back() does not pass the test progress.loadType & Ci.nsIDocShell.LOAD_CMD_PUSHSTATE. Instead of LOAD_CMD_PUSHSTATE, we have LOAD_CMD_HISTORY.

But a location change with LOAD_CMD_HISTORY could also mean using back() to perform a regular same document navigation (eg #hash2 -> #hash1). The only difference seems to be with the flags passed to the locationChange callback. When back() only performs a history traversal, flags==1 and when it performs a hash change, flags==9. But I couldn't find any documentation for those load flag values.

Flags: needinfo?(jdescottes)
Upstream PR merged by moz-wptsync-bot
Blocks: 1969948
Pushed by jdescottes@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/c4a18db64f89 https://hg.mozilla.org/integration/autoland/rev/a05801736679 [bidi] Implement browsingContext.historyUpdated r=webdriver-reviewers,Sasha https://github.com/mozilla-firefox/firefox/commit/9ec7b7e6faa9 https://hg.mozilla.org/integration/autoland/rev/c5176cef9407 [wdspec] Update wdspec tests for fragment navigated to check event counts with iframes r=webdriver-reviewers,Sasha https://github.com/mozilla-firefox/firefox/commit/7be69c080cd2 https://hg.mozilla.org/integration/autoland/rev/cecc4bb3d0a6 [wdspec] Update document open test case in history updated test to add missing event r=webdriver-reviewers,Sasha https://github.com/mozilla-firefox/firefox/commit/e1aff66f2387 https://hg.mozilla.org/integration/autoland/rev/0af66ba7393c [bidi] Emit browsingContext.historyUpdated for history traversal r=webdriver-reviewers,smaug,whimboo https://github.com/mozilla-firefox/firefox/commit/b638a7dd43b2 https://hg.mozilla.org/integration/autoland/rev/ba27bf696ecf [puppeteer] Update test expectations for browsingContext.historyUpdated r=webdriver-reviewers,whimboo https://github.com/mozilla-firefox/firefox/commit/acc4c8975f50 https://hg.mozilla.org/integration/autoland/rev/c1aed971a628 [wdspec] Add test for history traversal with browsingContext.historyUpdated r=webdriver-reviewers,whimboo
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/52917 for changes under testing/web-platform/tests
Blocks: 1970056
Upstream PR merged by moz-wptsync-bot
Whiteboard: [webdriver:m16], [wptsync upstream] → [webdriver:m16][wptsync upstream][webdriver:relnote]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: