This is the first part of #10185. More to follow. I have built this locally with both servo and geckolib without errors; let's see if it succeeds on all platforms as well.
Allow setting preferences to false in WPT tests
First patch to servo - apologies if I did something stupid :)
This is a fix for #10161. I have squashed the commits into one.
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10204)
<!-- Reviewable:end -->
Added ability to randomly kill pipelines to the constellation.
Added flags:
* `--random-pipeline-closure-probability`: probability of each event triggering a forced exit of a randomly chosen pipeline.
* `--random-pipeline-closure-seed`: seed to use for the RNG (to remove a source of intermittent failure).
These are designed for testing the hardness of the constellation.
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10179)
<!-- Reviewable:end -->
Add Http Global State Object
This adds a new HttpState object which holds common http state(#10175). This reduces the amount of work that is required to add extra things to the Http state.
The HttpState object currently holds:
```
hsts_list: Arc::new(RwLock::new(HSTSList::new())),
cookie_jar: Arc::new(RwLock::new(CookieStorage::new())),
auth_cache: Arc::new(RwLock::new(HashMap::new())),
```
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10188)
<!-- Reviewable:end -->
Highlight selected text in input fields
Fixes#9993. This does not yet allow stylesheets to set the selection colors; instead it uses a hard-coded orange background and white foreground.
r? @pcwalton
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10176)
<!-- Reviewable:end -->
layout: Rewrite the block formatting context/float inline-size speculation code.
The old code tried to do the speculation as a single bottom-up pass
after intrinsic inline-size calculation, which was unable to handle
cases like this:
<div>
<div style="float: left">Foo</div>
</div>
<div>
<div style="overflow: hidden">Bar</div>
</div>
No single bottom-up pass could possibly handle this case, because the
inline-size of the float flowing out of the "Foo" block could never make
it down to the "Bar" block, where it is needed for speculation.
On the pages I tried, this regresses layout performance by 1%-2%.
I first noticed this breaking some pages, like the Google SERPs, several
months ago.
r? @mbrubeck
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10085)
<!-- Reviewable:end -->
speculation code.
The old code tried to do the speculation as a single bottom-up pass
after intrinsic inline-size calculation, which was unable to handle
cases like this:
<div>
<div style="float: left">Foo</div>
</div>
<div>
<div style="overflow: hidden">Bar</div>
</div>
No single bottom-up pass could possibly handle this case, because the
inline-size of the float flowing out of the "Foo" block could never make
it down to the "Bar" block, where it is needed for speculation.
On the pages I tried, this regresses layout performance by 1%-2%.
I first noticed this breaking some pages, like the Google SERPs, several
months ago.
layout: Allow floats to have negative ceilings due to negative margins.
This fixes `margin-collapse-104.htm`, which is currently accidentally
passing due to lack of #10085. When that PR lands, then that will become
a representative test case.
r? @mbrubeck
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10198)
<!-- Reviewable:end -->
This fixes `margin-collapse-104.htm`, which is currently accidentally
passing due to lack of #10085. When that PR lands, then that will become
a representative test case.
Fix forced repaint on image load
After #10021, `LayoutThread::repaint` no longer forced a repaint because of the `restyle_damage` check. This patch adds the correct restyle damage and fixes#10163.
r? @pcwalton
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10197)
<!-- Reviewable:end -->
After #10021, `LayoutThread::repaint` no longer forced a repaint because of
the `restyle_damage` check. This patch adds the correct restyle damage and
fixes#10163.
geckolib: Add style structs bindings and documentation
See the description of 6c851c8 to see which incorrect bindings remain. They're just nine types.
cc @bholley @SimonSapin @pcwalton
(I don't know who should review this actually)
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10194)
<!-- Reviewable:end -->
Replace hsts_list, auth_cache, and cookie_jar with http_state
Reverted a few changes
Moved http_state back to factory
Removed unnecessary Arc
Removed Arc for http_state
Only 9 tests failing!
```
bindgen_test_layout_FontFamilyList
bindgen_test_layout_StyleAnimation
bindgen_test_layout_nsFont
bindgen_test_layout_nsStyleBackground
bindgen_test_layout_nsStyleDisplay
bindgen_test_layout_nsStyleFont
bindgen_test_layout_nsStyleGridTemplate
bindgen_test_layout_nsStylePosition
bindgen_test_layout_nsStyleSVG
```
The dependencies are:
* FontFamilyList makes nsFont fail which makes nsStyleFont fail.
* nsStyleGridTemplate makes nsStylePosition fail
* StyleAnimation makes nsStyleDisplay fail
nsStyleGridTemplate and nsStyleSVG failures seem to be bitfield-related.
Except the bitfield-related values and those deps, I don't know what
might cause the other failures, we'll have to check carefully C++
member alignments.
This still fails some tests (20 of 130 IIRC).
Most of them are derived from others, and those who arent I think it's
because of:
1. A vtable: Since we don't generate functions I think we don't do the
vtable calculation.
2. Premature opaque structs: It's the case for nsDataHashtable, where
we generate a 0 byte struct, since we calculate it using sizeof() and
the type is not complete without the type parameters.
3. Some other subtlety? I think we miss a case of enum-in-union or
something like that, that is explicitely disabled in bindgen since the C
standard forbids it. I think it can be enabled without too much problem.
Anyways, I'll leave it for tomorrow! \o/
We *do* generate bindings for them, and they compile fine, but the
expected size for them is not correct.
My guess is that C++ types without members have at least 1 byte to be
addressable.
I'll test that later, but for now we don't care about them...