Commit graph

228 commits

Author SHA1 Message Date
WPT Sync Bot
761c8bc2a9 Update web-platform-tests to revision be959408023fe02cf79abe70f6018598a7004a88 2018-06-11 23:36:57 -04:00
WPT Sync Bot
83e2dc11b0 Update web-platform-tests to revision ee82278e15570e573d87fb80179ff8231b6db61a 2018-06-03 22:45:23 -04:00
WPT Sync Bot
46e1e26950 Update web-platform-tests to revision 1829a42c93e435937db68c8a842fa9b56dd39dc2 2018-05-30 22:50:35 -04:00
WPT Sync Bot
e9bdf87a27 Update web-platform-tests to revision 155daf0c385420faf208b8bd5e319e244ec7f9cc 2018-05-28 11:37:21 -04:00
WPT Sync Bot
6b4094e2a4 Update web-platform-tests to revision 314de955a5102650136404f6439f22f8d838e0f4 2018-05-23 22:49:09 -04:00
WPT Sync Bot
24183668c4 Update web-platform-tests to revision 81962ac8802223d038b188b6f9cb88a0a9c5beee 2018-05-18 23:55:46 -04:00
WPT Sync Bot
816185f094 Update web-platform-tests to revision ea14651f262003177d0ba5819bd2806a1327b12a 2018-04-30 23:01:48 -04:00
WPT Sync Bot
7d1071a6a4 Update web-platform-tests to revision 5084587f6b05bf99ad09e7844be66dcc61070cdf 2018-04-26 10:56:37 +02:00
Anthony Ramine
cd2b3017c3 Move shadow stuff to its own test in link-rel-attribute.html 2018-04-24 12:21:18 +02:00
WPT Sync Bot
e891345f26 Update web-platform-tests to revision 4a5223502fa660ce03e470af6a61c8bc26c5a8ee 2018-04-23 23:10:53 -04:00
WPT Sync Bot
0a3e19aac8 Update web-platform-tests to revision 592e2ed83ecd717392d37047536250ba74f1bafa 2018-03-28 22:44:05 -04:00
WPT Sync Bot
2b35c55ac7 Update web-platform-tests to revision d04a8fc02b85bd32799691759c8c05ead07cd939 2018-03-23 22:48:00 -04:00
WPT Sync Bot
db5631a086 Update web-platform-tests to revision e87f38097902e16348d4e17f4fe3bc2d0112bff1 2018-03-17 23:34:27 -04:00
WPT Sync Bot
aa8de380cc Update web-platform-tests to revision 28300a0874230d668f0b02cfddfd994f2a735a56 2018-03-12 23:08:35 -04:00
WPT Sync Bot
f3533538ea Update web-platform-tests to revision 9817f7f027fe1e92cc2fce31d6002c4d669918e8 2018-03-09 08:47:07 -05:00
WPT Sync Bot
4f0af2af66 Update web-platform-tests to revision 9659a35d816ff1b32835a2eccf3e0117dea4e5ce 2018-02-26 22:03:13 -05:00
WPT Sync Bot
726b56aa12 Update web-platform-tests to revision e92532746b7615dcccdfa060937a87664816b1db 2018-02-21 21:39:38 -05:00
WPT Sync Bot
8a6476740e Update web-platform-tests to revision 8fed98324bc133df221d778c62cbff210d43b0ce 2018-02-19 21:42:17 -05:00
WPT Sync Bot
9882351fad Update web-platform-tests to revision 6be7f242bbcec40802cda8f670bbec31570dd077 2018-02-14 21:14:13 -05:00
bors-servo
2b9acb12dd
Auto merge of #20050 - paavininanda:NewTests, r=jdm
Adding left over tests using DRY coding

