mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 04:09:13 +00:00
LibWeb: Follow spec steps to set the selectionDirection attribute value
This commit is contained in:
parent
e0cd2edccb
commit
d0b97873d4
Notes:
github-actions[bot]
2024-10-04 17:43:25 +00:00
Author: https://github.com/tcl3
Commit: d0b97873d4
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1625
10 changed files with 68 additions and 4 deletions
|
@ -0,0 +1,25 @@
|
|||
<!DOCTYPE html>
|
||||
<script src="../include.js"></script>
|
||||
<script>
|
||||
asyncTest(done => {
|
||||
const elementNames = [
|
||||
"input",
|
||||
"textarea",
|
||||
];
|
||||
let selectEventFiredCount = 0;
|
||||
for (const elementName of elementNames) {
|
||||
const element = document.createElement(elementName);
|
||||
element.setRangeText("foobar", 0, element.value.length, "start");
|
||||
document.body.appendChild(element);
|
||||
element.onselect = () => {
|
||||
element.remove();
|
||||
println(`select event fired for ${elementName}`);
|
||||
selectEventFiredCount++;
|
||||
if (selectEventFiredCount === elementNames.length) {
|
||||
done();
|
||||
}
|
||||
};
|
||||
element.selectionDirection = "backward";
|
||||
}
|
||||
});
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue