Skip to content

Commit

Permalink
Bug 1655393 - Add WPT for InputEvent.getTargetRanges() r=smaug
Browse files Browse the repository at this point in the history
There are no automated tests for `InputEvent.getTargetRanges()` because it
is set only when `beforeinput` event, but it's defined as not dispatched by
`document.execCommand`.

However, we can synthesize `beforeinput` event with test driver.

On the other hand, the definition in Input Events spec is not clear.
Therefore, most of the tests won't be passed on any browsers for now.
There are some spec issues which I filed:
* w3c/input-events#112
* w3c/input-events#113
* w3c/input-events#114

These new test must be useful when browser vendors discuss the issues.

Differential Revision: https://phabricator.services.mozilla.com/D85527
  • Loading branch information
masayuki-nakano committed Aug 4, 2020
1 parent 0c1188f commit 2131bc6
Show file tree
Hide file tree
Showing 4 changed files with 1,793 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
[input-events-get-target-ranges-backspace.tentative.html]
[Shift + Backspace at "<p>abc def[\] ghi</p>"]
expected: FAIL

[Control + Backspace at "<p>abc def[\] ghi</p>"]
expected:
if (os == "win") or (os == "android"): FAIL
PASS

[Alt + Backspace at "<p>abc def[\] ghi</p>"]
expected:
if (os == "mac") or (os == "win") or (os == "android"): FAIL
PASS

[Meta + Backspace at "<p> abc[\] def</p>"]
expected: FAIL

[Shift + Backspace at "<p> abc[\] def</p>"]
expected: FAIL

[Control + Backspace at "<p> abc[\] def</p>"]
expected: FAIL

[Alt + Backspace at "<p> abc[\] def</p>"]
expected: FAIL

[Backspace at "<p>abc </p><p>[\] def</p>"]
expected: FAIL

[Backspace at "<p>abc </p><pre>[\] def</pre>"]
expected: FAIL

[Backspace at "<div>abc <p> [\]def<br>ghi</p></div>"]
expected: FAIL

[Backspace at "<p>a[\]bc</p>"]
expected: FAIL

[Backspace at "<p>abc </p><p> [\]def</p>"]
expected: FAIL

[Backspace at "<p> a[\]bc</p>"]
expected: FAIL

[Backspace at "<p>a<span>b[\]</span>c</p>"]
expected: FAIL

[Backspace at "<p>abc<br><br></p><p>[\]def</p>"]
expected: FAIL

[Backspace at "<pre>abc </pre><p> [\]def </p>"]
expected: FAIL

[Backspace at "<p>abc[\]</p>"]
expected: FAIL

[Backspace at "<p>abc<br>[\]def</p>"]
expected: FAIL

[Backspace at "<p>ab[\]c</p>"]
expected: FAIL

[Backspace at "<p>abc{<br>}def</p>"]
expected: FAIL

[Backspace at "<p>abc </p><p> [\] def</p>"]
expected: FAIL

[Backspace at "<p>abc<br></p><p>[\]def</p>"]
expected: FAIL

[Backspace at "<p>abc [</p><p>\] def</p>"]
expected: FAIL

[Backspace at "<div><p>abc </p> [\]def</div>"]
expected: FAIL

[Backspace at "<p>abc </p><p> [\] def</p>"]
expected: FAIL

[Backspace at "<p>a<span>b</span>[\]c</p>"]
expected: FAIL

[Backspace at "<pre>abc </pre><p> [\]def</p>"]
expected: FAIL

Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
[input-events-get-target-ranges-forwarddelete.tentative.html]
[Shift + Delete at "<p>abc [\]def ghi</p>"]
expected:
if (os == "mac") or (os == "win"): FAIL
PASS

[Control + Delete at "<p>abc [\]def ghi</p>"]
expected:
if (os == "win") or (os == "android"): FAIL
PASS

[Alt + Delete at "<p>abc [\]def ghi</p>"]
expected:
if (os == "mac") or (os == "android"): FAIL
PASS

[Meta + Delete at "<p>abc [\]def</p>"]
expected: FAIL

[Shift + Delete at "<p>abc [\]def </p>"]
expected: FAIL

[Alt + Delete at "<p>abc [\]def </p>"]
expected: FAIL

[Control + Delete at "<p>abc [\]def </p>"]
expected: FAIL

[Delete at "<p>[\]abc</p>"]
expected: FAIL

[Delete at "<p>a<span>[\]b</span>c</p>"]
expected: FAIL

[Delete at "<p>a[\]bc</p>"]
expected: FAIL

[Delete at "<pre>abc [\]</pre><p> def</p>"]
expected: FAIL

[Delete at "<div>abc[\] <p> def<br>ghi</p></div>"]
expected: FAIL

[Delete at "<p>abc [\] </p><p> def</p>"]
expected: FAIL

[Delete at "<pre>abc [\]</pre><p> def </p>"]
expected: FAIL

[Delete at "<p>ab[\]c </p>"]
expected: FAIL

[Delete at "<p>abc [\]</p><p> def</p>"]
expected: FAIL

[Delete at "<p>a[\]<span>b</span>c</p>"]
expected: FAIL

[Delete at "<p>abc[\] </p><p> def</p>"]
expected: FAIL

[Delete at "<p>ab[\]c</p>"]
expected: FAIL

[Delete at "<p>abc[\]<br></p><p>def</p>"]
expected: FAIL

[Delete at "<p>abc[\]<br>def</p>"]
expected: FAIL

[Delete at "<p>abc<br>{}<br></p><p>def</p>"]
expected: FAIL

[Delete at "<p>abc [\] </p><p> def</p>"]
expected: FAIL

[Delete at "<p>abc[\] </p><pre> def</pre>"]
expected: FAIL

[Delete at "<p>abc{<br>}def</p>"]
expected: FAIL

[Delete at "<p>abc [</p><p>\] def</p>"]
expected: FAIL

[Delete at "<div><p>abc[\] </p> def</div>"]
expected: FAIL

Loading

0 comments on commit 2131bc6

Please sign in to comment.