<!-- Please describe your changes on the following line: -->

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes add the tests using DRY technique to reduce redundant code for https://github.com/servo/servo/pull/19963

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- 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/20050)
<!-- Reviewable:end -->
2018-02-14 15:59:51 -05:00
paavininanda
06f0ad1be7 Adding tests with DRY coding technique 2018-02-15 01:48:48 +05:30
WPT Sync Bot
432648745e Update web-platform-tests to revision 1e4fe87a7f01c0b5c614c8f601ffa68b4a00662a 2018-02-13 21:19:19 -05:00
paavininanda
b2c1f89b93 Correct default Selectionstart and SelectionEnd 2018-02-10 17:46:29 +05:30
WPT Sync Bot
e0fb3fc586 Update web-platform-tests to revision d6d3f7267e817925131675bfc203c62bda96febe 2018-02-07 23:14:20 -05:00
WPT Sync Bot
cd5bf022bd Update web-platform-tests to revision 68a256f49be380ca4add535ce8ece9de28820e6b 2018-02-04 21:05:56 -05:00
Josh Matthews
0e1caebaf4 Update web-platform-tests to revision 10168e9a5d44efbc6e7d416d1d454eb9c9f1396c 2018-01-31 12:24:47 -05:00
Jon Leighton
a8b64aca2a Steps 7-9 of the input type change algorithm
Spec: https://html.spec.whatwg.org/multipage/input.html#input-type-change

In short, this resets the selection to the start of the field when the
type has changed from one which doesn't support the selection API to one
that does.

I couldn't see an existing WPT test covering this.
2018-01-26 20:12:38 +01:00
Jon Leighton
02883a6f54 Fix selection{Start,End} when selectionDirection is "backward"
Per the spec, selectionStart and selectionEnd should return the same
values regardless of the selectionDirection. (That is, selectionStart is
always less than or equal to selectionEnd; the direction then implies
which of selectionStart or selectionEnd is the cursor position.)

There was no explicit WPT test for this, so I added one.

This bug was initially quite hard to wrap my head around, and I think
part of the problem is the code in TextInput. Therefore, in the process
of fixing it I have refactored the implementation of TextInput:

* Rename selection_begin to selection_origin. This value doesn't
  necessarily correspond directly to the selectionStart DOM value - in
  the case of a backward selection, it corresponds to selectionEnd.
  I feel that "origin" doesn't imply a specific ordering as strongly as
  "begin" (or "start" for that matter) does.

* In various other cases where "begin" is used as a synonym for "start",
  just use "start" for consistency.

* Implement selection_start() and selection_end() methods (and their
  _offset() variants) which directly correspond to their DOM
  equivalents.

* Rename other related methods to make them less wordy and more
  consistent / intention-revealing.

* Add assertions to assert_ok_selection() to ensure that our assumptions
  about the ordering of selection_origin and edit_point are met. This
  then revealed a bug in adjust_selection_for_horizontal_change() where
  the value of selection_direction was not maintained correctly (causing
  a unit test failure when the new assertion failed).
2018-01-26 19:50:50 +01:00
Anthony Ramine
7e6290451f Update web-platform-tests to revision ddfc95cf0493ae147a4f6a4d7be8eff1a0c23098 2018-01-18 11:04:13 +01:00
bors-servo
9f2b33c646 Auto merge of #19738 - servo:wptup, r=jdm
Update web-platform-tests

<!-- 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/19738)
<!-- Reviewable:end -->
2018-01-17 13:05:26 -06:00
tigercosmos
b29230bd76 implement range input sanitization 2018-01-17 16:27:21 +08:00
Anthony Ramine
4d3c932c47 Update web-platform-tests to revision c26470dac73f2df9d4822a0d3482f7eb1ebf57d9 2018-01-16 17:18:09 +01:00
Josh Matthews
2b6f573eb5 Update web-platform-tests to revision be5419e845d39089ba6dc338c1bd0fa279108317 2018-01-09 12:52:27 -05:00
tigercosmos
b43424111e implement valid Date time Local input 2018-01-07 18:31:32 +08:00
tigercosmos
54c6028033 implement valid week string 2017-12-17 16:57:01 +08:00
Jon Leighton
71a013dd50 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.

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. I've expanded the tests
   to account for this second case.
2017-12-08 21:07:05 +01:00
tigercosmos
927fd1d044 implement "Date type inputs", "Month type inputs" 2017-12-05 09:44:51 +08:00
bors-servo
eed3adc957 Auto merge of #19379 - SWW13:htmlinput_sanitize_time, r=KiChjang
Implemented sanitize_value for time input

