Commit graph

392 commits

Author SHA1 Message Date
Connor Brewster
285d8bb58b style: Move font-weight outside of mako 2017-11-01 11:06:40 -05:00
bors-servo
10227e3cd2 Auto merge of #19051 - CYBAI:moz-script-min-size-no-mako, r=emilio,canaltinova
style: Move font -moz-script-min-size outside of mako

This is a sub-PR for #19015
r? emilio

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #19034 (github issue number if applicable).
- [X] These changes do not require tests because _____

<!-- 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/19051)
<!-- Reviewable:end -->
2017-10-30 15:00:05 -05:00
CYBAI
63cd930fd0 style: Move font -moz-script-min-size outside of mako 2017-10-31 00:44:55 +08:00
Connor Brewster
deb932784e style: Move text-overflow outside of mako 2017-10-27 23:09:05 -05:00
Connor Brewster
122626e46b Move table -x-span outisde of mako 2017-10-27 01:09:57 -05:00
CYBAI
cefc622e9b style: Move -x-text-zoom outside of mako 2017-10-27 02:32:59 +08:00
Emilio Cobos Álvarez
328f142f38
style: Cleanup a bit the scroll-snap-type properties.
Still not perfect, but at least a bit more consistent.
2017-10-25 20:12:37 +02:00
bors-servo
f9f71c7ed1 Auto merge of #19005 - emilio:less-mako-more-joy, r=jdm
style: Move animation-name and animation-iteration-count outside of mako.

<!-- 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/19005)
<!-- Reviewable:end -->
2017-10-24 15:29:21 -05:00
Emilio Cobos Álvarez
d972b07822
style: Move animation-name outside of mako. 2017-10-24 22:28:40 +02:00
Emilio Cobos Álvarez
dc414134bf
style: Move animation-iteration-count outside of mako. 2017-10-24 22:28:34 +02:00
Emilio Cobos Álvarez
fd1e2c1f3f
style: Move background-repeat and mask-repeat outside of mako. 2017-10-24 15:31:11 +02:00
Nicholas Nethercote
4506f0d30c Replace all uses of the heapsize crate with malloc_size_of.
Servo currently uses `heapsize`, but Stylo/Gecko use `malloc_size_of`.
`malloc_size_of` is better -- it handles various cases that `heapsize` does not
-- so this patch changes Servo to use `malloc_size_of`.

This patch makes the following changes to the `malloc_size_of` crate.

- Adds `MallocSizeOf` trait implementations for numerous types, some built-in
  (e.g. `VecDeque`), some external and Servo-only (e.g. `string_cache`).

- Makes `enclosing_size_of_op` optional, because vanilla jemalloc doesn't
  support that operation.

- For `HashSet`/`HashMap`, falls back to a computed estimate when
  `enclosing_size_of_op` isn't available.

- Adds an extern "C" `malloc_size_of` function that does the actual heap
  measurement; this is based on the same functions from the `heapsize` crate.

This patch makes the following changes elsewhere.

- Converts all the uses of `heapsize` to instead use `malloc_size_of`.

- Disables the "heapsize"/"heap_size" feature for the external crates that
  provide it.

- Removes the `HeapSizeOf` implementation from `hashglobe`.

- Adds `ignore` annotations to a few `Rc`/`Arc`, because `malloc_size_of`
  doesn't derive those types, unlike `heapsize`.
2017-10-18 22:20:37 +11:00
Manish Goregaokar
df9d7cd941 stylo: Move font-size stuff to values::*::font 2017-09-23 10:52:07 -07:00
Manish Goregaokar
c2fcc9ce1a stylo: Add keyword info to computed value of font-size 2017-09-23 10:51:21 -07:00
Emilio Cobos Álvarez
2ac1327e4b
style: Make border-spacing serialization consistent, and move it to precomputed_type. 2017-09-17 21:33:17 +02:00
bors-servo
874cb0d9df Auto merge of #18499 - heycam:rule-cache, r=emilio
Rule cache

<!-- Please describe your changes on the following line: -->
This adds a TLS-based cache reset styles structs keyed off rule nodes.  Reviewed in https://bugzilla.mozilla.org/show_bug.cgi?id=1367635 by me and Emilio.

---
<!-- 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
- [ ] 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. -->
2017-09-14 04:28:50 -05:00
Cameron McCormack
1cde26eacb style: Record the property we are computing on computed::Context, if it's a non-inherited one. 2017-09-14 17:13:42 +08:00
Emilio Cobos Álvarez
c34c92e904 style: Add a TLS-based style struct caching mechanism. 2017-09-14 17:13:39 +08:00
bors-servo
097cea240f Auto merge of #18495 - nnethercote:derive-PropertyDeclaration, r=jdm
Measure PropertyDeclaration more thoroughly.

This patch replaces the handwritten MallocSizeOf implementation for
PropertyDeclaration with a derived one, which gives much more thorough
measurement.

This requires (a) deriving MallocSizeOf for a *lot* of additional types (most
of which already have `derive(HeapSizeOf)` in Servo builds), and (b)
implementing MallocSizeOf for a few more types in the `malloc_size_of` crate.

These changes would significantly improve the reporting coverage for gmail if
it weren't for the fact that SpecifiedUrl isn't measured due to a lack of
clarity about its fields; that can be fixed as a follow-up once bug 1397971 has
landed.

<!-- 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 testing is on the 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/18495)
<!-- Reviewable:end -->
2017-09-14 02:10:40 -05:00
Nicholas Nethercote
c5aa2cb986 Measure PropertyDeclaration more thoroughly.
This patch replaces the handwritten MallocSizeOf implementation for
PropertyDeclaration with a derived one, which gives much more thorough
measurement.

This requires (a) deriving MallocSizeOf for a *lot* of additional types (most
of which already have `derive(HeapSizeOf)` in Servo builds), and (b)
implementing MallocSizeOf for a few more types in the `malloc_size_of` crate.

These changes would significantly improve the reporting coverage for gmail if
it weren't for the fact that SpecifiedUrl isn't measured due to a lack of
clarity about its fields; that can be fixed as a follow-up once bug 1397971 has
landed.
2017-09-14 13:18:03 +10:00
bors-servo
bb2030a493 Auto merge of #18494 - frewsxcv:frewsxcv-size-hint, r=jdm
Implement `size_hint` for more iterators.

```
implement size hint for
more iterators because why
not we like fast things
```

<!-- 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/18494)
<!-- Reviewable:end -->
2017-09-13 19:38:32 -05:00
Corey Farwell
9cd4535364 Implement size_hint for more iterators.
```
implement size hint for
more iterators because why
not we like fast things
```
2017-09-13 20:29:27 -04:00
Boris Chiou
a949e2a057 Introduce CSSPixelLength and update NonNegativeLength.
First, we define computed::CSSPixelLength which contains a CSSFloat, a
pixel value, and then we replace computed::Length with CSSPixelLength.
Therefore, the |ComputedValue| of NoCalcLength, AbsoluteLength,
FontRelativeLength, ViewportPercentageLength, CharacterWidth, and
PhysicalLength is CSSPixelLength.

Besides, we drop NonNegativeAu, and replace computed::NonNegativeLength
with NonNegative<computed::Length>. (i.e. NonNegative<CSSPixelLength>)
2017-09-13 18:05:14 +08:00
Anthony Ramine
7c31202dda Implement ToComputedValue for Box<T> 2017-09-12 14:34:16 +02:00
Anthony Ramine
4e64ccde60 Kill ComputedValueAsSpecified 🔫 2017-09-12 14:34:15 +02:00
Anthony Ramine
bf034a83e8 Do not use CVAS for FontSettings<T> 2017-09-12 13:39:55 +02: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
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
Anthony Ramine
6ac5e94f46 Do not use CVAS for the cursor property 2017-09-11 18:41:19 +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
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
a4da2220c1
style: Unify the trivial ToComputedValue implementations, and add impls for i32. 2017-09-11 11:22:23 +02:00
Emilio Cobos Álvarez
862f3b4369
style: Move color to use predefined_type.
I want to play with autogenerating style structs, and color is the smallest
struct out there.

However, moving it out of the mako file is a requirement. This patch does that.
2017-09-04 11:43:50 +02:00
bors-servo
174c37fddd Auto merge of #18301 - servo:derive-all-the-things, r=emilio
Use generics for the vertical-align property

<!-- 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/18301)
<!-- Reviewable:end -->
2017-08-31 09:41:50 -05:00
bors-servo
5624c0e3f1 Auto merge of #18210 - mantaroh:clip-interpolation-fix, r=nox
Skip adding/accumulating ClipRect values which corresponding rect offset is auto.

<!-- Please describe your changes on the following line: -->
This is a PR for https://bugzilla.mozilla.org/show_bug.cgi?id=1390352

This patch will skip adding/accumulating the values which corresponding rect offset is auto, and  make Servo_AnimationValues_ComputeDistance return negative value instead of 0.0 when the function fails to distinguish its failure.

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

<!-- Either: -->
There are already these tests in dom/smil/tests of gecko, this PR will enable these tests.
For detail, see https://bugzilla.mozilla.org/show_bug.cgi?id=1390352.

<!-- 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/17288)
<!-- Reviewable:end -->
2017-08-30 23:21:49 -05:00
Anthony Ramine
542a9337a4 Use generics for the vertical-align property 2017-08-30 23:01:12 +02:00
bors-servo
a266e96d28 Auto merge of #18239 - servo:derive-all-the-things, r=emilio
Refactor how we handle trait bounds in style_derive

<!-- 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/18239)
<!-- Reviewable:end -->
2017-08-28 10:13:13 -05:00
Anthony Ramine
ba4136b5a8 Document how style traits can be derived 2017-08-28 12:26:43 +02:00
Anthony Ramine
3751fe9fdc Derive ToComputedValue for TrackBreadth<L> 2017-08-28 12:26:35 +02:00
Emilio Cobos Álvarez
15e71c5670
style: Don't look for viewport units in stylesheets.
Use whether we've computed any viewport unit instead.

This is more accurate (we avoid restyling unnecessarily if we've found anything
ever on the stylesheet, but that hasn't matched).

This has the benefit of also matching Gecko, and simplify some code and
fishyness around, and also hopefully speeding up stylesheet parsing.
2017-08-28 12:05:22 +02:00
Mantaroh Yoshinaga
8fc7d28758 Skip adding/accumulating the values which corresponding rect offset is auto.
This patch will skip add_weighted() when self_portion + other_portion not equal
to zero. (i.e. adding or accumulating).
Gecko does same behavior since we can't add two auto value.
2017-08-25 10:25:13 +09:00
Clément DAVID
c5fe235112 order derivable traits lists
Ignoring :
 - **generated**.rs
 - python/tidy/servo_tidy_tests/rust_tidy.rs
2017-08-23 21:38:44 +02:00
Anthony Ramine
7ee124b1ed Derive the most trivial Animate impls 2017-08-22 19:12:47 +02:00
Mantaroh Yoshinaga
d5cfa1395b Add ComputeSquaredDistance trait for SvgLengthOrPercentageOrNumber.
Currently, Servo uses ComputeSquaredDistance derive for
SvgLengthOrPercentageOrNumber, so servo can't calculate between
LengthOrPercentage and Number.
This PR will allow calculating these value.
2017-08-22 04:20:12 +09:00
Anthony Ramine
4ebeaa599b Move specified and computed time values to submodules 2017-08-17 00:05:59 +02:00
Anthony Ramine
1bd12bf91a Move specified and computed angles to submodules 2017-08-17 00:01:23 +02:00
Anthony Ramine
796a2b9632 Move specified and computed percentages to submodules 2017-08-14 02:47:43 +02:00
Anthony Ramine
277351da35 Derive ComputeSquaredDistance 2017-08-13 13:34:04 +02:00