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

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Oct 28 15:39:37 PDT 2021


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

Chris Dumez <cdumez at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #442710|review?, commit-queue?      |review-
              Flags|                            |

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

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

> LayoutTests/fast/dom/Range/missingRange-expected.txt:7
> +FAIL successfullyParsed should be true (of type boolean). Was undefined (of type undefined).

r- due to FAIL line in test output.

>> LayoutTests/fast/dom/Range/missingRange.html:12
>> +            getSelection().extend(div1);
> 
> And here:
> something like this:
> ```
> test(function () {
>     let div = document.createElement('div');
>     document.body.appendChild(div);
>     assert_throws_dom("InvalidStateError", () => {
>         getSelection().extend(div);
>     });
> }, 'Test extend method failure due to missing range');
> ```
> 
> Then move it under LayoutTests/imported/w3c/web-platform-tests/selection/.
> 
> Then later on submit a PR for that test to https://github.com/web-platform-tests/wpt.

And in the future, if writing such tests using js-test.js, please:
- Include js-test.js instead of js-test-pre.js / js-test-post.js which are legacy
- shouldThrowErrorName("getSelection().extend(div1);", "InvalidStateError") to properly PASS / FAIL based on the exception being thrown. Right now, the exception is throw and not caught and causes a FAIL line to be printed in the output.

-- 
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/20211028/ffe56e32/attachment.htm>


More information about the webkit-unassigned mailing list