Commit graph

40899 commits

Author SHA1 Message Date
bors-servo
19c2ac2ed3
Auto merge of #25985 - mrobinson:inline-positioning-context, r=nox
layout_2020: Add support for hoisting positioned fragments in inline boxes

Add support for tracking containing blocks when doing inline layout.
This requires setting up a PositioningContext for inline boxes when
necessary. Instead of using the PositioningContext helper methods
and we reuse the contexts between line breaks.

Fixes #25279.

<!-- 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 #25279

<!-- 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. -->
2020-03-19 08:12:23 -04:00
Martin Robinson
cc75c6f5d4 layout_2020: Fix a documentation comment
I inadvertently failed to complete this doc comment.
2020-03-19 12:43:01 +01:00
Martin Robinson
bd06227a60 layout_2020: Add support for hoisting positioned fragments in inline boxes
Add support for tracking containing blocks when doing inline layout.
This requires setting up a PositioningContext for inline boxes when
necessary. Instead of using the PositioningContext helper methods
and we reuse the contexts between line breaks.

Fixes #25279.
2020-03-19 10:50:49 +01:00
kaiakz
777b9d791b Update wpt expectations: offscreen-canvas && 2dcontext 2020-03-19 17:16:23 +08:00
bors-servo
b945de4ea9
Auto merge of #25984 - mrobinson:refactor-positioning-context, r=nox
layout_2020: Refactor PositioningContext to be simpler and smaller

Add a few helper methods which allow removing duplicate code in
PositioningContext. These methods will also be used to properly
implement hoisting in inline layout.

<!-- 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 #___ (GitHub issue number if applicable)

<!-- Either: -->
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because this shouldn't change any behavior.

<!-- 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. -->
2020-03-19 04:17:29 -04:00
kaiakz
0d0ac986b7 Add a simple implementation of CanvasRenderingContext2d.fillText 2020-03-19 15:40:14 +08:00
bors-servo
2b0a48f291
Auto merge of #25983 - vbkaisetsu:fix/come-back-21532, r=jdm
Update x11-dl to pickup the fix for x11 startup crash (recurrence of #21530)

This branch updates x11-dl to 2.18.5 to get erlepereira/x11-rs#99

```
% ./mach run --release https://duckduckgo.com
attempted to leave type `std::mem::ManuallyDrop<xlib_xcb::Xlib_xcb>` uninitialized, which is invalid (thread main, at /rustc/45ebd5808afd3df7ba842797c0fcd4447ddf30fb/src/libcore/mem/mod.rs:536)
stack backtrace:
   0: servo::backtrace::print
   1: servo::main::{{closure}}
   2: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:513
   3: rust_begin_unwind
             at src/libstd/panicking.rs:417
   4: core::panicking::panic_fmt
             at src/libcore/panicking.rs:111
   5: core::panicking::panic
             at src/libcore/panicking.rs:54
   6: x11_dl::xlib_xcb::Xlib_xcb::open
   7: winit::platform::platform::x11::xdisplay::XConnection::new
   8: std::sync::once::Once::call_once::{{closure}}
   9: std::sync::once::Once::call_inner
             at src/libstd/sync/once.rs:416
  10: winit::platform::platform::EventsLoop::new_x11
  11: winit::platform::platform::EventsLoop::new
  12: winit::EventsLoop::new
  13: servo::events_loop::EventsLoop::new
  14: servo::app::App::run
  15: servo::main
  16: std::rt::lang_start::{{closure}}
  17: std::rt::lang_start_internal::{{closure}}
             at src/libstd/rt.rs:52
      std::panicking::try::do_call
             at src/libstd/panicking.rs:329
      std::panicking::try::do_try
             at src/libstd/panicking.rs:285
      std::panicking::try
             at src/libstd/panicking.rs:274
      std::panic::catch_unwind
             at src/libstd/panic.rs:394
      std::rt::lang_start_internal
             at src/libstd/rt.rs:51
  18: main
  19: __libc_start_main
  20: _start
Servo exited with return value 101
```

This patch is created by `cargo update -p x11-dl`.

---
<!-- 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 fixes a startup crash

<!-- 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. -->
2020-03-18 23:38:17 -04:00
Koichi Akabe
9f892eb2c2 Update x11-dl to pickup the fix for erlepereira/x11-rs#99 2020-03-19 11:05:12 +09:00
bors-servo
0fef1bfbec
Auto merge of #25981 - servo-wpt-sync:wpt_update_18-03-2020, r=servo-wpt-sync
Sync WPT with upstream (18-03-2020)

Automated downstream sync of changes from upstream as of 18-03-2020.
[no-wpt-sync]
r? @servo-wpt-sync
2020-03-18 08:41:33 -04:00
WPT Sync Bot
bd54acb29d Update web-platform-tests to revision 7d24adef541b2e836f2b2f9534ce3f0e078f5782 2020-03-18 11:05:52 +00:00
Martin Robinson
712f9340e8 layout_2020: Refactor PositioningContext to be simpler and smaller
Add a few helper methods which allow removing duplicate code in
PositioningContext. These methods will also be used to properly
implement hoisting in inline layout.
2020-03-18 11:31:11 +01:00
bors-servo
5bf45b2622
Auto merge of #25957 - pcwalton:layout-2020-atomic-refcell, r=nox
Start using `AtomicRefCell` in layout 2020 as preparation for incremental layout

This makes `BlockLevelBox` and `InlineLevelBox` use `AtomicRefCell` for incremental layout, per @nox's suggestion in https://github.com/servo/servo/issues/25168.

As part of this, it reworks inline layout to use recursion, per https://github.com/servo/servo/issues/25950. LLVM should be able to optimize this into a loop (though I have not verified this).

r? @nox
2020-03-18 06:14:20 -04:00
Patrick Walton
0d6c60f03e Make whitespace preservation computation recursive in order to fix lifetime issues 2020-03-17 20:13:57 -07:00
Patrick Walton
42058681a5 Switch the standard slice iterator in inline layout to a custom one in order to
avoid lifetime problems
2020-03-17 20:13:57 -07:00
Josh Matthews
d4ed646abc
Re-enable windows unit tests. 2020-03-17 14:32:44 -04:00
Josh Matthews
d30e51b779
Copy openssl DLLs to unit test directory. 2020-03-17 14:30:56 -04:00
Patrick Walton
1d9f669cf0 Switch some uses of Arc<AtomicRefCell<T>> over to ArcRefCell<T> 2020-03-17 11:15:17 -07:00
Patrick Walton
5b3f277465 Implement Default for ArcRefCell 2020-03-17 11:15:17 -07:00
Patrick Walton
9cb824e77c Wrap BlockLevelBox and InlineLevelBox with AtomicRefCell 2020-03-17 11:15:17 -07:00
Patrick Walton
2ff776b241 Add an ArcRefCell<T> type 2020-03-17 11:15:17 -07:00
Anthony Ramine
c3932185ec Make AbsolutelyPositionedBox be 'static 2020-03-17 11:15:17 -07:00
Anthony Ramine
7ade924683 Update atomic_refcell
Required for Debug impl on AtomicRefCell<T>.
2020-03-17 11:15:17 -07:00
bors-servo
9fb83d8143
Auto merge of #25964 - servo:webidl, r=jdm
Update the WebIDL parser

It now supports Python 3.
2020-03-17 12:55:26 -04:00
bors-servo
59c68e2eb7
Auto merge of #25975 - mmatyas:webgl_fns_read_draw_buffers_p2, r=jdm
Do not try to read pixels from an FBO without read buffer

A follow up to #25905, this adds another check to the WebGL2 ReadPixels implementation to fix
an OpenGL invalid operation crash when the method is called on a bound framebuffer that has no read buffer.

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

cc @jdm @zakorgy

However, it seems there's an issue with the headless mode: when ReadBuffer is called on the default framebuffer with the value `GL_BACK`, like [here](e1103176e3/tests/wpt/webgl/tests/conformance2/renderbuffers/readbuffer.html (L77)), in headless mode an invalid operation is generated. In non-headless mode the whole test completes successfully:
![sshot](https://user-images.githubusercontent.com/4354863/76845770-b0ffbd80-683f-11ea-8103-a81512188808.png)

---
<!-- 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] There are tests for these changes

<!-- 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. -->
2020-03-17 10:31:01 -04:00
bors-servo
54769a86b9
Auto merge of #25976 - servo-wpt-sync:wpt_update_17-03-2020, r=servo-wpt-sync
Sync WPT with upstream (17-03-2020)

Automated downstream sync of changes from upstream as of 17-03-2020.
[no-wpt-sync]
r? @servo-wpt-sync
2020-03-17 09:59:44 -04:00
WPT Sync Bot
fa876fc660 Update web-platform-tests to revision 74e1fe40eb227423537d6eafa99244ece1a8f8fd 2020-03-17 11:26:41 +00:00
Mátyás Mustoha
a6359fe587 Do not try to read pixels from an FBO without read buffer
Adds another check to the WebGL2 ReadPixels implementation to fix
an OpenGL invalid operation crash when the method is called on a
bound framebuffer that has no read buffer.
2020-03-17 10:55:41 +01:00
bors-servo
e1103176e3
Auto merge of #25972 - servo:jdm-patch-44, r=jdm
Disable running windows binaries on CI.

In order to get more information out of https://github.com/servo/servo/pull/25745, we're going to temporarily disable the parts of windows CI that don't agree with the updated windows server environment.
2020-03-16 22:17:59 -04:00
Josh Matthews
ecdbea518f
Disable running windows binaries on CI. 2020-03-16 20:13:10 -04:00
bors-servo
8ce971dd90
Auto merge of #25970 - jdm:hirup, r=asajeffrey
Update rustc to 3/16 nightly.
2020-03-16 17:57:45 -04:00
bors-servo
fdc725925d
Auto merge of #25967 - paulrouget:devtoolsToast, r=Manishearth
Re-enabling devtools on UWP
2020-03-16 15:38:23 -04:00
Josh Matthews
a555e7443b Update rustc to 3/16 nightly. 2020-03-16 13:34:50 -04:00
bors-servo
654dd048a3
Auto merge of #25905 - szeged:mmatyas__webgl_fns_read_draw_buffers, r=nox
Add support for WebGL2 read and draw buffer settings

Adds support for the `ReadBuffer` and `DrawBuffers` WebGL2 calls and the related parameter getters.

See:

- https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.2
- https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.4
- https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.11

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

This is marked as WIP because with these functions added (but apparently not directly related to them), some tests now run into states that produces crash.

cc @jdm @zakorgy

---
<!-- 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] There are tests for these changes

<!-- 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. -->
2020-03-16 11:43:06 -04:00
bors-servo
d857bec944
Auto merge of #25968 - servo-wpt-sync:wpt_update_16-03-2020, r=servo-wpt-sync
Sync WPT with upstream (16-03-2020)

Automated downstream sync of changes from upstream as of 16-03-2020.
[no-wpt-sync]
r? @servo-wpt-sync
2020-03-16 09:43:08 -04:00
WPT Sync Bot
7b0ebcb83d Update web-platform-tests to revision 4568db58b5528eeb9edf931ab34d83fd6883600f 2020-03-16 13:42:55 +00:00
Paul Rouget
00395125f6 UWP port: re-enable devtools 2020-03-16 13:43:10 +01:00
bors-servo
58ff35f5bf
Auto merge of #25941 - kunalmohan:25907-DevtoolsServer, r=paulrouget
Add support for launching devtools server on random port

In case the default port(6000) or the port specified by user for
devtools server is already taken, random port will be assigned to
it which is reported to the embedding layer for display to user.

r?@jdm @paulrouget

<!-- 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 #25907  (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. -->
2020-03-16 07:22:33 -04:00
Mátyás Mustoha
0afe27ef18 Add support for WebGL2 read and draw buffer settings
Adds support for the `ReadBuffer` and `DrawBuffers`
WebGL2 calls and the related parameter getters.

See:

- https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.2
- https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.4
- https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.11
2020-03-16 12:17:15 +01:00
Kunal Mohan
94db0d61cb
Add support for launching devtools server on random port
Assign random port to devtools server in case user does not specify a
port explicitly and report it to the embedding layer for display to user.
2020-03-16 15:30:26 +05:30
bors-servo
e8e0b70266
Auto merge of #25966 - servo-wpt-sync:wpt_update_15-03-2020, r=jdm
Sync WPT with upstream (15-03-2020)

Automated downstream sync of changes from upstream as of 15-03-2020.
[no-wpt-sync]
r? @servo-wpt-sync
2020-03-15 22:31:24 -04:00
Josh Matthews
8e0cdd334b
Delete intermittent failure. 2020-03-15 21:20:11 -04:00
WPT Sync Bot
4bccffb415 Update web-platform-tests to revision 1ce25e2d4ece2d6ac03739b3cb4f5838d1f94e38 2020-03-15 13:34:57 +00:00
Anthony Ramine
3f30c7d8be Do not do weird scope things in MethodDefiner
Variable `m` comes from a previous list comprehension earlier in the
function is not actually properly defined.
2020-03-14 12:17:48 +01:00
Anthony Ramine
4930479ac8 Update the WebIDL parser
Upstream doesn't allow downloading .tar.gz archives so update.sh was changed
to use unzip.
2020-03-14 12:17:48 +01:00
bors-servo
d43e191449
Auto merge of #25945 - mrobinson:track-hoisted, r=nox
layout_2020: Paint hoisted positioned fragments in tree order

Instead of painting hoisted position fragments in the order to which
they are hoisted, paint them in tree order and properly incorporate them
into the stacking context.

We do this by creating a placeholder fragment in the original tree position
of hoisted fragments. The ghost fragment contains an atomic id which
links back to the hoisted fragment in the containing block.

While building the stacking context, we keep track of containing blocks
and their children. When encountering a placeholder fragment we look at
the containing block's hoisted children in order to properly paint the
hoisted fragment.

One notable design modification in this change is that hoisted fragments
no longer need an AnonymousFragment as their parent. Instead they are
now direct children of the fragment that establishes their containing block.

<!-- 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 #___ (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. -->
2020-03-13 19:15:08 -04:00
bors-servo
5737db81f9
Auto merge of #25940 - pylbrecht:image.handling, r=jdm
Handle nonexistent images in CanvasRenderingContext2D.createPattern()

<!-- 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 part of #25331

<!-- Either: -->
- [x] There are tests for these changes

<!-- 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. -->
2020-03-13 18:01:32 -04:00
bors-servo
a6736de099
Auto merge of #25904 - mmatyas:webgl_fns_framebuf_renderbuf, r=jdm
Add support for some more WebGL2 renderbuffer functions

Adds support for the following WebGL2 calls:

- `RenderbufferStorageMultisample`
- `GetInternalFormativ`

See: https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.5

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

The test results depend on #25903.

cc @jdm @zakorgy

---
<!-- 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] There are tests for these changes

<!-- 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. -->
2020-03-13 16:29:13 -04:00
pylbrecht
3ec848f4a8 Handle nonexistent images in CanvasRenderingContext2D.createPattern() 2020-03-13 20:48:27 +01:00
Josh Matthews
15557df8b5
Don't run 2dcontext tests in layout-2020. 2020-03-13 14:47:14 -04:00
Josh Matthews
6cdbab5581 webgl: Don't panic on sampler3D and sampler2DArray uniforms. 2020-03-13 14:05:34 -04:00