mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 04:09:13 +00:00
LibWeb: Implement the "justifyCenter/Full/Left/Right" editing commands
This commit is contained in:
parent
1c3251e2d5
commit
fbc0d40d2c
Notes:
github-actions[bot]
2025-01-10 22:34:54 +00:00
Author: https://github.com/gmta
Commit: fbc0d40d2c
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3216
12 changed files with 524 additions and 0 deletions
21
Tests/LibWeb/Text/input/Editing/execCommand-justifyFull.html
Normal file
21
Tests/LibWeb/Text/input/Editing/execCommand-justifyFull.html
Normal file
|
@ -0,0 +1,21 @@
|
|||
<script src="../include.js"></script>
|
||||
<div contenteditable="true" id="d1">foobar</div>
|
||||
<div contenteditable="true" id="d2"><div style="text-align: right">foobar</div></div>
|
||||
<script>
|
||||
test(() => {
|
||||
const range = document.createRange();
|
||||
getSelection().addRange(range);
|
||||
|
||||
const div1 = document.querySelector('#d1');
|
||||
range.setStart(div1.firstChild, 0);
|
||||
range.setEnd(div1.firstChild, 6);
|
||||
document.execCommand('justifyFull');
|
||||
println(div1.innerHTML);
|
||||
|
||||
const div2 = document.querySelector('#d2');
|
||||
range.setStart(div2.firstChild, 0);
|
||||
range.setEnd(div2.firstChild, 1);
|
||||
document.execCommand('justifyFull');
|
||||
println(div2.innerHTML);
|
||||
});
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue