Commit graph

24220 commits

Author SHA1 Message Date
Josh Matthews
b39955df67 Update webrender. 2020-06-11 14:07:39 -04:00
bors-servo
264b4344fb
Auto merge of #26854 - jdm:wr-err, r=SimonSapin
Don't panic in canvas thread if webrender isn't reachable

This fixes a regression from #26823. This method is only used by the css paint worklet API, and the caller handles a communication error on the channel correctly.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #26853
- [x] There are tests for these changes
2020-06-11 04:06:47 -04:00
bors-servo
d85c6ee341
Auto merge of #26838 - servo:flexbox, r=nox
Flexbox, the boring parts

I have a local branch starting to implement https://drafts.csswg.org/css-flexbox/#layout-algorithm. It’s not PR-ready yet, but it’s going to be large so here are some of the less interesting parts meaningful by themselves. Landing the module split in particular will help reduce merge conflicts.

CC https://github.com/servo/servo/issues/26639
2020-06-10 17:19:16 -04:00
bors-servo
0367ec2e8b
Auto merge of #26836 - servo:containing-block-writing-mode, r=nox
Use the writing mode of the containing block when accessing CSS properties

… and converting them to flow-relative geometric values.

These values are almost always used to size and position a fragment within its containing block, so using the mode of the containing block seems more correct.

Note that the `writing-mode` and `direction` properties are disabled in Servo at the moment, so this PR by itself should have no effect: the writing mode of an element is always the same of that of its containing block since they’re both horizontal rtl.
2020-06-10 16:20:22 -04:00
bors-servo
9e528b8124
Auto merge of #26806 - mrobinson:animations-cascade, r=emilio
Include animations and transitions in the cascade

Instead of applying animations and transitions to styled elements,
include them in the cascade. This allows them to interact properly with
things like font-size and !important rules.

<!-- 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] 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-06-10 14:14:03 -04:00
Martin Robinson
af0bb1f728 animations: Don't always re-resolve the node style
When animations and transitions change don't always re-resolve node
style, just replace the animation and transition rules and re-cascade.
2020-06-10 17:03:58 +02:00
Josh Matthews
55fee1fb35 canvas: Don't panic if webrender isn't reachable. 2020-06-10 10:40:28 -04:00
bors-servo
60ee588c71
Auto merge of #26793 - paulrouget:prefAPI, r=Manishearth
Pref api

Needs a bit more tweaking, but this should be ready soon.

Fix #26445

<img width="991" alt="Screen Shot 2020-06-03 at 14 59 57" src="https://user-images.githubusercontent.com/373579/83848819-b538ca00-a70e-11ea-9da8-67c9c2fe60d8.png">
2020-06-10 03:46:21 -04:00
Paul Rouget
479afcfb8e Embedding API: prefs r/w 2020-06-10 09:38:13 +02:00
Simon Sapin
08f008a011 Use the writing mode of the containing block when accessing CSS properties
… and converting them to flow-relative geometric values.

These values are almost always used to size and position a fragment within its containing block, so using the mode of the containing block seems more correct.

Note that the `writing-mode` and `direction` properties are disabled in Servo at the moment, so this PR by itself should have no effect: the writing mode of an element is always the same of that of its containing block since they’re both horizontal rtl.
2020-06-10 09:03:18 +02:00
Simon Sapin
dd0d6a2a6f Split layout_2020/flexbox.rs into modules 2020-06-10 08:43:51 +02:00
Simon Sapin
dcd25a06da Enable (behind a pref) parsing of the flex-* properties 2020-06-10 08:38:36 +02:00
bors-servo
554af02ab4
Auto merge of #26833 - servo:layout-2020-arcrefcell-abspos, r=SimonSapin
Store abspos boxes in a RefCell too

We want to mutate them when lazily computing their content sizes, but they
are behind an Arc for the hoisting infra, so it also needs its own layer
of inner mutability.
2020-06-10 01:33:34 -04:00
bors-servo
0b0ea17dca
Auto merge of #26716 - jdm:selfsigned, r=Manishearth,asajeffrey
Add UI for bypassing SSL handshake failures

There are several parts to these changes:
1. resurrecting the network error classification code to distinguish between SSL failures and other network errors
1. adding an SSL verification callback to support verifying certs against a list that can change at runtime, rather than just at program initialization
1. exposing a privileged chrome://allowcert URI which accepts the PEM cert contents along with a secret token
1. extracting the PEM cert contents out of the network layer when a handshake failure occurs, and getting them into the HTML that is parsed when an SSL failure occurs
1. adding a button in the handshake failure page that performs an XHR to chrome://allowcert with knowledge of the secret token and the PEM cert contents, before reloading the original URL that failed

The presence of the secret token means that while the chrome://allowcert URL is currently visible to web content, they cannot make use of it to inject arbitrary certs into the verification process.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #26683
- [x] These changes do not require tests because the UI requires user activation and can't clearly be automated
2020-06-09 21:59:09 -04:00
bors-servo
7eacfa4f0d
Auto merge of #26823 - jdm:single-renderapi, r=asajeffrey
Update webrender

These changes reflect changes in webrender's API that make RenderApiSender and RenderApi objects more challenging to share. This PR moves us to a model where:
* the compositor owns the main RenderApi object
* other threads that need to create transactions or manipulate fonts proxy those operations to the compositor (script/layout use IPC, while other threads use non-IPC channels)
* the webgl thread owns its own independent RenderApi
2020-06-09 19:34:08 -04:00
Josh Matthews
c8692d83ab net: Add unit test for accepting a self-signed cert. 2020-06-09 18:29:39 -04:00
Josh Matthews
2550600131 net: Use a POST request for allowing certs temporarily. 2020-06-09 16:51:21 -04:00
Josh Matthews
125bfceafd script: Don't panic when IPC WebRender APIs fail during shutdown. 2020-06-09 15:52:03 -04:00
Josh Matthews
6a6662195e net: Add option to temporarily accept certs that failed the handshake. 2020-06-09 15:03:18 -04:00
Josh Matthews
433c154595 net: Allow SSL websockets to use dynamic list of certs as well. 2020-06-09 15:03:18 -04:00
Josh Matthews
0ce2aa917a net: Pass certs that fail the SSL handshake out of the network layer. 2020-06-09 15:03:18 -04:00
Josh Matthews
1cdaf40eb2 net: Add an SSL verification callback to support checking a dynamic list of certs. 2020-06-09 15:03:18 -04:00
Josh Matthews
b7a640b517 net: Treat SSL handshake errors differently from other hyper errors. 2020-06-09 15:03:18 -04:00
bors-servo
cb4e3cb16a
Auto merge of #26758 - jdm:stacking-context-transform-zero, r=mrobinson
Don't create empty stacking contexts in display lists

A recent change to euclid exposed that our display lists can contain Rects that contain NaN values. These NaNs originate from creating stacking contexts with transforms that scale the horizontal or vertical dimensions to 0. WebRender isn't prepared to handle these, so we need to not produce these empty stacking contexts when building the display list.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #26592 and fix #26590
- [x] There are tests for these changes
2020-06-09 13:37:30 -04:00
Josh Matthews
abc689e034 Remove unecessary webrender document from layout. 2020-06-09 13:05:16 -04:00
Josh Matthews
75efaa95f5 Proxy all WR interactions for layout/font/script/canvas threads to the compositor
thread. There is now a single RenderApi that is used, and all transactions are serialized
through the compositor.
2020-06-09 13:05:16 -04:00
Josh Matthews
56ff8f41e0 layout2020: Don't create stacking contexts for empty fragments and boxes. 2020-06-09 11:30:17 -04:00
Josh Matthews
08427ccee5 layout: Don't built stacking contexts or display lists for empty blocks. 2020-06-09 11:27:23 -04:00
bors-servo
8e3d12bfcb
Auto merge of #26794 - gterzian:update_xhr, r=jdm
Update XHR send to use XMLHttpRequestBodyInit

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

FIX #26723

---
<!-- 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. -->
2020-06-09 10:25:11 -04:00
Anthony Ramine
e975d24c4b Store abspos boxes in a RefCell too
We want to mutate them when lazily computing their content sizes, but they
are behind an Arc for the hoisting infra, so it also needs its own layer
of inner mutability.
2020-06-09 15:13:18 +02:00
Anthony Ramine
d9e87f2eb1 Mutably borrow to do layout of independent formatting contexts
We want to compute content sizes on demand rather than eagerly so we will
need to mutate the independent formatting contexts that own the content sizes.
2020-06-09 13:44:43 +02:00
Martin Robinson
364235ac0c Include animations and transitions in the cascade
Instead of applying animations and transitions to styled elements,
include them in the cascade. This allows them to interact properly with
things like font-size and !important rules.
2020-06-09 11:41:07 +02:00
bors-servo
0645d8c36d
Auto merge of #26805 - mrobinson:add-pseudo-tag-to-layout-2020, r=SimonSapin
layout_2020: Tag fragments with their pseudo content type

This will allow us to answer queries and properly handle animations in
the future for fragments generated for pseudo content.

<!-- 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] 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-06-06 13:26:19 -04:00
Martin Robinson
89855afa4d layout_2020: Tag fragments with their pseudo content type
This will allow us to answer queries and properly handle animations in
the future for fragments generated for pseudo content.
2020-06-06 17:25:08 +02:00
bors-servo
00b57b4fd9
Auto merge of #26792 - servo:static-mut, r=nox
Replace `static mut` with `const`, `static`+`AtomicPtr`, or `static`+`UnsafeCell`

Fixes https://github.com/servo/servo/issues/26550
2020-06-05 09:56:41 -04:00
Martin Robinson
b875f14e86 Better computation of animation keyframes
This begins to address #26625 by properly applying CSS variables during
keyframe computation and no longer using `apply_declarations`. Instead,
walk the declarations, combining them into IntermediateComputedKeyframe,
maintaining declarations that modify CSS custom properties. Then compute
a set of AnimationValues for each keyframe and use those to produce
interpolated animation values.
2020-06-05 13:40:29 +02:00
Martin Robinson
83fa1b9eaa Cache animation computed values when animations change
Instead of recalculating the animation style every tick of an animation,
cache the computed values when animations change. In addition to being
more efficient, this will allow us to return animation rules as property
declarations because we don't need to consult the final style to produce
them.
2020-06-05 13:21:19 +02:00
Gregory Terzian
dc690653da update XHR send to use XMLHttpRequestBodyInit 2020-06-05 15:08:57 +08:00
bors-servo
bce6eccced
Auto merge of #26790 - jdm:fewer-generics, r=SimonSapin
Reduce scope of generic code in script

Combined, these changes account for almost 100k lines of generated code in a debug build for the script crate.

---
- [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
2020-06-04 20:55:08 -04:00
Josh Matthews
a5d0e0b1c1 Extract some thread local use from generic code. 2020-06-04 20:54:36 -04:00
Josh Matthews
ec0b5d55d7 Move thread state checks out of generic methods to reduce generated code duplication. 2020-06-04 20:54:36 -04:00
Josh Matthews
6dc4488bc7 Remove unnecessary generic from private_from_proto_check. 2020-06-04 20:54:36 -04:00
bors-servo
98fe360390
Auto merge of #26788 - servo:energy, r=jdm
Remove support for energy and heartbeats profiling

Both are disabled by default (energy at compile-time, heartbeats with a run-time option). Neither is tested of CI. Neither has been used in a long time. They might have Undefined Behavior: https://github.com/servo/servo/issues/26550#issuecomment-634238098. They each depend on a mostly-unmaintained C library. The thread-safety expectation of those libraries are unknown.
2020-06-04 19:29:46 -04:00
bors-servo
59ec134bb8
Auto merge of #26789 - CYBAI:svgelement-style, r=jdm
Introduce ElementCSSInlineStyle for SVGElement

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #26777 and fix #26032 and fix #21990
- [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-06-04 18:27:13 -04:00
Simon Sapin
dbdc44215b Use UnsafeCell instead of static mut in background_hang_monitor/sampler_linux.rs 2020-06-05 00:11:37 +02:00
Simon Sapin
57d89675b0 Use atomic pointers instead of static mut for DOM proxy handlers 2020-06-05 00:11:37 +02:00
Simon Sapin
3367db6067 Keep DOM proxy handlers as separate named items rather than in one array 2020-06-05 00:11:37 +02:00
Simon Sapin
b282bd3a44 Remove support for heartbeats profiling 2020-06-04 22:53:56 +02:00
bors-servo
e2d980a071
Auto merge of #26480 - CYBAI:missing-on, r=jdm
Prefix `on` for function name of inline events

While checking what needs to be done for the spec-update, I've noticed the logic of checking `is window-reflecting element (e.g. body and frameset)` is already handled by the `is` casting function.

However, we still failed to pass the tests because we're missing `on` prefix for inline functions.

I'm not sure if this patch is good enough (or maybe at least I need to add a comment for why adding `on` prefix?).

Besides, I checked [how Gecko handles](https://searchfox.org/mozilla-central/rev/8bc4e35c9bb47c1fe3131e6155d9f482e1efef9a/dom/events/EventListenerManager.cpp#1012-1022) and looks like they also just pass the atom directly.
But, the [generated atom](https://searchfox.org/mozilla-central/source/__GENERATED__/xpcom/ds/nsGkAtomList.h#775) is prefixed with `on` which is correct to just pass it into the `CompileFunction`.

---
<!-- 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 #26479
- [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-06-04 16:45:22 -04:00
bors-servo
5f6a05e715
Auto merge of #26771 - atouchet:raqote, r=jdm
Update raqote and associated dependencies

<!-- 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: -->
- [ ] `./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. -->
2020-06-04 13:45:36 -04:00