Commit graph

32232 commits

Author SHA1 Message Date
paavininanda
87e7b1ee7a Correct default selectionStart and selectionEnd 2018-02-23 02:37:11 +05:30
paavininanda
b517410a34 Revert "Correct default Selectionstart and SelectionEnd"
This reverts commit b2c1f89b93.
2018-02-23 01:55:21 +05:30
bors-servo
16bd067c6c
Auto merge of #20086 - servo:jdm-patch-6, r=aneeshusa
Add debug output to doc build.

This should narrow down the cause of https://github.com/servo/servo/issues/17243.

<!-- 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/20086)
<!-- Reviewable:end -->
2018-02-22 14:36:17 -05:00
bors-servo
9c484452c0
Auto merge of #20068 - paavininanda:autocloseworker, r=jdm
added AutoCloseWorker for closing related workers when a page/another worker is closed.

<!-- Please describe your changes on the following line: -->
Followed steps as suggested in issue.
Error is not yet resolved!

---
<!-- 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 #17977 (https://github.com/servo/servo/issues/17977?).

<!-- Either: -->
- [x] These changes do not require tests because it will have manual test case.

<!-- 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/20068)
<!-- Reviewable:end -->
2018-02-22 13:34:55 -05:00
bors-servo
267f9db314
Auto merge of #20106 - jdm:font-thread-shutdown-debug, r=emilio
Add font cache debugging to isolate cause of IPC failures in CI.

This should help us better understand the actual underlying cause of frequent CI failures like #13509. In particular, we will be able to state with confidence whether an IPC message is being dropped while the font cache thread is still alive, or whether the dropped sender was in a message that was in the queue after the font cache thread was shutdown.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] There are tests for these changes

<!-- 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/20106)
<!-- Reviewable:end -->
2018-02-22 12:41:15 -05:00
Josh Matthews
8d3b8753ef Add font cache debugging to isolate cause of IPC failures in CI. 2018-02-22 11:51:03 -05:00
bors-servo
f6463c89d5
Auto merge of #20051 - jonleighton:prevent-invalid-selections, r=jdm
Disallow mutating the internals of TextInput

The TextInput::assert_ok_selection() method is meant to ensure that we
are not getting into a state where a selection refers to a location in
the control's contents which doesn't exist.

However, before this change we could have a situation where the
internals of the TextInput are changed by another part of the code,
without using its public API. This could lead to us having an invalid
selection.

I did manage to trigger such a situation (see the test added in this
commit) although it is quite contrived. There may be others that I
didn't think of, and it's also possible that future changes could
introduce new cases. (Including ones which trigger panics, if indexing
is used on the assumption that the selection indices are always valid.)

The current HTML specification doesn't explicitly say that
selectionStart/End must remain within the length of the content, but
that does seems to be the consensus reached in a discussion of this:

https://github.com/whatwg/html/issues/2424

The test case I've added here is currently undefined in the spec which
is why I've added it in tests/wpt/mozilla.

<!-- 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/20051)
<!-- Reviewable:end -->
2018-02-22 11:47:40 -05:00
Nupur Baghel
36991b9d79 added autoclose worker 2018-02-22 21:34:53 +05:30
Josh Matthews
0fc667fcee
Use more periods. 2018-02-22 10:58:07 -05:00
bors-servo
f48dce120d
Auto merge of #20021 - jonleighton:lazy-font-group, r=mbrubeck,glennw
Lazy load fonts in a FontGroup

The first commit message explains this so I'll just copy it here:

---

This is a step towards fixing #17267. To fix that, we need to be able to
try various different fallback fonts in turn, which would become
unweildy with the prior eager-loading strategy.

Prior to this change, FontGroup loaded up all Font instances, including
the fallback font, before any of them were checked for the presence of
the glyphs we're trying to render.

So for the following CSS:

    font-family: Helvetica, Arial;

The FontGroup would contain a Font instance for Helvetica, and a Font
instance for Arial, and a Font instance for the fallback font.

It may be that Helvetica contains glyphs for every character in the
document, and therefore Arial and the fallback font are not needed at
all.

This change makes the strategy lazy, so that we'll only create a Font
for Arial if we cannot find a glyph within Helvetica. I've also
substantially refactored the existing code in the process and added
some documentation along the way.

---

I've added some tests in the second commit, but it required quite a bit of gymnastics to make it possible to write such a test. I'm not sure if the added complexity to the production code is worth it?

On the other hand, having this infrastructure in place may be useful for testing future changes in this area, and also possibly brings us a step closer to extracting a library as discussed in #4901. (What I mean by that is: it reduces coupling between `FontCacheThread` and `FontContext` -- the latter would have a place in such a library, the former wouldn't.)

<!-- 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/20021)
<!-- Reviewable:end -->
2018-02-22 10:49:52 -05:00
Jon Leighton
e4acb3f77f Add test for FontContext/FontGroup functionality
Unfortunately, this required quite a bit of changes to the non-test
code. That's because FontContext depends on a FontCacheThread, which in
turn depends on a CoreResourceThread and therefore lots of other data
structures.

It seemed like it would be very difficult to instantiate a FontContext
as it was, and even if we could it seems like overkill to have all these
data structures present for a relatively focused test.

Therefore, I created a FontSource trait which represents the interface
which FontContext uses to talk to FontCacheThread. FontCacheThread then
implements FontSource. Then, in the test, we can create a dummy
implementation of FontSource rather than using FontCacheThread.

This actually has the advantage that we can make our dummy
implementation behave in certain specific way which are useful for
testing, for example it can count the number of times
find_font_template() is called, which helps us verify that
caching/lazy-loading is working as intended.
2018-02-22 16:36:09 +01:00
Jon Leighton
f22e5ef3bd Lazy load fonts in a FontGroup
This is a step towards fixing #17267. To fix that, we need to be able to
try various different fallback fonts in turn, which would become
unweildy with the prior eager-loading strategy.

Prior to this change, FontGroup loaded up all Font instances, including
the fallback font, before any of them were checked for the presence of
the glyphs we're trying to render.

So for the following CSS:

    font-family: Helvetica, Arial;

The FontGroup would contain a Font instance for Helvetica, and a Font
instance for Arial, and a Font instance for the fallback font.

It may be that Helvetica contains glyphs for every character in the
document, and therefore Arial and the fallback font are not needed at
all.

This change makes the strategy lazy, so that we'll only create a Font
for Arial if we cannot find a glyph within Helvetica. I've also
substantially refactored the existing code in the process and added
some documentation along the way.
2018-02-22 16:36:05 +01:00
Bastien Orivel
606a08479d Update clipboard related dependencies to use xcb 0.8 2018-02-22 15:51:56 +01:00
bors-servo
a0e340d68f
Auto merge of #20083 - yurket:19840_enable_css_pain_api_and_remove_forked_duplicates, r=jdm
enable css paint api and remove forked duplicates

1) Move paintWorklet from "Window" to "CSS" according to new specification;
2) Enable WPT css-paint-api tests from upstream and remove forked duplicates from mozilla folder

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #19840
- [X] These changes do not require tests because the change was made in tests it-selves

<!-- 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/20083)
<!-- Reviewable:end -->
2018-02-22 08:56:49 -05:00
yurket
8d4aa585a6 Adjust paint worklet tests after changing implementation according to new specification 2018-02-22 15:16:27 +03:00
bors-servo
c0d00e9a6a
Auto merge of #20105 - jonleighton:font-template-data-debug, r=emilio
Make FontTemplateData's Debug formatter more concise

Otherwise the log gets spammed with all the individual bytes of the
underlying font file.

<!-- 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/20105)
<!-- Reviewable:end -->
2018-02-22 05:49:30 -05:00
Jon Leighton
799bf87f6d Make FontTemplateData's Debug formatter more concise
Otherwise the log gets spammed with all the individual bytes of the
underlying font file.
2018-02-22 11:45:42 +01:00
yurket
203ff9fd25 Enable css-paint-api WPT tests and remove forked duplicates
wpt tests replace all but 3 tests from forked _mozilla_ tests. These 3 were removed from wpt repo
in commit de7719144e1c7da2ca8d6a543bec428fcfd3c30f, so we can remove all forked _mozilla_
css-paint-api tests
2018-02-22 13:21:41 +03:00
yurket
c7e3def9b2 Move paintWorklet from "Window" to "CSS" according to new specification
Relevant discussion: https://github.com/w3c/css-houdini-drafts/issues/410
2018-02-22 13:21:41 +03:00
bors-servo
5a3bd3955c
Auto merge of #20104 - servo:rm-pointless-abstraction, r=emilio
Replace PositiveIntegerOrAuto by ColumnCount

It was its only use.

<!-- 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/20104)
<!-- Reviewable:end -->
2018-02-22 04:30:58 -05:00
Anthony Ramine
0a3f30fb12 Return an error when animating column-count: auto
This changes the behaviour of animations of `column-count`
(hello Captain Obvious) but this is a bugfix.
2018-02-22 10:23:58 +01:00
Anthony Ramine
761689f32d Replace PositiveIntegerOrAuto by ColumnCount
It was its only use.
2018-02-22 10:16:46 +01:00
bors-servo
9e1479bbdd
Auto merge of #20101 - servo:rm-rootedvec, r=asajeffrey
Remove a use of rooted_vec in Document::handle_touch_event

<!-- 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/20101)
<!-- Reviewable:end -->
2018-02-22 03:36:29 -05:00
bors-servo
363aae6a43
Auto merge of #20103 - servo-wpt-sync:wpt_update_21-02-2018, r=jdm
Sync WPT with upstream (21-02-2018)

Automated downstream sync of changes from upstream as of 21-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/20103)
<!-- Reviewable:end -->
2018-02-22 01:27:08 -05:00
WPT Sync Bot
726b56aa12 Update web-platform-tests to revision e92532746b7615dcccdfa060937a87664816b1db 2018-02-21 21:39:38 -05:00
bors-servo
638b44e0d7
Auto merge of #20102 - hiikezoe:request-restyle-display-changed-from-none, r=emilio,birtles
Request restyle display changed from none for animations

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

https://bugzilla.mozilla.org/show_bug.cgi?id=1439269

<!-- 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/20102)
<!-- Reviewable:end -->
2018-02-21 20:30:29 -05:00
bors-servo
6c93afc8fc
Auto merge of #20088 - mbrubeck:license, r=SimonSapin
Fix license metadata for servo_arc crate

The header in lib.rs states that this library is MIT / Apache-2.0, since it is forked from the Rust standard library.

<!-- 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/20088)
<!-- Reviewable:end -->
2018-02-21 19:35:55 -05:00
Matt Brubeck
568038ca2b Fix license metadata for servo_arc crate
The header in lib.rs states that this library is MIT / Apache-2.0, since
it is forked from the Rust standard library.
2018-02-21 16:35:18 -08:00
Hiroyuki Ikezoe
2559cfd404 Update bindings. 2018-02-22 07:54:32 +09:00
bors-servo
cccca27f4f
Auto merge of #20098 - servo:spurious-raf-optim, r=pcwalton
Avoid dropping arbitrary animation callbacks without running them

<!-- 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/20098)
<!-- Reviewable:end -->
2018-02-21 17:02:35 -05:00
Anthony Ramine
3d46f6749d Remove a use of rooted_vec in Document::handle_touch_event 2018-02-21 22:54:12 +01:00
Hiroyuki Ikezoe
42b0ab77f4 Post DISPLAY_CHANGED_FROM_NONE sequential task if the display property is changed from 'none' in the case the element has script animations 2018-02-22 06:00:07 +09:00
Hiroyuki Ikezoe
6bba9d4dab Add a new sequential task flag for display propery changes from 'none'
Unlike CSS animations/transitions, script animations keep alive on display:none
elements, so once the display property was changed to others in normal
styling, we need to do styling for the script animations in the second
animation traversal.  Otherwise, the styling for the script animations will
be deferred to the next frame.
2018-02-22 06:00:07 +09:00
Hiroyuki Ikezoe
5ba2e874b1 Factor out a new function to check display property is changed from 'none' to other 2018-02-22 06:00:07 +09:00
bors-servo
f90e98dcc9
Auto merge of #20097 - Manishearth:mutate-if-let, r=asajeffrey
Do not mutate if let

<!-- 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/20097)
<!-- Reviewable:end -->
2018-02-21 13:12:45 -05:00
bors-servo
0b4ea018b0
Auto merge of #20034 - Manishearth:table-backgrounds, r=mbrubeck
Handle table cell backgrounds during display list generation for <table>

Fixes #19788

<!-- 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/20034)
<!-- Reviewable:end -->
2018-02-21 12:00:03 -05:00
Anthony Ramine
eb83826c01 Avoid dropping arbitrary animation callbacks without running them 2018-02-21 17:28:12 +01:00
Manish Goregaokar
1fedba81f7 Do not mutate if let 2018-02-21 08:07:30 -08:00
bors-servo
691f3be24a
Auto merge of #20082 - emilio:ignore-existing-styles, r=bholley
style: Cleanup always-false argument to Servo_ResolveStyleLazily.

I changed this setup in https://bugzilla.mozilla.org/show_bug.cgi?id=1414999,
because it was totally unsound.

<!-- 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/20082)
<!-- Reviewable:end -->
2018-02-21 06:09:15 -05:00
bors-servo
554b0c0d06
Auto merge of #20096 - maekawatoshiki:master, r=emilio
Fix typo

<!-- Please describe your changes on the following line: -->
I found some typo, so I fixed them.

---
<!-- 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: -->
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because it's just a fix of typo.

<!-- 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/20096)
<!-- Reviewable:end -->
2018-02-21 04:22:43 -05:00
Manish Goregaokar
285313f3c7 bail early for initial valued backgrounds 2018-02-21 00:36:35 -08:00
bors-servo
a0fff37de3
Auto merge of #20094 - servo-wpt-sync:wpt_update_20-02-2018, r=jdm
Sync WPT with upstream (20-02-2018)

Automated downstream sync of changes from upstream as of 20-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/20094)
<!-- Reviewable:end -->
2018-02-21 01:06:32 -05:00
maekawatoshiki
89797c0868 Fix typo 2018-02-21 14:00:06 +09:00
bors-servo
2c060eb81a
Auto merge of #20081 - emilio:more-longhand-stuff, r=nox
style: More serialization tweaks.

This still doesn't fix everything. In particular, we need to check whether the
subproperty will be enabled in Longhands and LonghandsToSerialize too.

I haven't decided yet on what's the best way to do that.

<!-- 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/20081)
<!-- Reviewable:end -->
2018-02-20 23:49:19 -05:00
bors-servo
036b9d3139
Auto merge of #20095 - servo:jdm-patch-9, r=jdm
Set CARGO_HOME for Windows builders.

This is a temporary fix to allow reopening the tree. This value belongs in saltfs instead, but it's already late and I don't want to have to wait to deploy the changes.

<!-- 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/20095)
<!-- Reviewable:end -->
2018-02-20 22:08:50 -05:00
Josh Matthews
47e0dab42a
Set CARGO_HOME for Windows builders.
This sets it to a directory that all relevant users can manipulate without any issues.
2018-02-20 22:02:01 -05:00
WPT Sync Bot
a57b869a58 Update web-platform-tests to revision 58462b6f92aab3eea03ad1ea70923855889ed1e2 2018-02-20 21:46:54 -05:00
Manish Goregaokar
7de29d0ac4 Update test expectations 2018-02-20 14:00:58 -08:00
Emilio Cobos Álvarez
e47b3b23ab
style: Update bindings. 2018-02-20 21:08:21 +01:00
bors-servo
05b8ba0a48
Auto merge of #20079 - servo:ZEH-INDEX, r=emilio
Replace IntegerOrAuto with ZIndex

It's its only use.

<!-- 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/20079)
<!-- Reviewable:end -->
2018-02-20 12:13:40 -05:00