Implemented value sanitization for `<input type=time/>`.
The value has the be valid time string (https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#valid-time-string) or set to empty string.

---

The following test results look expected to me, but I'm not sure:
```
  ▶ Unexpected subtest result in /html/semantics/forms/the-input-element/type-change-state.html:
  │ FAIL [expected PASS] change state from time to text
  │   → assert_equals: input.value should be   foobar   after change of state expected "  foobar  " but got ""
  │ FAIL [expected PASS] change state from time to search
  │   → assert_equals: input.value should be   foobar   after change of state expected "  foobar  " but got ""
  │ FAIL [expected PASS] change state from time to tel
  │   → assert_equals: input.value should be   foobar   after change of state expected "  foobar  " but got ""
  │ FAIL [expected PASS] change state from time to url
  │   → assert_equals: input.value should be foobar after change of state expected "foobar" but got ""
  │ FAIL [expected PASS] change state from time to password
  │   → assert_equals: input.value should be   foobar   after change of state expected "  foobar  " but got ""
  │
  │ @http://web-platform.test:8000/html/semantics/forms/the-input-element/type-change-state.html:53:15
  │ Test.prototype.step@http://web-platform.test:8000/resources/testharness.js:1489:20
  │ test@http://web-platform.test:8000/resources/testharness.js:511:9
  └ @http://web-platform.test:8000/html/semantics/forms/the-input-element/type-change-state.html:37:9

  ▶ Unexpected subtest result in /html/semantics/forms/the-input-element/type-change-state.html:
  │ FAIL [expected PASS] change state from color to time
  │   → assert_equals: input.value should be #000000 after change of state expected "#000000" but got ""
  │
  │ @http://web-platform.test:8000/html/semantics/forms/the-input-element/type-change-state.html:55:15
  │ Test.prototype.step@http://web-platform.test:8000/resources/testharness.js:1489:20
  │ test@http://web-platform.test:8000/resources/testharness.js:511:9
  └ @http://web-platform.test:8000/html/semantics/forms/the-input-element/type-change-state.html:37:9
```

All other tests do now `PASS` instead of `FAIL`.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix *part of* #19172
- [x] There are tests for these changes
  - [x] All tests `PASS`

<!-- 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/19379)
<!-- Reviewable:end -->
2017-12-04 15:44:58 -06:00
Simon Wörner
a999239f28 Added time input sanitization:
- Implemented is_valid_time_string for DOMString.
- Use is_valid_time_string for sanitize_value with time input.
- Improved input type change test
2017-12-04 11:21:28 +01:00
ddh
79d896d474 queue event instead of immediately fire
created checks to see if parser is in use before event dispatch

changed tests to expect crash and added async style test
2017-11-30 16:18:57 +00:00
Jon Leighton
a7a5babb3a Move selection to end when textarea value is assigned
Issue #19171
2017-11-25 16:35:56 +01:00
Bastien Orivel
05c4e08d58 Add a sanitize_value implementation for the color input
I had to change the test a little bit to avoid some failures due to
color and text both having a sanitizedValue which was making the test
use the first assertion instead of the second one in some cases.

The sanitize_value implementation is pretty simple, we iterate over the
content and checks that the content is 7 characters long, that the first
character is a `#` and then that all the following characters are
hexadecimal. If all those requirements are met, we lowercase the
content, otherwise we put `#000000` in it.
2017-11-22 22:36:21 +01:00
Jon Leighton
f290cacccd Refactor selection-start-end test
Move assertions about the initial value of selection{Start,End} to their
own tests. This ensures that when one of these assertions fails, it
doesn't prevent other tests from being defined. Thus we have a clearer
view of which tests are passing or failing, since all tests get defined
regardless of which assertions fail.
2017-11-18 22:33:00 +01:00
Josh Matthews
c227604a2c Update web-platform-tests to revision 44702f2bc8ea98bc32b5b244f2fe63c6ce66d49d 2017-11-15 12:47:30 -05:00
Keith Yeung
8203605c04 Implement value sanitization on HTMLInputElement 2017-11-09 16:34:14 -08:00
Josh Matthews
75736751d9 Update web-platform-tests to revision 14cfa4d648cc1c853b4153268df672d21425f8c1 2017-10-30 18:26:08 -04:00
Josh Matthews
20a833eb75 Update web-platform-tests to revision e03a9b1341ae9bdb1e4fa03765257b84d26fe2f1 2017-10-16 15:03:02 -04:00
Josh Matthews
1f531f66ea Update web-platform-tests to revision 8a2ceb5f18911302b7a5c1cd2791f4ab50ad4326 2017-10-12 12:36:21 -04:00
Josh Matthews
578498ba24 Update web-platform-tests to revision a46616a5b18e83587ddbbed756c7b96cbb4b015d 2017-10-05 00:42:13 +02:00
Anthony Ramine
b47331812a Properly fail in video_008.html 2017-09-29 19:16:37 +02:00