mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 12:19:54 +00:00
LibWeb: Support for Content-Language
HTTP header
This commit is contained in:
parent
dda1573746
commit
c9edb6ffc4
Notes:
github-actions[bot]
2025-02-19 10:54:32 +00:00
Author: https://github.com/pbrw
Commit: c9edb6ffc4
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3255
Reviewed-by: https://github.com/shannonbooth ✅
Reviewed-by: https://github.com/tcl3 ✅
5 changed files with 51 additions and 0 deletions
38
Tests/LibWeb/Text/input/HTML/http-content-language.html
Normal file
38
Tests/LibWeb/Text/input/HTML/http-content-language.html
Normal file
|
@ -0,0 +1,38 @@
|
|||
<!DOCTYPE html>
|
||||
<script src="../include.js"></script>
|
||||
<script>
|
||||
asyncTest(async (done) => {
|
||||
const httpServer = httpTestServer();
|
||||
const url = await httpServer.createEcho("GET", "/http-content-language-test", {
|
||||
status: 200,
|
||||
headers: {
|
||||
"Access-Control-Allow-Origin": "*",
|
||||
"Access-Control-Expose-Headers": "Content-Language",
|
||||
"Content-Language": "ko",
|
||||
},
|
||||
body: `
|
||||
<style>
|
||||
div { width: 50px; }
|
||||
#box:lang(ko) { width: 100px; }
|
||||
</style>
|
||||
<body><div id="box">TEST</div></body>
|
||||
<script>
|
||||
if (document.getElementById("box").offsetWidth == 100) {
|
||||
parent.postMessage("OK", "*")
|
||||
} else {
|
||||
parent.postMessage("FAIL", "*")
|
||||
}
|
||||
<\/script>`,
|
||||
});
|
||||
|
||||
const frame = document.createElement('iframe');
|
||||
frame.src = url;
|
||||
|
||||
addEventListener("message", (event) => {
|
||||
println(event.data);
|
||||
done();
|
||||
}, false);
|
||||
|
||||
document.body.appendChild(frame);
|
||||
});
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue