Commit graph

21127 commits

Author SHA1 Message Date
Emilio Cobos Álvarez
ff41f82720 style: Fix Gecko and Servo builds, and appease tidy. 2019-03-27 14:29:28 +01:00
Emilio Cobos Álvarez
f9ce3a9da2 style: Honor browser.display.use_document_fonts again.
Differential Revision: https://phabricator.services.mozilla.com/D24218
2019-03-27 14:29:27 +01:00
Emilio Cobos Álvarez
f637d93fc1 style: Remove bindings.rs.
I kept it building the most straight-forward way possible (pub use) because it
seems to me that bindings is not a bad name, and we should probably move
structs.rs to be bindings.rs rather than the other way around.

But that's a different bug in any case, need to think more about it.

Differential Revision: https://phabricator.services.mozilla.com/D24713
2019-03-27 14:29:27 +01:00
Emilio Cobos Álvarez
ecda72a5fd style: Cleanup refcounted types.
And make the handling of ComputedStyle more similar to these.

Differential Revision: https://phabricator.services.mozilla.com/D24703
2019-03-27 14:29:26 +01:00
Emilio Cobos Álvarez
02bc29a11b style: Simplify Owned FFI types.
And make them actually sound. We're defining functions on Rust-land that get
structs as arguments, but declaring them in C++ as getting pointers.

This is another step in order to be able to autogenerate ServoBindings.h and
remove bindings.rs altogether.

We remove FooOwned in favor of Owned<Foo>, which is generated via cbindgen.

It'd be good to actually mark Owned and such as MOZ_MUST_USE_TYPE, so I sent
https://github.com/eqrion/cbindgen/pull/307 for that.

Differential Revision: https://phabricator.services.mozilla.com/D24681
2019-03-27 14:29:25 +01:00
Mats Palmgren
64f19ae34d style: Add support for the 'content' CSS property on ::marker pseudo elements.
Bug: 205202
Reviewed-by: emilio
2019-03-27 14:29:25 +01:00
Mats Palmgren
ab8c00e41a style: Add support for the ::marker pseudo element on list items. Alias :-moz-list-bullet/number to that in the parser.
Bug: 205202
Reviewed-by: emilio
2019-03-27 14:29:24 +01:00
Mats Palmgren
ed74e8acbb style: Implement display:list-item counters using a built-in 'list-item' CSS counter.
Bug: 288704
Reviewed-by: emilio
2019-03-27 14:29:23 +01:00
Mats Palmgren
4f44b1c6b1 style: Add an inherited internal UA sheet property (-moz-list-reversed:true|false) to propagate <ol reversed> to its relevant descendants.
Bug: 288704
Reviewed-by: emilio
2019-03-27 14:29:22 +01:00
Mats Palmgren
4b4b5b6a1d style: Implement the counter-set property.
Bug: 1518201
Reviewed-by: emilio
2019-03-27 14:29:21 +01:00
Emilio Cobos Álvarez
14b176019c style: Simplify a bit our generated bindings by getting rid of FooBorrowed and FooBorrowedMut.
This reduces a lot the boilerplate that's needed in order to add simple binding
functions.

This starts using &Foo and Option<&Foo> instead, and as a result we need to
remove the servo_function_signatures test, which is a bit unfortunate.

I think it's worth though, this causes problems on some platforms (see bug
1534844), and messing up the functions signature is not something that I've ever
seen (other than bug 1308234, which already had all the FooBorrowed mess which
I'm removing).

Also, cbindgen understands references and Option<&Foo>, so it will be the way to
go in the future.

After this patch we can also remove HasSimpleFFI, but I've kept it for now since
I still use it in a few places, and this patch is quite big on its own.

Differential Revision: https://phabricator.services.mozilla.com/D24092
2019-03-27 14:29:19 +01:00
Cameron McCormack
d4635f1d12 style: Use horizontal metrics for ch in vertical mixed/sideways writing modes and for ex always.
Differential Revision: https://phabricator.services.mozilla.com/D23426
2019-03-27 14:29:18 +01:00
Cameron McCormack
d5f208e18c style: Allow FontMetricsProvider to produce ex height and zero width independently.
We are always able to produce an x height, but depending on whether the
glyph exists, we sometimes can't produce a zero glyph width.

Differential Revision: https://phabricator.services.mozilla.com/D23424
2019-03-27 14:29:17 +01:00
Emilio Cobos Álvarez
39df092bce style: fix some rust-nightly warnings about unused doc comments.
Differential Revision: https://phabricator.services.mozilla.com/D24287
2019-03-27 14:29:16 +01:00
Emilio Cobos Álvarez
cf5a2acdf1 style: Remove ComputedStyle::mBits.
Use the Servo flags instead.

Differential Revision: https://phabricator.services.mozilla.com/D20729
2019-03-27 14:29:16 +01:00
Emilio Cobos Álvarez
ed4a23eccf style: Keep track of whether a style is affected by font metrics.
Differential Revision: https://phabricator.services.mozilla.com/D20728
2019-03-27 14:29:15 +01:00
Boris Chiou
fe7b3a6b11 style: Part 6: Add individual transform properties into compositor animation list.
Now, its time to let individual transform run on the compositor thread.

Differential Revision: https://phabricator.services.mozilla.com/D22566
2019-03-27 14:29:14 +01:00
Emilio Cobos Álvarez
01e0f37861 style: Make the will-change bitfield use cbindgen.
Differential Revision: https://phabricator.services.mozilla.com/D23414
2019-03-27 14:29:12 +01:00
Emilio Cobos Álvarez
6e2643c636 style: Use cbindgen for touch-action.
And rename the constants to not be prefixed by TOUCH_ACTION_, since that's part
of the type name anyway.

Differential Revision: https://phabricator.services.mozilla.com/D23413
2019-03-27 14:29:11 +01:00
Emilio Cobos Álvarez
b0af565656 style: Use cbindgen for text-decoration-line.
Differential Revision: https://phabricator.services.mozilla.com/D23412
2019-03-27 14:29:10 +01:00
Emilio Cobos Álvarez
4b07af2240 style: Make cssPropertySupportsType take an enum.
Differential Revision: https://phabricator.services.mozilla.com/D22427
2019-03-27 14:29:09 +01:00
Emilio Cobos Álvarez
d3f254d2e4 style: Make all font-metrics-affecting properties cascade early.
And make font-size computation work on the whole font of the parent, not just
accounting for the parent's font-size.

Differential Revision: https://phabricator.services.mozilla.com/D20656
2019-03-27 14:29:08 +01:00
Emilio Cobos Álvarez
aa5ea337da style: Try to bring some more sanity into our font code.
It's not very easy to understand on its current state, and it causes subtle bugs
like bug 1533654.

It could be simpler if we centralized where the interactions between properties
are handled. This patch does this.

This patch also changes how MathML script sizes are tracked when scriptlevel
changes and they have relative fonts in between.

With this patch, any explicitly specified font-size is treated the same (being a
scriptlevel boundary), regardless of whether it's either an absolute size, a
relative size, or a wide keyword.

Relative lengths always resolve relative to the constrained size, which allows
us to avoid the double font-size computation, and not give up on sanity with
keyword font-sizes.

I think given no other browser supports scriptlevel it seems like the right
trade-off.

Differential Revision: https://phabricator.services.mozilla.com/D23070
2019-03-27 14:29:07 +01:00
Emilio Cobos Álvarez
77a75596bb style: Don't call PrefillDefaultForGeneric when inheriting font-family.
This is the low-risk fix for this issue, that we should get into 67.

What's going on here is that font-family is tracked via the font list, from the
POV of the style system the font list is generally just the
RefPtr<SharedFontList>, but in Gecko there's also mDefaultGenericId.

The way we end up with the right mDefaultGenericId is fishy at best, bogus at
worst. I left various fixmes over time related to a bunch of this code.

After my patch, we end up with a mDefaultGenericId of serif, rather than the
right one (none).

The parent font always has none because nsLayoutUtils::ComputeSystemFont always
sets it to none if the font is known.

Before my patch, PrefillDefaultForGeneric with aGenericId of none (from the
parent), which makes it the default generic id for the current language, serif
in this case.

Before my optimization, apply_declaration_ignoring_phase called
copy_font_family_from, which resets both the font list _and_ the default
generic.

This patch achieves the same effect by not having the first mutation in the
first place.

This code is still terribly fishy in any case, all the _skip_font_family stuff
is just ridiculous. I'll try to clean up a bit after this, but for 68.

Differential Revision: https://phabricator.services.mozilla.com/D23026
2019-03-27 14:29:07 +01:00
Emilio Cobos Álvarez
9f4643ac24 style: Avoid crashing when calling insertRule("@import ...") on a detached sheet.
This should unblock the fuzzers for now, though it's not the ideal solution.

It's the only reasonably easy solution to unblock them though, I think.

We should probably always keep track of the document a stylesheet was associated
with. We'll need that for constructible stylesheets anyway.

That requires some though on how to get the cycle-collection and such right,
though, and I wouldn't be able to write or land that ASAP.

Differential Revision: https://phabricator.services.mozilla.com/D23584
2019-03-27 14:29:06 +01:00
Emilio Cobos Álvarez
95ee1a5adf style: Use a single RestyleHint representation.
Differential Revision: https://phabricator.services.mozilla.com/D22828
2019-03-27 14:29:05 +01:00
Emilio Cobos Álvarez
8dbf9b1da9 Bug 1535084 - Cleanup contain property. r=dholbert
Now that cbindgen supports bitflags, this is trivial.

Differential Revision: https://phabricator.services.mozilla.com/D23371
2019-03-27 14:29:05 +01:00
bors-servo
5da1de6a3e
Auto merge of #23102 - servo:rustup, r=Manishearth
Upgrade to rustc 1.35.0-nightly (4c27fb19b 2019-03-25)

<!-- 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/23102)
<!-- Reviewable:end -->
2019-03-27 01:35:41 -04:00
bors-servo
3c27dc993d
Auto merge of #23097 - Manishearth:transforms, r=asajeffrey
Properly support transforms in WebXR

Still need to test this

There are also a bunch of fixmes that I should get to in this PR.

