mirror of
https://github.com/HeyPuter/firefox.git
synced 2026-11-13 20:14:57 -10:00
Breakable lines could easily be missed when reloading. The very original issue is that SourceActor.getBreakableLines can't be called too early during the page load. The SourceActor may not have received enough content of the HTML page and the HTML string may not include the inline script sources itself. This lead to wrong `_startLineColumnDisplacement` being set to zero and breakable lines of the inline script are starting from the very first line of the HTML page, instead of where the <script> starts. Then... the frontend somewhat worksaround that very implicitely and not correctly. The key is to force fetching the breakable lines after the source text content is fetched. Covering this isn't trivial as this is a race condition. But I expanded the coverage in feature tests and tweaked browser_dbg-inline-script-offset.js which could fail intermittently and no longer fail with this patch and the next one applied. Differential Revision: https://phabricator.services.mozilla.com/D169073
16 lines
453 B
HTML
16 lines
453 B
HTML
<script>
|
|
function f() {
|
|
return { g: () => {} };
|
|
}
|
|
</script>
|
|
<!-- evaluate the same long script to slow down the page load and more easily cause race condition in inline script code -->
|
|
<script src="long.js"></script><script src="long.js"></script><script src="long.js"></script><script src="long.js"></script>
|
|
|
|
<script>
|
|
function j() {
|
|
return 42;
|
|
}
|
|
</script>
|
|
|
|
<span>Here is some random stuff</span><script>function z() { this.f().g() } z();</script>
|