Closed Bug 1675728 Opened 3 years ago Closed 3 years ago

Ignore invalid combinations of page load events and readyState

Categories

(Remote Protocol :: Marionette, task, P1)

Default
task

Tracking

(firefox84 fixed)

RESOLVED FIXED
84 Branch
Tracking Status
firefox84 --- fixed

People

(Reporter: whimboo, Assigned: whimboo)

References

(Blocks 1 open bug)

Details

Attachments

(3 files)

As noticed on bug 1669005 comment 13 we get a couple of page load events for which the readyState of the document shouldn't be complete. But later on during the navigation the correct combinations are sent out:

 0:09.86 pid:92436 1604657352266	Marionette	TRACE	** DOMContentLoaded - readyState: complete
 0:09.88 pid:92436 1604657352283	Marionette	TRACE	Received event DOMContentLoaded (complete) for http://web-platform.test:8000/fetch/corb/script-resource-with-json-parser-breaker.tentative.sub.html
 0:09.88 pid:92436 1604657352283	Marionette	TRACE	** beforeunload - readyState: complete
 0:09.89 pid:92436 1604657352291	Marionette	TRACE	Received event beforeunload (complete) for http://web-platform.test:8000/fetch/corb/script-resource-with-json-parser-breaker.tentative.sub.html
 0:09.91 pid:92436 1604657352307	Marionette	TRACE	** pagehide - readyState: complete
 0:09.91 pid:92436 1604657352307	Marionette	TRACE	Received event pagehide (complete) for http://web-platform.test:8000/fetch/corb/script-resource-with-json-parser-breaker.tentative.sub.html
[..]
0:09.93 pid:92436 1604657352329	Marionette	TRACE	[6442450945] MarionetteEvents actor created for window id 6442450950
 0:09.93 pid:92436 1604657352329	Marionette	TRACE	** DOMContentLoaded - readyState: interactive
 0:09.93 pid:92436 1604657352330	Marionette	TRACE	Received event DOMContentLoaded (interactive) for http://web-platform.test:8000/fetch/corb/script-resource-with-json-parser-breaker.tentative.sub.html
 0:09.93 pid:92436 1604657352330	Marionette	TRACE	** pageshow - readyState: complete
``

I would suggest that we filter out invalid combinations and ensure the following:

1) DOMContentLoaded == interactive
2) pageshow == complete

Note that these broken events cause trouble in various tests like bug 1669005.

Note that the WebDriver spec says the following:

"eager" eager "interactive"
"normal" normal "complete"


So we will be fine with that.
Depends on: 1676742

Once we have seen the unload event it's internal state flag
shouldn't be reset if another beforeunload event is received.

Depends on D96758

Pushed by hskupin@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/5195586cf62d
[marionette] Don't reset flag for seen unload event in beforeunload handler. r=marionette-reviewers,jdescottes
https://hg.mozilla.org/integration/autoland/rev/df040933b770
[marionette] Filter out invalid combinations of page load events and document's readyState. r=marionette-reviewers,jgraham,jdescottes
https://hg.mozilla.org/integration/autoland/rev/08c633e77233
[wdspec] Add "Navigate to" test for utf-8 meta tag after 1024 bytes. r=webdriver-reviewers,jgraham
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/26529 for changes under testing/web-platform/tests
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 84 Branch
Upstream PR merged by moz-wptsync-bot
Product: Testing → Remote Protocol
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: