fix: chromium memory leaks (#705)

This commit is contained in:
Julien Neuhart
2023-10-23 17:52:30 +02:00
committed by GitHub
parent b5a59e4de0
commit 54daac329e
71 changed files with 4248 additions and 51761 deletions

View File

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 29 KiB

91
test/testdata/chromium/html/index.html vendored Normal file
View File

@@ -0,0 +1,91 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="style.css">
<link href="https://fonts.googleapis.com/css?family=Montserrat" rel="stylesheet">
<title>Gutenberg</title>
<style>
@media print {
#screen { display: none }
}
@media screen {
#print { display: none }
}
</style>
</head>
<body>
<div class="page-break-after">
<div class="center">
<h1>Gutenberg</h1>
<img src="img.gif" alt="An image">
</div>
<blockquote cite="https://sites.google.com/site/johanngutenbergper5/q">
<p>It is a press, certainly, but a press from which shall flow in inexhaustible streams...Through it, God will spread His Word. A spring of truth shall flow from it: like a new star it shall scatter the darkness of ignorance, and cause a light heretofore unknown to shine amongst men.</p>
<footer><a href="https://sites.google.com/site/johanngutenbergper5/q">Johannes Gutenberg</a></cite></footer>
</blockquote>
</div>
<div class="page-break-after">
<h2>This paragraph uses the default font</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
<h2>This paragraph uses a Google font</h2>
<p class="google-font">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
<h2>This paragraph uses a local font</h2>
<p class="local-font">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</div>
<div class="center page-break-after">
<h1>This image is loaded from a URL</h1>
<img src="https://user-images.githubusercontent.com/8983173/130322857-185831e2-f041-46eb-a17f-0a69d066c4e5.png">
</div>
<div class="page-break-after">
<h2>This paragraph appears if wait delay > 2 seconds or if expression window.globalVar === 'ready' returns true</h2>
<p id="wait" style="display: none">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
<h2>This paragraph appears if the emulated media type is 'print'</h2>
<p id="print">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
<h2>This paragraph appears if the emulated media type is 'screen'</h2>
<p id="screen">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</div>
<div class="page-break-after">
<h2>This paragraph appears if JavaScript is NOT disabled</h2>
<p id="javascript" style="display: none">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</div>
<script type="application/javascript">
var globalVar = 'notReady'
const delay = ms => new Promise(res => setTimeout(res, ms))
delay(2000).then(() => {
document.getElementById('wait').style.display = 'contents'
window.globalVar = 'ready'
})
</script>
<script type="application/javascript">
document.getElementById('javascript').style.display = 'contents'
</script>
<script type="application/javascript">
console.log("a simple message")
console.debug("a debug message")
console.warn("a warning message")
console.error("an error message")
</script>
<script type="application/javascript">
throw new Error("Exception 1")
</script>
<script type="application/javascript">
throw new Error("Exception 2")
</script>
</body>
</html>

View File

@@ -1,38 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="style.css">
<link href="https://fonts.googleapis.com/css?family=Montserrat" rel="stylesheet">
<title>Gutenberg</title>
</head>
<body>
<div class="page-break-after">
<div class="center">
<h1>Gutenberg</h1>
<img src="img.gif">
</div>
<blockquote cite="https://sites.google.com/site/johanngutenbergper5/q">
<p>It is a press, certainly, but a press from which shall flow in inexhaustible streams...Through it, God will spread His Word. A spring of truth shall flow from it: like a new star it shall scatter the darkness of ignorance, and cause a light heretofore unknown to shine amongst men.</p>
<footer><a href="https://sites.google.com/site/johanngutenbergper5/q">Johannes Gutenberg</a></cite></footer>
</blockquote>
</div>
<div class="page-break-after">
<h2>This paragraph use the default font</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
<h2>This paragraph use a Google font</h2>
<p class="google-font">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
<h2>This paragraph use a local font</h2>
<p class="local-font">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</div>
<div class="center">
<h1>This image is loaded from a URL</h1>
<img src="https://user-images.githubusercontent.com/8983173/130322857-185831e2-f041-46eb-a17f-0a69d066c4e5.png">
</div>
</body>
</html>

View File

@@ -1,24 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Gutenberg</title>
</head>
<body>
<p>Console API</p>
<script type="application/javascript">
console.log("a simple message")
console.debug("a debug message")
console.warn("a warning message")
console.error("an error message")
</script>
<script type="application/javascript">
throw new Error("Exception 1")
</script>
<script type="application/javascript">
throw new Error("Exception 2")
</script>
</body>
</html>

View File

@@ -1,28 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Gutenberg</title>
</head>
<body>
<p id="status">
No window.status
</p>
<script type="application/javascript">
const delay = ms => new Promise(res => setTimeout(res, ms))
const changeStatus = async (status) => {
await delay(2000)
console.log('waited 2s')
document.getElementById('status').innerText = 'window.status === ' + status
window.status = status
};
changeStatus('ready')
</script>
</body>
</html>

View File

@@ -1,10 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Gutenberg</title>
</head>
<body>
<iframe src='file:///etc/passwd'></iframe>
</body>
</html>

View File

@@ -1,10 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Gutenberg</title>
</head>
<body>
<p>Hello, world!</p>
</body>
</html>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

View File

@@ -1,11 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Gutenberg</title>
</head>
<body>
<h1>Gutenberg</h1>
<img src="MyImg.gif">
</body>
</html>

View File

@@ -1,20 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="style.css">
<title>Gutenberg</title>
</head>
<body>
<div class="center">
<h1>Gutenberg</h1>
</div>
<blockquote cite="https://sites.google.com/site/johanngutenbergper5/q">
<p>It is a press, certainly, but a press from which shall flow in inexhaustible streams...Through it, God will spread His Word. A spring of truth shall flow from it: like a new star it shall scatter the darkness of ignorance, and cause a light heretofore unknown to shine amongst men.</p>
<footer><a href="https://sites.google.com/site/johanngutenbergper5/q">Johannes Gutenberg</a></cite></footer>
</blockquote>
<script src="paged.polyfill.js"></script>
</body>
</html>

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +0,0 @@
body {
font-family: Arial, Helvetica, sans-serif;
}
.center {
text-align: center;
}

View File

@@ -1,14 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Gutenberg</title>
</head>
<body>
<h1>Gutenberg</h1>
<p style="color: #d1d0d0;">
It is a press, certainly, but a press from which shall flow in inexhaustible streams...Through it, God will spread His Word. A spring of truth shall flow from it: like a new star it shall scatter the darkness of ignorance, and cause a light heretofore unknown to shine amongst men.
</p>
</div>
</body>
</html>

View File

@@ -1,19 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Gutenberg</title>
<style>
@media print {
#screen { display: none }
}
@media screen {
#print { display: none }
}
</style>
</head>
<body>
<p id="print">Print media type</p>
<p id="screen">Screen media type</p>
</body>
</html>

View File

@@ -1,17 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Gutenberg</title>
</head>
<body>
<p id="javascript">
JavaScript disabled.
</p>
<script type="application/javascript">
document.getElementById('javascript').innerText = 'JavaScript not disabled.'
</script>
</body>
</html>

View File

@@ -25,4 +25,5 @@ body {
.page-break-after {
page-break-after: always;
}
}
}

