Commit graph

16401 commits

Author SHA1 Message Date
bors-servo
bffe158fa4 Auto merge of #18455 - nnethercote:measure-Arc-Locked-properly, r=jdm
Measure Arc<Locked<T>> fields properly.

Currently when we measure various Arc<Locked<T>> fields we don't measure the T
itself, but only the descendants of the T. This patch fixes this.

This fix requires introducing a new trait, MallocUnconditionalShallowSizeOf,
which is implemented for servo_arc::Arc. A similar trait,
MallocConditionalShallowSizeOf, is also introduced, though it has no uses as
yet.

<!-- 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 are tested in Gecko.

<!-- 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/18455)
<!-- Reviewable:end -->
2017-09-12 08:40:56 -05:00
bors-servo
61fac2c10d Auto merge of #18456 - emilio:dead-code, r=upsuper
style: Remove an unused function.

Nobody will miss it.

<!-- 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/18456)
<!-- Reviewable:end -->
2017-09-12 06:11:58 -05:00
bors-servo
af077a7222 Auto merge of #18420 - servo:toml, r=nox,emilio
Get rustc commit hash from channel manifest

… added in https://github.com/rust-lang/rust/pull/44218, instead of using the GitHub API.

Also upgrade to rustc 1.22.0-nightly (d93036a04 2017-09-07).

<!-- 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/18420)
<!-- Reviewable:end -->
2017-09-12 05:01:24 -05:00
Simon Sapin
0d4168034f Un-inline some methods initializing thread_local! …
… in order to limit stack frame sizes after extra inlining from
https://github.com/rust-lang/rust/pull/43931

See https://github.com/servo/servo/pull/18420#issuecomment-328769322
2017-09-12 11:42:04 +02:00
Emilio Cobos Álvarez
4297630a22
style: Remove an unused function.
Nobody will miss it.
2017-09-12 08:54:40 +02:00
Nicholas Nethercote
779fbda81d Measure Arc<Locked<T>> fields properly.
Currently when we measure various Arc<Locked<T>> fields we don't measure the T
itself, but only the descendants of the T. This patch fixes this.

This fix requires introducing a new trait, MallocUnconditionalShallowSizeOf,
which is implemented for servo_arc::Arc. A similar trait,
MallocConditionalShallowSizeOf, is also introduced, though it has no uses as
yet.
2017-09-12 16:36:28 +10:00
Bobby Holley
8268217767 Avoid memmoving ValidationData more than necessary.
MozReview-Commit-ID: 70w3bZ2FU0W
2017-09-11 22:39:35 -07:00
Bobby Holley
74b4f95d71 Encapsulate the sharing cache backend better.
MozReview-Commit-ID: 2x9BIhmwH83
2017-09-11 22:39:34 -07:00
Bobby Holley
c409c2089c Fix an awful bug in LRUCache::touch().
MozReview-Commit-ID: 3l7L0MfdOxh
2017-09-11 22:39:33 -07:00
Bobby Holley
db67cd1759 Shorten the naming around the style sharing cache.
MozReview-Commit-ID: EcVQDLoxwFP
2017-09-11 22:39:31 -07:00
bors-servo
7f4cb1861b Auto merge of #18452 - nnethercote:bug-1398737, r=jdm
Overhaul MallocSizeOf and related things.

This patch makes the MallocSizeOf stuff in Stylo work more like the HeapSizeOf
stuff already in Servo, except better. In particular, it adds deriving support
for MallocSizeOf, which will make it easier to improve coverage.

The patch does the following.

- Combines servo/components/style/stylesheets/memory.rs and the heapsize crate
  into a new crate, malloc_size_of.

- Forks the heapsize_derive crate, calling it malloc_size_of, so that
  MallocSizeOf can be derived.

- Both the new crates have MIT/Apache licenses, like heapsize, in case they are
  incorporated into heapsize in the future.

- Renames the methods within MallocSizeOf and the related traits so they are
  more concise.

- Removes MallocSizeOfWithGuard.

- Adds `derive(MallocSizeOf)` to a lot of types, in some cases replacing an
  equivalent or almost-equivalent hand-written implementation.

- Adds stuff so that Rc/Arc can be handled properly.

<!-- 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 tested on Gecko side.

<!-- 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/18452)
<!-- Reviewable:end -->
2017-09-11 22:11:25 -05:00
Nicholas Nethercote
32548e5312 Overhaul MallocSizeOf and related things.
This patch makes the MallocSizeOf stuff in Stylo work more like the HeapSizeOf
stuff already in Servo, except better. In particular, it adds deriving support
for MallocSizeOf, which will make it easier to improve coverage.

The patch does the following.

- Combines servo/components/style/stylesheets/memory.rs and the heapsize crate
  into a new crate, malloc_size_of.

- Forks the heapsize_derive crate, calling it malloc_size_of, so that
  MallocSizeOf can be derived.

- Both the new crates have MIT/Apache licenses, like heapsize, in case they are
  incorporated into heapsize in the future.

- Renames the methods within MallocSizeOf and the related traits so they are
  more concise.

- Removes MallocSizeOfWithGuard.

- Adds `derive(MallocSizeOf)` to a lot of types, in some cases replacing an
  equivalent or almost-equivalent hand-written implementation.

- Adds stuff so that Rc/Arc can be handled properly.
2017-09-12 12:37:51 +10:00
bors-servo
f91ea02bf7 Auto merge of #18451 - Manishearth:stylo-calc-fontsize, r=emilio
stylo: Add support for calcs in base size calculation

This tracks an offset along with the ratio for the keyword font size data.
The offset gets used when a calc is involved whilst inheriting font-size
(it is the computed value of that calc ignoring em/percentage portions,
which go into the ratio). If the family or language changes, the new font
size can be computed by taking the keyword's size in the context of that
family/language, multiplying it by the ratio, and adding the offset.

r=emilio https://bugzilla.mozilla.org/show_bug.cgi?id=1380980

<!-- 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/18451)
<!-- Reviewable:end -->
2017-09-11 21:01:57 -05:00
bors-servo
5cc2b4f705 Auto merge of #18447 - servo:kill-cvas, r=emilio
Remove most uses of ComputedValueAsSpecified

<!-- 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/18447)
<!-- Reviewable:end -->
2017-09-11 20:04:12 -05:00
Manish Goregaokar
2db5fbbe56 stylo: Replace FontComputationData with typedef 2017-09-11 17:29:39 -07:00
bors-servo
24b2d8d9cf Auto merge of #18450 - upsuper:property-is-set, r=Manishearth
Use the LonghandIdSet to check whether a property is set

Servo side change of [bug 1398479](https://bugzilla.mozilla.org/show_bug.cgi?id=1398479).

<!-- 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/18450)
<!-- Reviewable:end -->
2017-09-11 18:50:19 -05:00
Manish Goregaokar
6318969269 stylo: Add support for calcs in base size calculation
This tracks an offset along with the ratio for the keyword font size
data. The offset gets used when a calc is involved whilst inheriting
font-size (it is the computed value of that calc ignoring em/percentage
portions, which go into the ratio). If the family or language changes,
the new font size can be computed by taking the keyword's size in the context
of that family/language, multiplying it by the ratio, and adding the
offset.
2017-09-11 16:05:50 -07:00
Manish Goregaokar
1ad9463558 stylo: Add (unused) absolute offset to FontComputationData 2017-09-11 16:05:37 -07:00
Xidorn Quan
d486def53b Use the LonghandIdSet to check whether a property is set 2017-09-12 08:47:26 +10:00
Manish Goregaokar
265483b439 stylo: Round down when computing viewport units 2017-09-11 13:24:35 -07:00
bors-servo
d2b689cf2e Auto merge of #18444 - ferjm:bug1384221.alias.errors, r=jdm
stylo: Fix error reporting for invalid values in property alias

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix [bug 1384221](https://bugzilla.mozilla.org/show_bug.cgi?id=1384221)
- [X] There are [tests](https://bug1384221.bmoattachments.org/attachment.cgi?id=8906527) 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/18444)
<!-- Reviewable:end -->
2017-09-11 12:50:11 -05:00
Fernando Jiménez Moreno
3be7ad8b6f stylo: Fix error reporting for invalid values in property alias 2017-09-11 18:47:12 +02:00
Anthony Ramine
3fb52a0ef9 Do not use CVAS for gecko::SpecifiedUrl 2017-09-11 18:41:22 +02:00
Anthony Ramine
b16c2572a9 Do not use CVAS for the -moz-force-broken-image-icon property 2017-09-11 18:41:21 +02:00
Anthony Ramine
4f36b30e34 Do not use CVAS for the text-decoration-line property 2017-09-11 18:41:20 +02:00
Anthony Ramine
6ac5e94f46 Do not use CVAS for the cursor property 2017-09-11 18:41:19 +02:00
Anthony Ramine
83cddadedc Do not use CVAS for the quotes property 2017-09-11 18:41:17 +02:00
Anthony Ramine
4f61c0d48c Do not use CVAS for the paint-order property 2017-09-11 18:41:16 +02:00
Anthony Ramine
f2b1c6b7cf Do not use CVAS for the -servo-under-display-none property 2017-09-11 18:41:15 +02:00
Anthony Ramine
d27c5954a1 Do not use CVAS for the content property 2017-09-11 18:41:13 +02:00
Anthony Ramine
5e8ee277fc Do not use CVAS for specified::Attr 2017-09-11 18:41:12 +02:00
Anthony Ramine
0254fd0635 Do not use CVAS for the list-style-type property 2017-09-11 18:41:08 +02:00
bors-servo
3cad8d4662 Auto merge of #18446 - bzbarsky:update-cssparser, r=SimonSapin
Update rust-cssparser to 0.20.2.

This reduces memory consumption of list-valued properties in the common case of one entry in the list.

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

<!-- 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/18446)
<!-- Reviewable:end -->
2017-09-11 10:33:24 -05:00
Boris Zbarsky
b2c56345d7 Update rust-cssparser to 0.20.2.
This reduces memory consumption of list-valued properties in the common case of one entry in the list.
2017-09-11 10:55:27 -04:00
bors-servo
e7f45028dc Auto merge of #18431 - mbrubeck:pdb-size, r=SimonSapin
Use SmallBitVec to optimize size of PropertyDeclarationBlock

https://bugzilla.mozilla.org/show_bug.cgi?id=1398322

<!-- 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/18431)
<!-- Reviewable:end -->
2017-09-11 08:57:07 -05:00
Matt Brubeck
a5a0e9ffe8 Use SmallBitVec for important flags in PDB 2017-09-11 06:53:05 -07:00
Matt Brubeck
21006fb752 Use SmallBitVec to replace BitVec 2017-09-11 06:33:43 -07:00
bors-servo
6a09b1d21a Auto merge of #18372 - tigercosmos:userTimingApi, r=ferjm
TEST: fix and add case of po-observe.any.js

<!-- Please describe your changes on the following line: -->
1. implementing step 3 from the [`PerformanceObserver.observe()`](https://w3c.github.io/performance-timeline/#dom-performanceobserver-observe()) method spec properly.
2. also add cases about step 1 & 2

work on the top of #18283

 r? @ferjm
---
<!-- 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 #18285 (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. -->

<!-- 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/18372)
<!-- Reviewable:end -->
2017-09-11 05:26:46 -05:00
Emilio Cobos Álvarez
ba5897adbd
style: Kill a few more CVAS uses in font.mako.rs. 2017-09-11 11:29:34 +02:00
Emilio Cobos Álvarez
b12a34e06e
style: Kill CVAS in image.rs. 2017-09-11 11:29:32 +02:00
Emilio Cobos Álvarez
d1a3cb6d94
style: Get rid of ComputedValueAsSpecified in inherited_text.rs 2017-09-11 11:29:31 +02:00
Emilio Cobos Álvarez
a3bfa5db3e
style: Get rid of a few ComputedValueAsSpecified in grid.
Need Box to remove the macro invocation.
2017-09-11 11:29:30 +02:00
Emilio Cobos Álvarez
4c283fbed6
style: Get rid of ComputedValueAsSpecified for alignment props. 2017-09-11 11:29:29 +02:00
Emilio Cobos Álvarez
64ab73eabd
style: Properly use integers on grid properties, and derive ToComputedValue. 2017-09-11 11:29:27 +02:00
Emilio Cobos Álvarez
02d24061e7
style: Avoid ComputedValueAsSpecified for TrackKeyword. 2017-09-11 11:22:25 +02:00
Emilio Cobos Álvarez
5e136a7a05
style: Get rid of ComputedValueAsSpecified in box.mako.rs. 2017-09-11 11:22:24 +02:00
Emilio Cobos Álvarez
a4da2220c1
style: Unify the trivial ToComputedValue implementations, and add impls for i32. 2017-09-11 11:22:23 +02:00
Emilio Cobos Álvarez
b94dd4885d
style: Derive ToComputedValue for TransitionProperty. 2017-09-11 11:22:22 +02:00
Emilio Cobos Álvarez
84f3073402
style: Avoid ComputedValueAsSpecified in template-areas.
Would need to impl ToComputedValue for Range and Box, which is undoable right
now.
2017-09-11 11:22:21 +02:00
Emilio Cobos Álvarez
5b05aa7c52
style: Derive ToComputedValue in grid properties. 2017-09-11 11:22:20 +02:00