Skip to content
Permalink
Browse files
Setting textContent can leave dir=auto content in wrong directionality
https://bugs.webkit.org/show_bug.cgi?id=244446

Reviewed by Antti Koivisto.

Add forgotten tests.

* LayoutTests/fast/dom/HTMLElement/attr-dir-auto-replace-children-expected.html: Added.
* LayoutTests/fast/dom/HTMLElement/attr-dir-auto-replace-children-with-invalid-dir-expected.html: Added.
* LayoutTests/fast/dom/HTMLElement/attr-dir-auto-replace-children-with-invalid-dir.html: Added.
* LayoutTests/fast/dom/HTMLElement/attr-dir-auto-replace-children.html: Added.

Canonical link: https://commits.webkit.org/253896@main
  • Loading branch information
rniwa committed Aug 29, 2022
1 parent d5158b6 commit f3ab0d7fe454d54a910b7b77ce1a36ce6ce717cd
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 0 deletions.
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html>
<body>
<div id="container">
<span>b</span>
<span>a</span>
</div>
<style>
#container { width: 100px; }
</style>
</body>
</html>
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html>
<body>
<div id="container">
<span>b</span>
<span>a</span>
</div>
<style>
#container { width: 100px; }
</style>
</body>
</html>
@@ -0,0 +1,23 @@
<!DOCTYPE html>
<html class="reftest-wait">
<body>
<div id="container" dir="auto">
<span id="rtl">&#1514;</span>
<span>a</span>
</div>
<style>
#container { width: 100px; }
</style>
<script>

requestAnimationFrame(() => {
setTimeout(() => {
rtl.dir = 'x';
rtl.textContent = 'b';
document.documentElement.className = '';
}, 0);
});

</script>
</body>
</html>
@@ -0,0 +1,22 @@
<!DOCTYPE html>
<html class="reftest-wait">
<body>
<div id="container" dir="auto">
<span id="rtl">&#1514;</span>
<span>a</span>
</div>
<style>
#container { width: 100px; }
</style>
<script>

requestAnimationFrame(() => {
setTimeout(() => {
rtl.textContent = 'b';
document.documentElement.className = '';
}, 0);
});

</script>
</body>
</html>

0 comments on commit f3ab0d7

Please sign in to comment.