<!-- 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/23097)
<!-- Reviewable:end -->
2019-03-27 00:05:03 -04:00
Manish Goregaokar
2e62805578 Allow unused 2019-03-26 14:33:50 -07:00
bors-servo
2e0191b839
Auto merge of #23080 - jdm:sampling-profiler, r=gterzian
Add a sampling profiler

This uses the code already built for the background hang monitor and adds the ability to repeatedly sample all monitored threads. This sampling allows us to generate profiles that we can translate into the format used by https://perf-html.io/, allowing us to benefit from modern Gecko performance tooling.

You can run Servo with `PROFILE_OUTPUT=foo.json` and `SAMPLING_RATE=50` (for example), otherwise these values will default to `samples.json` and 10ms, respectively. To activate the profiler, press cmd+p, and to stop profiling, press cmd+p again. This will the captured samples to be symbolicated, which will take a very long time, and eventually there will be a new JSON profile in the output location.

To create a profile for use by Gecko's tools, run `python etc/profilicate.py path/to/profile.json >gecko_profile.json`, and load `gecko_profile.json` in the https://perf-html.io/ to see something like [this](https://profiler.firefox.com/public/8137e2b11fbb92afb80090bc534fd83015c87ee6/calltree/?globalTrackOrder=0-1&thread=1&v=3);

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #13103
- [x] These changes do not require tests because way too many pieces to automate

<!-- 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/23080)
<!-- Reviewable:end -->
2019-03-26 16:36:19 -04:00
Josh Matthews
aee2974c33 Add unit test for sampling profiler. 2019-03-26 16:35:52 -04:00
Josh Matthews
8b7244f0d1 Support multiprocess in sampling profiler. 2019-03-26 16:35:10 -04:00
Josh Matthews
90f67c11e5 Add a sampling profiler and a script to generate profiles for use with Gecko tooling. 2019-03-26 16:35:08 -04:00
Manish Goregaokar
240b5e7c97 Clean up trace impls 2019-03-26 12:58:52 -07:00
bors-servo
7b8a898ac2
Auto merge of #23095 - jdm:mozjsprofiling, r=jdm
Use mozjs profiling feature when building with frame pointer enabled

This makes it possible to get more meaningful profiles with #23080.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix part of #23081
- [x] There are no 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/23095)
<!-- Reviewable:end -->
2019-03-26 14:00:56 -04:00
bors-servo
93d21ce976
Auto merge of #23094 - georgeroman:update_event_timestamp, r=jdm
Update Event's timestamp

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

<!-- 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. -->

<!-- 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/23094)
<!-- Reviewable:end -->
2019-03-26 12:32:33 -04:00
bors-servo
d484e66c45
Auto merge of #23085 - hundredeir:dom_content_loaded#22994, r=jdm
Defer update of dom_content_loaded_event_end

Set it's value only after the "DOMContentLoaded" event is really fired

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

<!-- 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/23085)
<!-- Reviewable:end -->
2019-03-26 11:06:49 -04:00
Simon Sapin
389e69bafe Upgrade to rustc 1.35.0-nightly (4c27fb19b 2019-03-25) 2019-03-26 15:12:55 +01:00
bors-servo
cd374f0aa8
Auto merge of #23002 - paulrouget:padding, r=jdm
Fix bleeding in FxR by adding Padding support to ServoSurface

Not ready for review, just need to make sure the CI is happy for now.

<!-- 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/23002)
<!-- Reviewable:end -->
2019-03-26 09:16:01 -04:00
hundredeir
1a5e7b7cfb Defer update of dom_content_loaded_event_end
Set it's value only after the "DOMContentLoaded" event is really fired
2019-03-26 14:54:37 +05:30
George Roman
e63de4d52c Update Event's timestamp 2019-03-26 09:39:07 +02:00
Manish Goregaokar
4f128e47e5 Add XRRigidTransform::Inverse 2019-03-26 00:09:15 -07:00
Manish Goregaokar
6fda2f28a6 Precompute XRRigidTransform's matrices 2019-03-26 00:09:15 -07:00
Manish Goregaokar
77e857891a Fix xrviewport.height 2019-03-26 00:09:15 -07:00
Manish Goregaokar
2e48606569 Compute view matrix from viewer pose 2019-03-26 00:09:15 -07:00
bors-servo
25aa6501d2
Auto merge of #22699 - Manishearth:render_state, r=jdm
Update XR code to support null layers and new spec changes

Last time we landed an incomplete PR (https://github.com/servo/servo/pull/22649) that corrected the promise model but left XR sessions in panicky states.

This updates the code to not panic all the time, and also includes changes from https://github.com/immersive-web/webxr/pull/458

r? @jdm

<!-- 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/22699)
<!-- Reviewable:end -->
2019-03-25 18:48:49 -04:00
Manish Goregaokar
d1d8e97c30 Add XRSpace::get_viewer_pose() 2019-03-25 15:35:20 -07:00
Josh Matthews
896aae1c14 Add mozjs feature for profiling. 2019-03-25 16:13:56 -04:00
Manish Goregaokar
1e1f527c82 Formatting changes 2019-03-25 11:38:20 -07:00