View File

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 29 KiB

View File

@@ -20,15 +20,24 @@
</div>
<div class="page-break-after">
{{ toHTML "markdown1.md" }}
{{ toHTML "defaultfont.md" }}
<div class="google-font">
{{ toHTML "markdown2.md" }}
{{ toHTML "googlefont.md" }}
</div>
<div class="local-font">
{{ toHTML "markdown3.md" }}
{{ toHTML "localfont.md" }}
</div>
</div>
<div class="page-break-after">
{{ toHTML "table.md" }}
<h2>HTML from previous table</h2>
<textarea readonly="readonly" cols="100" rows="50">
{{ toHTML "table.md" }}
</textarea>
</div>
</body>
</html>

View File

@@ -1,23 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Gutenberg</title>
</head>
<body>
<div class="page-break-after">
<div class="center">
<h1>Gutenberg</h1>
</div>
<blockquote cite="https://sites.google.com/site/johanngutenbergper5/q">
<p>It is a press, certainly, but a press from which shall flow in inexhaustible streams...Through it, God will spread His Word. A spring of truth shall flow from it: like a new star it shall scatter the darkness of ignorance, and cause a light heretofore unknown to shine amongst men.</p>
<footer><a href="https://sites.google.com/site/johanngutenbergper5/q">Johannes Gutenberg</a></cite></footer>
</blockquote>
</div>
<div class="page-break-after">
{{ toHTML "markdown.md" }}
</div>
</body>
</html>

View File

@@ -1,18 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Gutenberg</title>
</head>
<body>
<h1>Table in markdown</h1>
<h2>toHTML</h2>
{{ toHTML "markdown.md" }}
<h2>Actual HTML</h2>
<textarea readonly="readonly" cols="100" rows="50">
{{ toHTML "markdown.md" }}
</textarea>
</body>
</html>

View File

@@ -1,3 +1,5 @@
## This paragraph displays a table from a markdown file
| Tables | Are | Cool |
|----------|:-------------:|------:|
| col 1 is | left-aligned | $1600 |

View File

@@ -1,15 +0,0 @@
<html>
<head>
<style>
body {
font-size: 8rem;
margin: 4rem auto;
}
</style>
</head>
<body>
<p>
<span class="pageNumber"></span> of <span class="totalPages"></span>
</p>
</body>
</html>

View File

@@ -1,13 +0,0 @@
<html>
<head>
<style>
body {
font-size: 8rem;
margin: 4rem auto;
}
</style>
</head>
<body>
<span class="title"></span>
</body>
</html>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff