bors-servo
db41cc00be
Auto merge of #19461 - jonleighton:issue-19171-4, r=KiChjang
...
Handle cases where selection API doesn't apply
The selection API only applies to certain <input> types:
https://html.spec.whatwg.org/multipage/#do-not-apply
This commit ensures that we handle that correctly.
Some notes:
1. TextControl::set_dom_selection_direction now calls
set_selection_range(), which means that setting selectionDirection will
now fire a selection event, as it should per the spec.
2. There is a test for the firing of the select event in
tests/wpt/web-platform-tests/html/semantics/forms/textfieldselection/select-event.html,
however the test did not run due to this syntax error:
(pid:26017) "ERROR:script::dom::bindings::error: Error at http://web-platform.test:8000/html/semantics/forms/textfieldselection/select-event.html:50:11 missing = in const declaration"
This happens due to the us of the "for (const foo of ...)" construct.
Per https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...of
this should actually work, so it's somewhat unsatisfying to have to
change the test.
3. I removed tests/wpt/web-platform-tests/html/semantics/forms/textfieldselection/selection-not-application-textarea.html
because it doesn't seem to add any extra value - the selection API
always applies to textarea elements, and the API is tested elsewhere.
4. If an `<input>`'s type is unset, it defaults to a text, and the
selection API applies. Also, if an `<input>`'s type is set to an
invalid value, it defaults to a text too. This second case doesn't
currently work, and I'll need to do more restructuring of the code in
a future commit. See discussion with nox in IRC:
https://mozilla.logbot.info/servo/20171201#c13946454-c13946594
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg " height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/19461 )
<!-- Reviewable:end -->
2017-12-10 18:37:58 -06:00
..
2017-12-08 14:32:28 +01:00
2017-11-30 16:18:57 +00:00
2017-10-31 21:38:39 +01:00
2017-10-18 22:20:37 +11:00
2017-12-08 21:07:05 +01:00
2017-08-23 21:38:44 +02:00
2017-10-16 17:16:20 +02:00
2017-10-18 09:15:55 +02:00
2017-10-16 17:16:20 +02:00
2017-10-16 17:16:20 +02:00
2017-11-09 16:56:39 +01:00
2017-10-18 22:20:37 +11:00
2017-10-16 17:16:20 +02:00
2017-10-16 17:16:20 +02:00
2017-10-16 17:16:20 +02:00
2017-10-16 17:16:20 +02:00
2017-10-16 17:16:20 +02:00
2017-10-16 17:16:20 +02:00
2017-10-16 17:16:20 +02:00
2017-10-16 17:16:20 +02:00
2017-02-24 01:50:51 +01:00
2017-10-18 22:20:37 +11:00
2017-10-16 17:16:20 +02:00
2017-12-05 15:10:55 +08:00
2017-11-27 20:19:08 +08:00
2017-10-18 22:20:37 +11:00
2017-10-16 17:16:20 +02:00
2017-10-16 17:16:20 +02:00
2017-10-16 17:16:20 +02:00
2017-06-16 17:55:25 -04:00
2017-11-06 17:08:14 +01:00
2017-10-18 22:20:37 +11:00
2017-10-30 23:36:06 +01:00
2017-10-17 11:24:57 -07:00
2017-10-18 22:20:37 +11:00
2017-10-18 22:20:37 +11:00
2017-10-18 22:20:37 +11:00
2017-10-18 22:20:37 +11:00
2017-10-18 22:20:37 +11:00
2017-10-30 23:36:06 +01:00
2017-10-18 22:20:37 +11:00
2017-09-26 09:49:10 +02:00
2017-10-18 22:20:37 +11:00
2017-11-21 14:26:16 +01:00
2017-10-18 22:20:37 +11:00
2017-10-18 22:20:37 +11:00
2017-10-17 11:24:57 -07:00
2017-10-30 23:36:06 +01:00
2017-10-18 22:20:37 +11:00
2017-10-18 22:20:37 +11:00
2017-10-18 22:20:37 +11:00
2017-10-30 23:36:06 +01:00
2017-10-16 17:16:20 +02:00
2017-10-16 17:16:20 +02:00
2017-12-07 20:58:31 +01:00
2017-10-16 17:16:20 +02:00
2017-10-16 17:16:20 +02:00
2017-10-18 22:20:37 +11:00
2017-11-22 14:06:27 -08:00
2017-10-16 17:16:20 +02:00
2017-12-08 14:32:28 +01:00
2017-11-22 14:06:27 -08:00
2017-10-16 17:16:20 +02:00
2017-10-16 17:16:20 +02:00
2017-10-16 17:16:20 +02:00
2017-10-16 17:16:20 +02:00
2017-10-16 17:16:20 +02:00
2017-10-16 17:16:20 +02:00
2017-10-16 17:16:20 +02:00
2017-12-08 05:35:12 +01:00
2017-10-18 22:20:37 +11:00
2017-10-18 22:20:37 +11:00
2017-11-17 15:59:59 -08:00
2017-11-30 16:18:57 +00:00
2017-10-16 17:16:20 +02:00
2017-10-16 17:16:20 +02:00
2017-10-16 17:16:20 +02:00
2017-10-16 17:16:20 +02:00
2017-11-01 10:16:11 +01:00
2017-10-16 17:16:20 +02:00
2017-10-16 17:16:20 +02:00
2017-10-16 17:16:20 +02:00
2017-10-16 17:16:20 +02:00
2017-10-18 22:20:37 +11:00
2017-10-16 17:16:20 +02:00
2017-10-16 17:16:20 +02:00
2017-10-16 17:16:20 +02:00
2017-10-16 17:16:20 +02:00
2017-10-18 22:20:37 +11:00
2017-10-16 17:16:20 +02:00
2017-11-15 19:28:03 +08:00
2017-10-16 17:16:20 +02:00
2017-10-17 11:24:57 -07:00
2017-10-16 17:16:20 +02:00
2017-10-16 17:16:20 +02:00
2017-10-17 11:24:57 -07:00
2017-10-17 11:24:57 -07:00
2017-10-16 17:16:20 +02:00
2017-10-30 23:36:06 +01:00
2017-10-27 12:53:11 +02:00
2017-11-06 17:08:14 +01:00
2017-10-16 17:16:20 +02:00
2017-10-18 22:20:37 +11:00
2017-10-16 17:16:20 +02:00
2017-10-16 17:16:20 +02:00
2017-10-16 17:16:20 +02:00
2017-10-16 17:16:20 +02:00
2017-10-16 17:16:20 +02:00
2017-12-06 21:11:39 +01:00
2017-10-16 17:16:20 +02:00
2017-10-30 23:36:06 +01:00
2017-10-17 11:24:57 -07:00
2017-10-16 17:16:20 +02:00
2017-12-06 21:11:39 +01:00
2017-10-16 17:16:20 +02:00
2017-10-16 17:16:20 +02:00
2017-10-17 11:24:57 -07:00
2017-10-18 22:20:37 +11:00
2017-10-16 17:16:20 +02:00
2017-10-16 17:16:20 +02:00
2017-10-30 23:36:06 +01:00
2017-10-24 17:02:18 -05:00
2017-12-10 18:37:58 -06:00
2017-10-16 17:16:20 +02:00
2017-12-09 20:26:48 +01:00
2017-10-16 17:16:20 +02:00
2017-11-09 16:56:39 +01:00
2017-10-16 17:16:20 +02:00
2017-11-24 10:18:36 +01:00
2017-11-09 16:56:39 +01:00
2017-10-16 17:16:20 +02:00
2017-10-16 17:16:20 +02:00
2017-10-18 22:20:37 +11:00
2017-10-16 17:16:20 +02:00
2017-10-30 23:36:06 +01:00
2017-10-30 23:36:06 +01:00
2017-10-16 17:16:20 +02:00
2017-10-16 17:16:20 +02:00
2017-10-16 17:16:20 +02:00
2017-10-16 17:16:20 +02:00
2017-10-16 17:16:20 +02:00
2017-10-16 17:16:20 +02:00
2017-10-16 17:16:20 +02:00
2017-11-09 16:56:39 +01:00
2017-10-30 23:36:06 +01:00
2017-10-17 11:24:57 -07:00
2017-10-16 17:16:20 +02:00
2017-11-30 16:18:57 +00:00
2017-10-16 17:16:20 +02:00
2017-09-26 09:49:04 +02:00
2017-10-16 17:16:20 +02:00
2017-10-16 17:16:20 +02:00
2017-10-18 22:20:37 +11:00
2017-10-16 17:16:20 +02:00
2017-10-16 17:16:20 +02:00
2017-10-16 17:16:20 +02:00
2017-10-17 11:24:57 -07:00
2017-12-08 21:07:05 +01:00
2017-10-16 17:16:20 +02:00
2017-10-16 17:16:20 +02:00
2017-10-16 17:16:20 +02:00
2017-10-16 17:16:20 +02:00
2017-10-16 17:16:20 +02:00
2017-10-16 17:16:20 +02:00
2017-10-16 20:19:56 +02:00
2017-10-16 17:16:20 +02:00
2017-10-30 23:36:06 +01:00
2017-10-16 17:16:20 +02:00
2017-11-09 16:56:39 +01:00
2017-10-16 17:16:20 +02:00
2017-10-30 23:36:06 +01:00
2017-10-18 22:20:37 +11:00
2017-10-16 17:16:20 +02:00
2017-10-16 17:16:20 +02:00
2017-09-26 09:49:10 +02:00
2017-10-16 17:16:20 +02:00
2017-11-18 22:33:05 +01:00
2017-10-18 09:15:55 +02:00
2017-10-18 22:20:37 +11:00
2017-10-16 17:16:20 +02:00
2017-11-09 16:56:39 +01:00
2017-10-16 17:16:20 +02:00
2017-08-23 17:16:30 +02:00
2017-11-22 14:06:27 -08:00
2017-10-19 22:01:30 +08:00
2017-10-18 22:20:37 +11:00
2017-10-16 17:16:20 +02:00
2017-12-08 14:32:28 +01:00
2017-10-17 11:24:57 -07:00
2017-12-08 14:32:28 +01:00
2017-12-07 07:26:39 +01:00
2017-10-16 17:16:20 +02:00
2017-09-06 13:33:30 +02:00
2017-09-06 13:33:30 +02:00
2017-10-18 22:20:37 +11:00
2017-10-16 17:16:20 +02:00
2017-12-07 07:26:39 +01:00
2017-11-01 20:45:22 +00:00
2017-10-16 17:16:20 +02:00
2017-10-16 17:16:20 +02:00
2017-09-26 09:49:10 +02:00
2017-10-16 17:16:20 +02:00
2017-10-18 22:20:37 +11:00
2017-10-16 17:16:20 +02:00
2017-10-16 17:16:20 +02:00
2017-10-20 09:11:38 -07:00
2017-10-18 22:20:37 +11:00
2017-12-06 21:11:39 +01:00
2017-10-18 22:20:37 +11:00
2017-11-16 13:36:22 +08:00
2017-10-18 22:20:37 +11:00
2017-11-13 21:32:10 +01:00
2017-10-16 17:16:20 +02:00
2017-11-09 16:56:39 +01:00
2017-10-30 23:36:06 +01:00
2017-10-16 17:16:20 +02:00
2017-10-17 11:24:57 -07:00
2017-10-16 17:16:20 +02:00
2017-10-17 11:24:57 -07:00
2017-10-16 17:16:20 +02:00
2017-10-16 17:16:20 +02:00
2017-05-03 12:57:49 -05:00
2017-05-03 12:57:49 -05:00
2017-10-16 17:16:20 +02:00
2017-11-06 13:00:14 -05:00
2017-11-11 08:41:19 +01:00
2017-10-16 17:16:20 +02:00
2017-10-16 17:16:20 +02:00
2017-03-13 17:38:33 +01:00
2017-10-16 17:16:20 +02:00
2017-10-16 17:16:20 +02:00
2017-10-16 17:16:20 +02:00
2017-10-16 17:16:20 +02:00
2017-12-08 21:07:05 +01:00
2017-11-09 16:56:39 +01:00
2017-10-16 20:19:56 +02:00
2017-10-17 11:24:57 -07:00
2017-10-17 11:24:57 -07:00
2017-10-17 11:24:57 -07:00
2017-10-16 17:16:20 +02:00
2017-10-21 15:13:04 -05:00
2017-10-16 17:16:20 +02:00
2017-10-16 17:16:20 +02:00
2017-10-18 22:20:37 +11:00
2017-10-31 19:08:26 +01:00
2017-03-13 21:57:50 +08:00
2016-11-23 22:46:57 -08:00
2017-10-30 23:36:06 +01:00
2017-11-06 17:08:14 +01:00
2017-10-16 17:16:20 +02:00
2017-10-27 12:53:11 +02:00
2017-10-18 22:20:37 +11:00
2017-10-16 17:16:20 +02:00
2017-10-18 22:20:37 +11:00
2017-10-18 22:20:37 +11:00
2017-10-16 20:19:56 +02:00
2017-10-16 20:19:56 +02:00
2017-10-18 22:20:37 +11:00
2017-11-02 15:12:35 +01:00
2017-10-16 17:16:20 +02:00
2017-10-18 22:20:37 +11:00
2017-10-16 17:16:20 +02:00
2017-10-18 22:20:37 +11:00
2017-02-24 01:50:51 +01:00
2017-10-18 22:20:37 +11:00
2017-10-18 22:20:37 +11:00
2017-11-13 14:58:06 +01:00
2017-11-13 14:58:06 +01:00
2017-10-16 17:16:20 +02:00
2017-10-18 22:20:37 +11:00
2017-10-16 17:16:20 +02:00
2017-11-09 16:56:39 +01:00
2017-11-30 16:18:57 +00:00
2017-10-16 17:16:20 +02:00
2017-10-18 22:20:37 +11:00
2017-11-01 20:45:22 +00:00
2017-10-16 17:16:20 +02:00
2017-10-16 17:16:20 +02:00
2017-10-30 23:36:06 +01:00
2017-10-18 22:20:37 +11:00
2017-11-22 14:06:27 -08:00
2017-11-23 17:19:57 +01:00
2017-09-01 11:54:09 +02:00
2017-10-16 17:16:20 +02:00