[Webkit-unassigned] [Bug 232420] Selection extend() should trigger exception with no ranges

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Oct 29 13:43:00 PDT 2021


https://bugs.webkit.org/show_bug.cgi?id=232420

--- Comment #11 from Chris Dumez <cdumez at apple.com> ---
Comment on attachment 442858
  --> https://bugs.webkit.org/attachment.cgi?id=442858
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=442858&action=review

> LayoutTests/imported/w3c/web-platform-tests/selection/extend-exception.html:2
> +<title>Selection extend() tests</title>

Please provide a more specific title

> LayoutTests/imported/w3c/web-platform-tests/selection/extend-exception.html:5
> +<body>

Please close you <body>

> LayoutTests/imported/w3c/web-platform-tests/selection/extend-exception.html:8
> +<script src=common.js></script>

What is this used for?

> LayoutTests/imported/w3c/web-platform-tests/selection/extend-exception.html:9
> +<script src=extend.js></script>

What is this used for?

> LayoutTests/imported/w3c/web-platform-tests/selection/extend-exception.html:10
> +<div id="log"></div>

Ideally, the test() would create and remove the div:
let div = document.createElement("div");
document.body.appendChild(div);

> LayoutTests/imported/w3c/web-platform-tests/selection/extend-exception.html:14
> +var selection = document.getSelection();

Should be inside the test().

> LayoutTests/imported/w3c/web-platform-tests/selection/extend-exception.html:19
> +    selection.removeAllRanges();

Which is this needed? How can there be a range already?

> LayoutTests/imported/w3c/web-platform-tests/selection/extend-exception.html:22
> +});

We normally pass a string parameter as second parameter with a test description.

> LayoutTests/imported/w3c/web-platform-tests/selection/extend-exception.html:24
> +testDiv.style.display = "none";

The test should do clean up itself. I'd recommend adding something like this inside your test():
```
this.add_cleanup(function() { div.remove() });
```

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20211029/9ddf372e/attachment.htm>


More information about the webkit-unassigned mailing list