mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-01 03:57:15 +02:00
LibWeb: Handle empty string in lang attribute
If the attribute value is the empty string `(lang="")`, the language is set to unknown. `lang` attribute higher up in the document tree will no longer be applied to the content of that element.
This commit is contained in:
Notes:
github-actions[bot]
2024-11-04 12:07:26 +00:00
Author: https://github.com/pbrw Commit: https://github.com/LadybirdBrowser/ladybird/commit/e2613090ed1 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2078 Reviewed-by: https://github.com/AtkinsSJ ✅
25
Tests/LibWeb/Text/input/HTML/lang-attribute-empty-1.html
Normal file
25
Tests/LibWeb/Text/input/HTML/lang-attribute-empty-1.html
Normal file
@@ -0,0 +1,25 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<style type='text/css'>
|
||||
.test div { width: 50px; }
|
||||
#box:lang(ko) { width: 100px; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="test" lang="ko">
|
||||
<div id="box" lang="">Test</div>
|
||||
</div>
|
||||
</body>
|
||||
<script src="../include.js"></script>
|
||||
<script>
|
||||
asyncTest((done) => {
|
||||
if (document.getElementById('box').offsetWidth == 50) {
|
||||
println("OK");
|
||||
} else {
|
||||
println("FAIL. If an element contains a lang attribute with an empty value, the value of a lang attribute higher up the document tree will no longer be applied to the content of that element.");
|
||||
}
|
||||
done();
|
||||
});
|
||||
</script>
|
||||
</html>
|
||||
Reference in New Issue
Block a user