Commit graph

6083 commits

Author SHA1 Message Date
WPT Sync Bot
b524b7c279 Update web-platform-tests to revision 6d85a3b422cab97d032ad3db47cb741ca364185f 2018-02-08 21:30:07 -05:00
dan-robertson
426bd83a0d
Merge branch 'master' into freetype2 2018-02-08 16:59:09 +00:00
bors-servo
aa497bd31b
Auto merge of #19987 - servo-wpt-sync:wpt_update_07-02-2018, r=jdm
Sync WPT with upstream (07-02-2018)

Automated downstream sync of changes from upstream as of 07-02-2018.
[no-wpt-sync]

<!-- 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/19987)
<!-- Reviewable:end -->
2018-02-08 09:21:12 -05:00
WPT Sync Bot
e0fb3fc586 Update web-platform-tests to revision d6d3f7267e817925131675bfc203c62bda96febe 2018-02-07 23:14:20 -05:00
Glenn Watson
0a2ea7381f Update WR (various transform, hit-testing related fixes). 2018-02-08 11:22:03 +10:00
WPT Sync Bot
a4b4c8e015 Update web-platform-tests to revision b7ee88243f64e6c7f2d00c163bd3bc501e4db7ef 2018-02-06 21:05:52 -05:00
Dan Robertson
58d1969c5a Added a test for font selection
The test picks a font and makes a table asking for that font at every
possible weight/stretch combination. One should expect the table
entries to get bolder from right to left and wider from top to bottom.
2018-02-06 20:46:20 +00:00
bors-servo
36eb711d3b
Auto merge of #19946 - paavininanda:Issue18613, r=jdm
Change Offset_to_text_point function and add unit tests

<!-- 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 fix #18613.

<!-- Either: -->
- [x] Added unit tests and web platform tests

<!-- 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/19946)
<!-- Reviewable:end -->
2018-02-06 15:11:54 -05:00
paavininanda
7b58fb5fdd Changed offset_to_text_point function and added unit tests for the same 2018-02-07 01:18:50 +05:30
bors-servo
8f24005e17
Auto merge of #19933 - mrobinson:update-wr, r=emilio
Update WebRender

This allows servo to use the ExternalScrollId API from WebRender fixing
some issues related to duplicate scroll root ids.

Fixes #17176.
Fixes #19287.
Fixes #19648.

<!-- 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
- [ ] These changes fix #17176, #19287, and #19648.

<!-- Either: -->
- [x] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- 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/19933)
<!-- Reviewable:end -->
2018-02-06 09:12:58 -05:00
Martin Robinson
99eb457fc7 Update WebRender
This allows servo to use the ExternalScrollId API from WebRender fixing
some issues related to duplicate scroll root ids.

Fixes #17176.
Fixes #19287.
Fixes #19648.
2018-02-06 15:10:35 +01:00
bors-servo
9faf0cdce5
Auto merge of #19956 - servo:derive-all-the-things, r=emilio
Generate some PropertyDeclaration methods by hand 🐉🐲

We rely on https://github.com/rust-lang/rfcs/pull/2195 to make some enums share the same discriminants by definition.

This fixes https://bugzilla.mozilla.org/show_bug.cgi?id=1428285.

<!-- 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/19956)
<!-- Reviewable:end -->
2018-02-06 08:12:33 -05:00
Anthony Ramine
5195eb38f2 Make all PropertyDeclaration variants have only one field 2018-02-06 13:45:18 +01:00
WPT Sync Bot
210ff0c02a Update web-platform-tests to revision bb1f35100ad0aedeeb6897dd640b360f80498027 2018-02-05 22:35:36 -05:00
WPT Sync Bot
cd5bf022bd Update web-platform-tests to revision 68a256f49be380ca4add535ce8ece9de28820e6b 2018-02-04 21:05:56 -05:00
bors-servo
f84e9236ae
Auto merge of #19929 - terracotaPie:master, r=jdm
Verify that all values in include.ini represent real directories

<!-- Please describe your changes on the following line: -->
wpt manifest(include.ini) contains directories as headers. With this test in **test-tidy** we check if they are present in respective wtp test folders.

---
- [X] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [X] These changes fix #19703

<!-- 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/19929)
<!-- Reviewable:end -->
2018-02-03 22:39:23 -05:00
Timur Borkhodoev
1027644cb6 Remove a expected fail test 2018-02-03 15:52:26 -05:00
Timur Borkhodoev
607306af91 Add update-wpt generated ini 2018-02-02 17:37:19 -05:00
Jon Leighton
f578ec9b70 Enable css-fonts WPT tests
See https://github.com/servo/servo/pull/19928#issuecomment-362354270

Note that some of these tests require you to install the fonts found in
tests/wpt/web-platform-tests/css/fonts.
2018-02-01 22:14:53 +01:00
Timur Borkhodoev
41bf86631b Modify(remove, add) tests in include.ini 2018-02-01 14:29:46 -05:00
bors-servo
a32db10d01
Auto merge of #19921 - servo:jdm-patch-11, r=asajeffrey
test commit for wpt syncing

This is just a test of the automated syncing service.

<!-- 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/19921)
<!-- Reviewable:end -->
2018-02-01 11:14:22 -06:00
Josh Matthews
bce6d59102 test commit for wpt syncing 2018-02-01 11:32:59 -05:00
Jonas Reinwald
d24301b7a0
moved css longhand counter-reset out of mako 2018-02-01 15:43:40 +01:00
Anthony Ramine
bac8781cc7 Kill define_numbered_css_keyword_enum 2018-02-01 12:43:28 +01:00
WPT Sync Bot
ba118104e4 Update web-platform-tests to revision fcc7ecef8ee95ba3776cfa3b1de30101c30432aa 2018-01-31 21:02:57 -05:00
CJ Ku
8a4661b829 Implement Animate trait for individual transforms 2018-01-31 22:15:31 +00:00
CJ Ku
174f5f7128 Implement scale property styling 2018-01-31 22:12:34 +00:00
CJ Ku
de3e8c9a8b Implement translate property styling 2018-01-31 22:12:33 +00:00
CJ Ku
62c0c6feee Implement rotate property styling 2018-01-31 22:12:26 +00:00
Josh Matthews
0e1caebaf4 Update web-platform-tests to revision 10168e9a5d44efbc6e7d416d1d454eb9c9f1396c 2018-01-31 12:24:47 -05:00
bors-servo
469dc84b6e Auto merge of #19031 - cbrewster:push_replace_state_early, r=asajeffrey
Implement initial part of history.state

<!-- Please describe your changes on the following line: -->
Implements maintaining the current history state. Tracking history state in the session history will be done as a followup.

---
<!-- 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
- [ ] These changes fix #__ (github issue number if applicable).

<!-- Either: -->
- [X] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- 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/19031)
<!-- Reviewable:end -->
2018-01-30 14:14:04 -06:00
Connor Brewster
198ea8f767 Implement initial part of history.state 2018-01-30 14:12:37 -06:00
bors-servo
5114d1dee9 Auto merge of #19902 - emilio:quirks-invalidation, r=SimonSapin
style: Fix sheet invalidation in quirks mode documents.

Bug: 1433589

<!-- 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/19902)
<!-- Reviewable:end -->
2018-01-30 09:10:17 -06:00
Emilio Cobos Álvarez
125f275b5a
style: Fix sheet invalidation in quirks mode documents.
Bug: 1433589
2018-01-30 16:08:53 +01:00
Rakhi Sharma
d47ce855ce Implement HTMLPictureElement interface. 2018-01-29 20:27:54 -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
ce7bae8834 Implement setRangeText API
Spec: https://html.spec.whatwg.org/multipage/#dom-textarea/input-setrangetext

In order to do this, we need to define the SelectionMode enum in WebIDL:
https://html.spec.whatwg.org/multipage/#selectionmode

Since the enum is used by HTMLTextAreaElement and HTMLInputElement, it
doesn't seem to make sense to define it in the WebIDL file for one or
other of those.

However, we also can't create a stand-alone SelectionMode.webidl file,
because the current binding-generation code won't generate a "pub mod
SelectionMode;" line in mod.rs unless SelectionMode.webidl contains
either an interface or a namespace. (This logic happens in
components/script/dom/bindings/codegen/Configuration.py:35, in the
Configuration.__init__ method.)

I thought about changing the binding-generation code, but that seems
difficult. So I settled for placing the enum inside
HTMLFormElement.webidl, as that seems like a "neutral" location. We
could equally settle for putting it under HTMLTextAreaElement or
HTMLInputElement, it probably doesn't really matter.

The setRangeText algorithm set the "dirty value flag" on the
input/textarea. I made some clean-ups related to this:

1. HTMLTextAreaElement called its dirty value flag "value_changed"; I
   changed this to "value_dirty" to be consistent with the spec.

2. HTMLInputElement had a "value_changed" field and also a "value_dirty"
   field, which were each used in slightly different places (and
   sometimes in both places). I consolidated these into a single
   "value_dirty" field, which was necessary in order to make some of the
   tests pass.

TextControl::set_dom_range_text replaces part of the existing textinput
content with the replacement string (steps 9-10 of the algorithm). My
implementation changes the textinput's selection and then replaces the
selection. A downside of this approach is that we lose the original
selection state from before the call to setRangeText. Therefore, we have
to save the state into the original_selection_state variable so that we
can later pass it into TextControl::set_selection_range. This allows
TextControl::set_selection_range to correctly decide whether or not to
fire the select event.

