Commit graph

23559 commits

Author SHA1 Message Date
bors-servo
7d66871a9f
Auto merge of #26046 - mrobinson:arcrefcell-hoisting, r=SimonSapin
layout_2020: Use ArcRefCell to track hoisted fragments

This avoids the use of lookup tables for containing blocks when
constructing the stacking context tree.

This seems to catch some laid-out hoisted fragments that were otherwise
dropped in the previous design. The changes cause one new test to pass
and one to fail. Visual examination of the failing tests reveals that
it's a progression (list markers are appearing when they were previously
not rendered).

<!-- 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 #___ (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-27 12:20:08 -04:00
bors-servo
a927f1ad8a
Auto merge of #25998 - jdm:vao-drop, r=nox
Avoid a panic when closing webgl pages using VAOs

- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #25891
- [x] These changes do not require tests because GC behaviour at shutdown is nondeterministic and difficult to test
2020-03-27 09:55:12 -04:00
Martin Robinson
19f4b708b3 layout_2020: Use ArcRefCell to track hoisted fragments
This avoids the use of lookup tables for containing blocks when
constructing the stacking context tree.

This seems to catch some laid-out hoisted fragments that were otherwise
dropped in the previous design. The changes cause one new test to pass
and one to fail. Visual examination of the failing tests reveals that
it's a progression (list markers are appearing when they were previously
not rendered).
2020-03-27 13:02:22 +01:00
bors-servo
4dbe3b30cd
Auto merge of #26037 - mrobinson:arcrefcell-fragment-tree, r=SimonSapin
layout_2020: Use ArcRefCell in the fragment tree

This will allow mutability which is useful for things like animations.

<!-- 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 they should not change 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-26 10:23:23 -04:00
bors-servo
0ed0c0d9f0
Auto merge of #26029 - paulrouget:uitask, r=jdm
Set user interactions for tasks

fix #26026

I need help here. Retrieving the interaction flag from the promise handle crashes.

```rust
let interaction = GetPromiseUserInputEventHandlingState(promise);
```

```
Stack trace for thread "ScriptThread PipelineId { namespace_id: PipelineNamespaceId(1), index: PipelineIndex(1) }"
stack backtrace:
   0: backtrace::backtrace::libunwind::trace
             at /Users/paul/.cargo/git/checkouts/backtrace-rs-96ebaf1bcb788384/91a0aa4/src/backtrace/libunwind.rs:86
      backtrace::backtrace::trace_unsynchronized
             at /Users/paul/.cargo/git/checkouts/backtrace-rs-96ebaf1bcb788384/91a0aa4/src/backtrace/mod.rs:66
   1: <servo::backtrace::Print as core::fmt::Debug>::fmt
             at ports/glutin/backtrace.rs:49
   2: <&mut W as core::fmt::Write>::write_fmt
   3: std::io::Write::write_fmt
             at /rustc/45ebd5808afd3df7ba842797c0fcd4447ddf30fb/src/libstd/io/mod.rs:1427
   4: servo::backtrace::print
             at ports/glutin/backtrace.rs:17
   5: servo::install_crash_handler::handler
             at ports/glutin/main2.rs:68
   6: <unknown>
   7: _ZN2JS37GetPromiseUserInputEventHandlingStateENS_6HandleIP8JSObjectEE
             at /Users/paul/.cargo/git/checkouts/mozjs-fa11ffc7d4f1cc2d/2392ebc/mozjs/js/src/vm/JSObject.h:106
```
2020-03-26 09:15:00 -04:00
Paul Rouget
5621c887fd Propagate user interacting flag to timers and promises 2020-03-26 08:36:57 +01:00
bors-servo
a9965db69f
Auto merge of #26005 - jdm:hubs-csp, r=nox
Update content-security-policy.

This allows hubs.mozilla.org to load instead of panicking due to unimplemented CSP features.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #24702
- [x] These changes do not require tests because we never enabled the CSP testsuite
2020-03-25 13:33:23 -04:00
Martin Robinson
7cb0069be5 layout_2020: Use ArcRefCell in the fragment tree
This will allow mutability which is useful for things like animations.
2020-03-25 17:57:17 +01:00
Josh Matthews
19216627d3 Update content-security-policy. 2020-03-25 09:11:09 -04:00
bors-servo
4f5110f34f
Auto merge of #26021 - paulrouget:revertFillText, r=jdm
Revert fillText()

Sadly, fillText crashes our HoloLens demos. See https://github.com/servo/servo/issues/26015

/cc @kaiakz
2020-03-24 08:14:24 -04:00
Paul Rouget
40f6cd87d4 Revert "Add a simple implementation of CanvasRenderingContext2d.fillText"
Windows crash: https://github.com/servo/servo/issues/26015
2020-03-24 10:35:52 +01:00
bors-servo
8b4d7c41ae
Auto merge of #26017 - humancalico:remove_legacy, r=jdm
Removed createTouch and createTouchList

<!-- 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 #25978
<!-- 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-24 01:38:31 -04:00
Akshat Agarwal
2e1009da75 Removed createTouch and createTouchList 2020-03-24 03:41:42 +05:30
bors-servo
fcb99ae017
Auto merge of #26016 - servo:jdm-patch-36, r=SimonSapin
Force alert message to its own line.

This should avoid timeouts in WPT caused by output that looks like:
```
 │ 0:00:00.542631465 10817 0x7f9ccc161630 WARN                 playbin gstplaybin2.c:4663:autoplug_select_cb:<playbin> Could not activate sink oss4sink
  │ ALSA lib confmisc.c:767:(parse_card) ALERT: RESULT: ["/html/semantics/embedded-content/media-elements/event_pause_noautoplay.html",0,null,null,[["audio events - pause",0,null,null],["video events - pause",0,null,null],["calling play() then pause() on non-autoplay audio should trigger pause event",0,null,null],["calling play() then pause() on non-autoplay video should trigger pause event",0,null,null]]]
  │ cannot find card '0'
```
2020-03-23 14:14:15 -04:00
bors-servo
acd14672e1
Auto merge of #25888 - ferjm:text.decoration.2020, r=nox
Partial text decoration support for layout 2020

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #25166
- [X] There are tests for these changes
2020-03-23 11:18:18 -04:00
Josh Matthews
2aa415a3ff
Force alert message to its own line. 2020-03-23 11:08:42 -04:00
bors-servo
8bd3429069
Auto merge of #26012 - mrobinson:scrolling-overflow-cb, r=nox
layout_2020: Use the containing block more when calculating scrolling overflow

When calculating scrolling overflow calculation we cannot currently use
the actual containing block in all cases. This change increases the
amount that we do use the 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: -->
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because they should not change 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-23 08:36:56 -04:00
Fernando Jiménez Moreno
17948f3b39 Propagate text decoration where needed 2020-03-23 11:13:10 +01:00
Fernando Jiménez Moreno
83fc9943d3 Do not use buggy text_decorations_in_effect 2020-03-23 11:10:44 +01:00
Fernando Jiménez Moreno
689b413bde Add support for text-decoration-style 2020-03-23 11:10:44 +01:00
Fernando Jiménez Moreno
928bd0d1d2 Add support for text-decoration-color 2020-03-23 11:10:44 +01:00
Fernando Jiménez Moreno
107af9e769 Render text-decoration: line-through on layout 2020 2020-03-23 11:10:44 +01:00
Fernando Jiménez Moreno
c87a4dd788 Remove unnecessary fragment rect clone 2020-03-23 11:10:44 +01:00
Fernando Jiménez Moreno
4fd5484e1a Render text-decoration: overline on layout 2020 2020-03-23 11:10:44 +01:00
Fernando Jiménez Moreno
48517bd61a Render text-decoration: underline on layout 2020 2020-03-23 11:10:44 +01:00
Fernando Jiménez Moreno
e3b97730fe Enable text-decoration on layout 2020 2020-03-23 11:10:44 +01:00
Fernando Jiménez Moreno
e3c8597ccb Store required font metrics on TextFragment 2020-03-23 11:10:44 +01:00
Martin Robinson
811c08c5a5 layout_2020: Use the containing block more when calculating scrolling overflow
When calculating scrolling overflow calculation we cannot currently use
the actual containing block in all cases. This change increases the
amount that we do use the containing block.
2020-03-23 10:08:04 +01:00
YUAN LYU
3ea6d87bcc
Add trait DomObjectWrap to provide WRAP function 2020-03-20 22:16:56 -04:00
Tipowol
6b0b90767e Add missing same-origin referrer policy 2020-03-20 21:15:52 +01:00
Josh Matthews
3a3397fbce webgl: Ignore webgl communication errors when dropping vertex array objects. 2020-03-19 23:34:26 -04:00
bors-servo
d9c84b74cd
Auto merge of #25988 - mrobinson:fix-doc, r=SimonSapin
layout_2020: Fix a documentation comment

I inadvertently failed to complete this doc comment.

<!-- 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 they don't change 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 14:40:03 -04:00
bors-servo
ffdb83b644
Auto merge of #25782 - kaiakz:master, r=jdm
Add a simple implementation of CanvasRenderingContext2d.fillText

<!-- Please describe your changes on the following line: -->
I added a simple implementation of CanvasRenderingContext2d.fillText.
Some code are merged from @mikrut, and I fixed a bug about text scaling.
Also, the bug of text rotation should be fixed after `raqote` merged my other PR.

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

<!-- 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-19 13:24:08 -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
0d0ac986b7 Add a simple implementation of CanvasRenderingContext2d.fillText 2020-03-19 15:40:14 +08: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
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
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
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
8ce971dd90
Auto merge of #25970 - jdm:hirup, r=asajeffrey
Update rustc to 3/16 nightly.
2020-03-16 17:57:45 -04:00
Josh Matthews
a555e7443b Update rustc to 3/16 nightly. 2020-03-16 13:34:50 -04:00