test: do not use quirks mode for test files (#11930)

This commit is contained in:
Alex Rudenko 2024-02-16 09:14:17 +01:00 committed by GitHub
parent eea588419d
commit aef584c815
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
54 changed files with 54 additions and 2 deletions

View File

@ -1,3 +1,4 @@
<!DOCTYPE html>
<button id="abort"></button> <button id="abort"></button>
<script> <script>

View File

@ -1,3 +1,4 @@
<!DOCTYPE html>
<div>beforeunload demo.</div> <div>beforeunload demo.</div>
<script> <script>
window.addEventListener('beforeunload', event => { window.addEventListener('beforeunload', event => {

View File

@ -1,3 +1,4 @@
<!DOCTYPE html>
<body>BFCached<a href="target.html">next</a></body> <body>BFCached<a href="target.html">next</a></body>
<script> <script>
window.addEventListener('DOMContentLoaded', () => { window.addEventListener('DOMContentLoaded', () => {

View File

@ -1,3 +1,4 @@
<!DOCTYPE html>
<script> <script>
const worker = new Worker('worker.mjs', {type: 'module'}) const worker = new Worker('worker.mjs', {type: 'module'})
</script> </script>

View File

@ -1,2 +1,3 @@
<!DOCTYPE html>
<link rel='stylesheet' href='./one-style-font.css'> <link rel='stylesheet' href='./one-style-font.css'>
<div>hello, world!</div> <div>hello, world!</div>

View File

@ -1,2 +1,3 @@
<!DOCTYPE html>
<link rel='stylesheet' href='./one-style.css'> <link rel='stylesheet' href='./one-style.css'>
<div>hello, world!</div> <div>hello, world!</div>

View File

@ -1 +1,2 @@
<!DOCTYPE html>
<meta http-equiv="Content-Security-Policy" content="default-src 'self'"> <meta http-equiv="Content-Security-Policy" content="default-src 'self'">

View File

@ -1,3 +1,4 @@
<!DOCTYPE html>
<style></style> <style></style>
<div>empty style tag</div> <div>empty style tag</div>

View File

@ -1,3 +1,4 @@
<!DOCTYPE html>
<style> <style>
@charset "utf-8"; @charset "utf-8";
@namespace svg url(http://www.w3.org/2000/svg); @namespace svg url(http://www.w3.org/2000/svg);

View File

@ -1,3 +1,4 @@
<!DOCTYPE html>
<style> <style>
@media screen { div { color: green; } } </style> @media screen { div { color: green; } } </style>
<div>hello, world</div> <div>hello, world</div>

View File

@ -1,3 +1,4 @@
<!DOCTYPE html>
<link rel="stylesheet" href="stylesheet1.css"> <link rel="stylesheet" href="stylesheet1.css">
<link rel="stylesheet" href="stylesheet2.css"> <link rel="stylesheet" href="stylesheet2.css">
<script> <script>

View File

@ -1,3 +1,4 @@
<!DOCTYPE html>
<style> <style>
div { color: green; } div { color: green; }
a { color: blue; } a { color: blue; }

View File

@ -1,3 +1,4 @@
<!DOCTYPE html>
<style> <style>
body { body {
padding: 10px; padding: 10px;

View File

@ -1,3 +1,4 @@
<!DOCTYPE html>
<style> <style>
@media screen { @media screen {
a { color: green; } a { color: green; }

View File

@ -1,3 +1,4 @@
<!DOCTYPE html>
<script> <script>
window.addEventListener('DOMContentLoaded', () => { window.addEventListener('DOMContentLoaded', () => {
const iframe = document.createElement('iframe'); const iframe = document.createElement('iframe');

View File

@ -0,0 +1 @@
<!DOCTYPE html>

View File

@ -1,3 +1,4 @@
<!DOCTYPE html>
<script> <script>
a(); a();

View File

@ -1,3 +1,4 @@
<!DOCTYPE html>
<link rel='stylesheet' href='./style.css'> <link rel='stylesheet' href='./style.css'>
<script src='./script.js' type='text/javascript'></script> <script src='./script.js' type='text/javascript'></script>
<style> <style>

View File

@ -1,3 +1,4 @@
<!DOCTYPE html>
<frameset> <frameset>
<frameset> <frameset>
<frame src='./frame.html'></frame> <frame src='./frame.html'></frame>

View File

@ -1,3 +1,4 @@
<!DOCTYPE html>
<iframe width="100%" height="300" src="about:blank"></iframe> <iframe width="100%" height="300" src="about:blank"></iframe>
<div style="height: 800vh"></div> <div style="height: 800vh"></div>
<iframe width="100%" height="300" src='./frame.html' loading="lazy"></iframe> <iframe width="100%" height="300" src='./frame.html' loading="lazy"></iframe>

View File

@ -1,3 +1,4 @@
<!DOCTYPE html>
<style> <style>
:root { :root {
scrollbar-width: none; scrollbar-width: none;

View File

@ -1 +1,2 @@
<!DOCTYPE html>
<iframe src='./frame.html?param=value#fragment'></iframe> <iframe src='./frame.html?param=value#fragment'></iframe>

View File

@ -1 +1,2 @@
<!DOCTYPE html>
<iframe src='./frame.html'></iframe> <iframe src='./frame.html'></iframe>

View File

@ -1,3 +1,4 @@
<!DOCTYPE html>
<style> <style>
body { body {
display: flex; display: flex;

View File

@ -1,3 +1,4 @@
<!DOCTYPE html>
<script> <script>
var globalVar = 123; var globalVar = 123;
</script> </script>

View File

@ -1,3 +1,4 @@
<!DOCTYPE html>
<script> <script>
document.addEventListener('DOMContentLoaded', function() { document.addEventListener('DOMContentLoaded', function() {
function generatePalette(amount) { function generatePalette(amount) {

View File

@ -1,3 +1,4 @@
<!DOCTYPE html>
<script> <script>
window.addEventListener('DOMContentLoaded', () => { window.addEventListener('DOMContentLoaded', () => {
history.pushState({}, '', '#1'); history.pushState({}, '', '#1');

View File

@ -1,2 +1,3 @@
<!DOCTYPE html>
<iframe src="./frames/frame.html"></iframe> <iframe src="./frames/frame.html"></iframe>
<script src="./initiator.js"></script> <script src="./initiator.js"></script>

View File

@ -1,3 +1,4 @@
<!DOCTYPE html>
<script> <script>
window.addEventListener('DOMContentLoaded', () => { window.addEventListener('DOMContentLoaded', () => {
const iframe = document.createElement('iframe'); const iframe = document.createElement('iframe');

View File

@ -1 +1,2 @@
<!DOCTYPE html>
<button>click</button> <button>click</button>

View File

@ -1,4 +1,4 @@
<!doctype html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>Touch test</title> <title>Touch test</title>

View File

@ -1 +1,2 @@
<!DOCTYPE html>
<script>eval('console.log("foo")')</script> <script>eval('console.log("foo")')</script>

View File

@ -1,3 +1,4 @@
<!DOCTYPE html>
<script> <script>
function foo() { function foo() {
if (1 > 2) if (1 > 2)

View File

@ -1,2 +1,3 @@
<!DOCTYPE html>
<script src='script1.js'></script> <script src='script1.js'></script>
<script src='script2.js'></script> <script src='script2.js'></script>

View File

@ -1,2 +1,3 @@
<!DOCTYPE html>
<script> <script>
function unused(){}console.log('used!');if(true===false)console.log('unused!');</script> function unused(){}console.log('used!');if(true===false)console.log('unused!');</script>

View File

@ -1,2 +1,3 @@
<!DOCTYPE html>
<script> <script>
function foo() {function bar() { } console.log(1); } foo(); </script> function foo() {function bar() { } console.log(1); } foo(); </script>

View File

@ -1,3 +1,4 @@
<!DOCTYPE html>
<script> <script>
console.log(1); console.log(1);
//# sourceURL=nicename.js //# sourceURL=nicename.js

View File

@ -1 +1,2 @@
<!DOCTYPE html>
<script>function foo() { }</script> <script>function foo() { }</script>

View File

@ -1,3 +1,4 @@
<!DOCTYPE html>
<iframe width="100%" height="300" src="about:blank"></iframe> <iframe width="100%" height="300" src="about:blank"></iframe>
<div style="height: 800vh"></div> <div style="height: 800vh"></div>
<iframe width="100%" height="300" src="https://www.example.com" loading="lazy"></iframe> <iframe width="100%" height="300" src="https://www.example.com" loading="lazy"></iframe>

View File

@ -1,3 +1,4 @@
<!DOCTYPE html>
<script> <script>
window.addEventListener('DOMContentLoaded', () => { window.addEventListener('DOMContentLoaded', () => {
const iframe = document.createElement('iframe'); const iframe = document.createElement('iframe');

View File

@ -1 +1,2 @@
<!DOCTYPE html>
<meta name = "viewport" content = "initial-scale = 1, user-scalable = no"> <meta name = "viewport" content = "initial-scale = 1, user-scalable = no">

View File

@ -1,3 +1,4 @@
<!DOCTYPE html>
<script> <script>
async function sleep(delay) { async function sleep(delay) {
return new Promise(resolve => setTimeout(resolve, delay)); return new Promise(resolve => setTimeout(resolve, delay));

View File

@ -1,2 +1,3 @@
<!DOCTYPE html>
<link rel='stylesheet' href='./one-style.css'> <link rel='stylesheet' href='./one-style.css'>
<div>hello, world!</div> <div>hello, world!</div>

View File

@ -1,3 +1,4 @@
<!DOCTYPE html>
<a id="navigate-within-document" href="#nav">Navigate within document</a> <a id="navigate-within-document" href="#nav">Navigate within document</a>
<a name="nav"></a> <a name="nav"></a>
<script> <script>

View File

@ -1,3 +1,4 @@
<!DOCTYPE html>
<div id="a">hello <button id="b">world</button> <div id="a">hello <button id="b">world</button>
<span id="f"></span> <span id="f"></span>
<div id="c"></div> <div id="c"></div>

View File

@ -1,3 +1,4 @@
<!DOCTYPE html>
<style> <style>
/* http://meyerweb.com/eric/tools/css/reset/ /* http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126 v2.0 | 20110126

View File

@ -1,3 +1,4 @@
<!DOCTYPE html>
<script> <script>
var req = new XMLHttpRequest(); var req = new XMLHttpRequest();
req.open('GET', '/self-request.html'); req.open('GET', '/self-request.html');

View File

@ -1,3 +1,4 @@
<!DOCTYPE html>
<script> <script>
window.registrationPromise = navigator.serviceWorker.register('sw.js'); window.registrationPromise = navigator.serviceWorker.register('sw.js');
</script> </script>

View File

@ -1,3 +1,4 @@
<!DOCTYPE html>
<link rel="stylesheet" href="./style.css"> <link rel="stylesheet" href="./style.css">
<script> <script>
window.registrationPromise = navigator.serviceWorker.register('sw.js'); window.registrationPromise = navigator.serviceWorker.register('sw.js');

View File

@ -1,3 +1,4 @@
<!DOCTYPE html>
<script> <script>
let h1 = null; let h1 = null;

View File

@ -1,3 +1,4 @@
<!DOCTYPE html>
<script> <script>
window.result = window.injected; window.result = window.injected;
</script> </script>

View File

@ -1 +1,2 @@
<!DOCTYPE html>
<title>Woof-Woof</title> <title>Woof-Woof</title>

View File

@ -1,3 +1,4 @@
<!DOCTYPE html>
<style> <style>
:root { :root {
font-family: monospace; font-family: monospace;

View File

@ -1232,7 +1232,7 @@ describe('Page', function () {
page.goto(server.PREFIX + '/error.html'), page.goto(server.PREFIX + '/error.html'),
]); ]);
expect(error.message).toContain('Fancy'); expect(error.message).toContain('Fancy');
expect(error.stack?.split('\n')[1]).toContain('error.html:13'); expect(error.stack?.split('\n').at(-1)).toContain('error.html:3:1');
}); });
}); });