An alternative approach would be to implement a method on TextInput
which allows a subtring of the content to be mutated, without touching
the current selection state. However, any such method would potentially
put the TextInput into an inconsistent state where the edit_point and/or
selection_origin is a TextPoint which doesn't exist in the content. It
would be up to the caller to subsequently make sure that the TextInput
gets put back into a valid state (which would actually happen, when
TextControl::set_selection_range is called).

I think TextInput's public API should not make it possible to put it
into an invalid state, as that would be a potential source of bugs.
That's why I didn't take this approach. (TextInput's public API does
currently make it possible to create an invalid state, but I'd like to
submit a follow-up patch to lock this down.)
2018-01-26 20:12:33 +01:00
Jon Leighton
e34f7c58c9 Don't fire select event when selection hasn't changed 2018-01-26 19:50:53 +01:00
Jon Leighton
648bfbeb02 Fix clearing the selection when value is changed
The implementation of adjust_horizontal_to_limit() is written with UI in
mind. As such, when there's a selection and we "adjust horizontal", the
selection will be cleared and the cursor will and up at the start/end of
the previous selection. This is what happens when you have a selection
and you press an arrow key on your keyboard, but it isn't the behaviour
we want when programmatically changing the value.

Instead, we need to first clear the selection, and then move the cursor
to the end. (We also need to reset the selection direction when clearing
the selection.)
2018-01-26 19:50:52 +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
Jon Leighton
0148e9705b Support the select() method on input/textarea
Issue #19171
2018-01-26 19:50:45 +01:00
bors-servo
c9ba16f9fb Auto merge of #19868 - CYBAI:specific-assertion, r=emilio
Use specific assertions

Similar to #19865
r? jdm

Note: Should I squash all the commits into one commit?

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes do not require tests because it should not break anything

<!-- 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/19868)
<!-- Reviewable:end -->
2018-01-25 18:06:33 -06:00
bors-servo
a2fca92881 Auto merge of #19849 - gterzian:update_wpt, r=jdm
WPT tests: Remove custom cache script, use trickle option instead

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

Follow up on https://github.com/servo/servo/pull/19350 @jdm

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [ ] `./mach build -d` does not report any errors
- [ ] `./mach test-tidy` does not report any errors
- [ ] These changes fix #__ (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- 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/19849)
<!-- Reviewable:end -->
2018-01-25 14:38:11 -06:00
CYBAI
9c7ff219d7 Use specific assertion for unit tests style viewport 2018-01-26 01:30:30 +08:00
CYBAI
9755e3b606 Use specific assertion for unit tests logical geometry 2018-01-26 01:19:01 +08:00
bors-servo
9c13073075 Auto merge of #19688 - Manishearth:linebreak, r=mbrubeck
Detect adjoining text fragments with no line break opportunity between them

First attempt at https://github.com/servo/servo/issues/874

<!-- 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/19688)
<!-- Reviewable:end -->
2018-01-24 22:42:59 -06:00
Jon Leighton
84713df622 Allow floats to impact list item marker position
Although not required by the specification, this matches the rendering
of Gecko and Blink.

Fixes #19796.
2018-01-24 12:26:32 +01:00
Manish Goregaokar
f3c81fcda8 Share line breaking state across text runs
Fixes #874
2018-01-24 12:51:33 +05:30
Gregory Terzian
3ce7c868d7 remove custom cache script, use trickle option instead 2018-01-24 14:26:38 +08:00
bors-servo
4307b6e67b Auto merge of #19350 - gterzian:ignore_aborted_responses_in_caching, r=jdm
Ignore aborted responses in caching

<!-- Please describe your changes on the following line: -->
@jdm @KiChjang @Manishearth Follow up on https://github.com/servo/servo/pull/18676 and https://github.com/servo/servo/pull/19274 to ignore aborted responses in caching.

I also found out the cache shouldn't return any response whose body is still in `ResponseBody::Receiving` mode, because that fails the assertion at https://github.com/servo/servo/blob/master/components/net/fetch/methods.rs#L438(we might want to add a channel as pat of the cached response later on to deal with this case). I only found out now because I needed the response from the server to trickle in so that it could be cached and aborted.

I copied the `http-cache.py` server from the wpt folder, and added a 'trickle' option, which is necessary to actually have a failing test with a cached but aborted request, it's now passing.

I also remove one unused import that slippled through previously.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [ ] `./mach build -d` does not report any errors
- [ ] `./mach test-tidy` does not report any errors
- [ ] These changes fix #__ (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- 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/19350)
<!-- Reviewable:end -->
2018-01-23 14:47:16 -06:00