Missing BiDi network events for cached stylesheets
Categories
(Remote Protocol :: WebDriver BiDi, defect, P2)
Tracking
(firefox132 fixed)
| Tracking | Status | |
|---|---|---|
| firefox132 | --- | fixed |
People
(Reporter: jdescottes, Assigned: Sasha)
References
(Blocks 3 open bugs)
Details
(Whiteboard: [webdriver:m12][webdriver:relnote])
Attachments
(1 file)
In Firefox, we are currently not emitting network events for resources which are fully read from the cache without even doing a roundtrip on the server. This is also an issue with DevTools (eg Bug 1710373 + see related metas).
Such requests do not hit the network layer, but per spec we should still create events for them.
| Reporter | ||
Comment 1•2 years ago
|
||
This blocks one puppeteer test at least: "network Network Events Page.Events.RequestServedFromCache"
Updated•2 years ago
|
| Reporter | ||
Updated•2 years ago
|
| Reporter | ||
Comment 2•2 years ago
|
||
Check if we are getting any observer notification and check with Necko.
| Reporter | ||
Comment 3•2 years ago
|
||
Hi Kershaw,
Last week we discussed on #necko about monitoring resources for which there is no network request performed at all, so I built a test case at: https://hg.mozilla.org/try/rev/8a5015b0e340a894fdc2e3e780d309d3c95fc90f
You can pull it and run ./mach test devtools/client/netmonitor/test/browser_net_http_cache.js
This test doesn't actually use anything from devtools, it should be pretty self explanatory. It first loads a HTML page using a stylesheet which will be read from the cache on next reload. Then setup an observer for http-on-examine-cached-response and reload -> we don't get any notification. I actually tried to monitor all possible topics:
"http-startup",
"http-on-failed-opening-request",
"http-on-opening-request",
"document-on-opening-request",
"http-on-modify-request",
"http-on-modify-request-before-cookies",
"document-on-modify-request",
"http-on-before-connect",
"http-on-dispatching-transaction",
"http-on-examine-response",
"http-on-examine-merged-response",
"http-on-background-revalidation",
"http-on-examine-cached-response",
"http-on-stop-request",
But I only ever get notified about requests for the document, never for the stylesheet. Is there something we could use in this case to be notified about the cache read for the stylesheet?
Comment 4•2 years ago
|
||
Sorry for the delay.
I've tried to run the test case and I found that after reloading the tab, there was no http request made to test.css.
I assume the reason is that the style sheet is loaded via the css cache, not http cache.
If you enable the css loader log (MOZ_LOG=nsCSSLoader:5), you should be see logs below shows that test.css is loaded from the css cache.
0:08.34 GECKO(70026) [Child 70035: Main Thread]: D/nsCSSLoader KeyEquals(http://localhost:56545/test.css)
0:08.34 GECKO(70026) [Child 70035: Main Thread]: D/nsCSSLoader KeyEquals(http://localhost:56545/test.css)
0:08.34 GECKO(70026) [Child 70035: Main Thread]: D/nsCSSLoader > Encoding guess mismatch
0:08.34 GECKO(70026) [Child 70035: Main Thread]: D/nsCSSLoader Hit cache with state: Complete
0:08.34 GECKO(70026) [Child 70035: Main Thread]: D/nsCSSLoader Sheet is alternate: 0
0:08.34 GECKO(70026) [Child 70035: Main Thread]: D/nsCSSLoader Sheet already complete: 0x10e8400c0
I am not sure how to bypass the css cache or maybe we want to modify css loader to send notifications to devtools?
| Reporter | ||
Comment 5•2 years ago
|
||
Thanks a lot for the feedback!
Indeed I didn't think about testing with other types of resources, but a similar test with a JS file works fine.
I don't think we want to bypass the CSS cache for webdriver, the browser should behave as usual. So we probably need to have notifications from the CSS loader in case something is fully read from the cache.
Maybe there are other resources for which we will need similar notifications? (images, fonts?)
| Reporter | ||
Comment 6•2 years ago
|
||
Hi Emilio,
Do you know if there are notifications from the CSS Loader when a stylesheet is retrieved from the CSS cache? Even if this is not using the http cache, I think that spec wise we should still emit BiDi network events for those.
Comment 7•2 years ago
|
||
I don't think that right now we have such a thing. I mean, the loader notifies when the load is done to its observers, but not globally (see Loader::NotifyObservers). We could notify there, or do something like bug 1722759, but for css.
| Reporter | ||
Updated•2 years ago
|
| Reporter | ||
Updated•2 years ago
|
| Reporter | ||
Updated•2 years ago
|
Updated•1 year ago
|
| Reporter | ||
Updated•1 year ago
|
| Reporter | ||
Updated•1 year ago
|
Comment 8•1 year ago
|
||
It's not blocking a Puppeteer P2 failure anymore.
| Assignee | ||
Updated•1 year ago
|
| Assignee | ||
Comment 9•1 year ago
|
||
Comment 10•1 year ago
|
||
Comment 11•1 year ago
|
||
| bugherder | ||
Updated•1 year ago
|
Description
•