Commit graph

6718 commits

Author SHA1 Message Date
Emilio Cobos Álvarez
d30c5e16b2
style: remove unused Longhand::has_uncacheable_values.
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-09-17 04:31:17 +02:00
Emilio Cobos Álvarez
e3f4471ab7
style: Kill longhand::depend_on_viewport_size
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-09-17 04:31:16 +02:00
Emilio Cobos Álvarez
15a76b01c1
style: simplify -servo-text-decorations-in-effect.
It's stupid.

Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-09-17 04:31:16 +02:00
Emilio Cobos Álvarez
2c88248b87
style: Kill -servo-under-display-none.
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-09-17 04:31:15 +02:00
Emilio Cobos Álvarez
7d91b30172
style: Depend less on animated_value_type.
It's just redundant, and I plan to do autogenerate all this stuff, and I don't
want redundant stuff in the manifest.

Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-09-17 04:31:15 +02:00
Gecko Backout
1aa0b20e09 Backed out changeset 616bd23b9896 (bug 1391145) for frequently failing mochitests layout/style/test/test_animations.html and layout/style/test/test_animations_omta.html on Linux x64. r=backout
Backs out https://github.com/servo/servo/pull/18492
2017-09-16 13:48:06 +00:00
bors-servo
4c04ece8c5 Auto merge of #18526 - bradwerth:aspectOverflow, r=emilio
Prevent aspect-ratio media queries from causing m…

…ultiplication overflow by extending values to u64.

MozReview-Commit-ID: e4kfxMDvZh

<!-- Please describe your changes on the following line: -->
https://bugzilla.mozilla.org/show_bug.cgi?id=1399941
https://reviewboard.mozilla.org/r/179984/

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

<!-- 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/18526)
<!-- Reviewable:end -->
2017-09-16 04:38:14 -05:00
bors-servo
90689b7916 Auto merge of #18492 - Manishearth:stylo-translate, r=hiikezoe
stylo: Preserve variants of 2d translate/rotate/scale functions in computed transform

Necessary for the animation inspector to show the right thing.

r=hiikezoe https://bugzilla.mozilla.org/show_bug.cgi?id=1391145

fixes bug 1391145

<!-- 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/18492)
<!-- Reviewable:end -->
2017-09-16 03:33:44 -05:00
Bobby Holley
703a5c93d0 Undo #18497 in the MatchAndCascade case.
It's easy to construct examples where not inserting in those cases causes performance
to get worse (for example, any long list of siblings that match the same selectors
while having some non-effectual differences in LocalName/Class/Id/etc). And the LRU
nature of the cache already does the right thing of pruning non-useful entries.

Fixing this causes several hundred more sharing hits on wikipedia.

MozReview-Commit-ID: L7W8vcMnHaq
2017-09-15 23:21:00 -07:00
bors-servo
fac923395e Auto merge of #18511 - mbrubeck:always-be-updating, r=KiChjang
Update to smallbitvec 1.0.6

Includes servo/smallbitvec#2, a performance fix that is useful for Stylo.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes do not require tests because they update external code only

<!-- 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/18511)
<!-- Reviewable:end -->
2017-09-15 21:22:37 -05:00
Emilio Cobos Álvarez
bd314747da
style: Implement the body text color quirk in a more straight-forward way.
This avoids grabbing the document when values that inherit from the body,
whatever that means, aren't under the body.

In that case we'll get a semi-random value, but that's also mishandled by Gecko
anyways (and probably Blink, though haven't tested), and doesn't really make
much sense.
2017-09-16 02:44:56 +02:00
Emilio Cobos Álvarez
920585bd74
style: Remove outdated comment.
That's ran only on elements.
2017-09-16 02:44:55 +02:00
Emilio Cobos Álvarez
1c809b7c04
style: Reformat a few GeckoElement methods. 2017-09-16 02:44:54 +02:00
Emilio Cobos Álvarez
d799dd95eb
style: Trivially reformat a few TElement declarations. 2017-09-16 02:44:53 +02:00
Matt Brubeck
d76639bdcc Update to smallbitvec 1.0.6 2017-09-15 15:44:03 -07:00
Manish Goregaokar
a7a5adb71a stylo: Fix TransformOperation.animate() implementation 2017-09-15 14:36:28 -07:00
Manish Goregaokar
06300999e9 stylo: Preserve the variant of rotate() values in computed transforms
MozReview-Commit-ID: Dmw7P21I6FN
2017-09-15 14:36:27 -07:00
Manish Goregaokar
e74d04c040 stylo: Preserve the variant of scale() values in computed transforms 2017-09-15 14:36:25 -07:00
Gecko Backout
558e357216 Backed out changeset 67769dac78c4 for busting builds CLOSED TREE
Backs out https://github.com/servo/servo/pull/18519
2017-09-15 20:47:46 +00:00
Matt Brubeck
1c23cacdfb Revert "Measure ImageValue objects."
This reverts commit a185393cee (#18515).
2017-09-15 10:53:26 -07:00
Brad Werth
52dc4f438a Bug 1399941 Part 1: Prevent aspect-ratio media queries from causing multiplication overflow by extending values to u64.
MozReview-Commit-ID: e4kfxMDvZh
2017-09-15 10:34:35 -07:00
bors-servo
f1da967ef7 Auto merge of #18521 - servo:cargotest, r=nox
Fix running `cargo test -p stylo_test` from repo root

… in order to add it to Rust CI though https://github.com/rust-lang/rust/blob/master/src/tools/cargotest/main.rs

<!-- 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/18521)
<!-- Reviewable:end -->
2017-09-15 09:43:08 -05:00
Simon Sapin
fc5fd8853e Fix running cargo test -p stylo_test from repo root
… in order to add it to Rust CI though
https://github.com/rust-lang/rust/blob/master/src/tools/cargotest/main.rs
2017-09-15 16:36:47 +02:00
bors-servo
7cc0af37cf Auto merge of #18512 - tromey:preserve-style-sheet-source-url, r=SimonSapin
Preserve sourceURL comment on style sheets

In addition to the sourceMappingURL comment, there is a second special
comment, "sourceURL", that can be used to set the "display name" of a
style sheet for developer tools.  This name is also used as the base
URL for the source-map URL resolution algorithm.  sourceURL is
described here:
https://blog.getfirebug.com/2009/08/11/give-your-eval-a-name-with-sourceurl/
The devtools feature bug is here:
https://bugzilla.mozilla.org/show_bug.cgi?id=880831

This patch changes servo to preserve and expose this value for use in M-C.

---
<!-- 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: -->
- [X] There are tests for these changes OR
- [ ] 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/18512)
<!-- Reviewable:end -->
2017-09-15 08:07:49 -05:00
bors-servo
89d5780570 Auto merge of #18519 - emilio:body-quirk, r=heycam
style: Implement the body text color quirk in a more straight-forward way.

This avoids grabbing the body when values that inherit from the body,
whatever that means, aren't under the body.

In that case we'll get a semi-random value, but that's also mishandled by Gecko
anyways (and probably Blink, though haven't tested), and doesn't really make
much sense.

<!-- 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/18519)
<!-- Reviewable:end -->
2017-09-15 06:37:20 -05:00
bors-servo
70a6b2fa91 Auto merge of #18516 - jdm:stringshare, r=heycam
Share specified URLs with Gecko

This makes use of our Arc offset machinery to allow Gecko to store Arc<String> values and ensure there are used appropriately.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix [bug 1397971](https://bugzilla.mozilla.org/show_bug.cgi?id=1397971).

<!-- 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/18516)
<!-- Reviewable:end -->
2017-09-15 04:05:20 -05:00
Emilio Cobos Álvarez
8c3c56909e
style: Implement the body text color quirk in a more straight-forward way.
This avoids grabbing the document when values that inherit from the body,
whatever that means, aren't under the body.

In that case we'll get a semi-random value, but that's also mishandled by Gecko
anyways (and probably Blink, though haven't tested), and doesn't really make
much sense.
2017-09-15 10:34:42 +02:00
Emilio Cobos Álvarez
04e1f599d8
style: Remove outdated comment.
That's ran only on elements.
2017-09-15 10:28:31 +02:00
Emilio Cobos Álvarez
33fa32ab25
style: Reformat a few GeckoElement methods. 2017-09-15 10:12:16 +02:00
Emilio Cobos Álvarez
91ae73a9bd
style: Trivially reformat a few TElement declarations. 2017-09-15 10:12:15 +02:00
bors-servo
edff65a3b8 Auto merge of #18509 - emilio:ua-sheet-share-cascade-data, r=SimonSapin
style: Share user agent cascade data across documents.

<!-- 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/18509)
<!-- Reviewable:end -->
2017-09-15 02:43:50 -05:00
Emilio Cobos Álvarez
5be81d04a7
style: Clear the UA cache on shutdown.
MozReview-Commit-ID: KAGdhFb67hq
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-09-15 09:26:25 +02:00
Emilio Cobos Álvarez
cb31e782aa
style: Share user agent cascade data across documents.
MozReview-Commit-ID: KcyuTHD0bt9
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-09-15 09:26:23 +02:00
Josh Matthews
1a57bad2a1 Add Rust APIs for interacting with Arc<String> (bug 1397971). 2017-09-15 02:39:09 -04:00
Emilio Cobos Álvarez
985c6193eb
style: Factor out whether a stylesheet matches all the existing medium-affected-values in CascadeData.
MozReview-Commit-ID: IE6RFiBXZ8s
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-09-15 01:47:12 +02:00
Nicholas Nethercote
a185393cee Measure ImageValue objects.
We have about 11,500 of these when loading gmail in a Stylo-enabled build, from
SpecifiedUrls; the objects themselves account for about 1.3 MiB of memory, and
the strings within them about 2.9 MiB.

We also have a very small number of them on the Gecko side.
2017-09-15 09:43:35 +10:00
bors-servo
49f753523a Auto merge of #18466 - mbrubeck:cache, r=SimonSapin
Bug 1398957 - Make LRUCache use a linked list to reduce memmoves.

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

<!-- 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/18466)
<!-- Reviewable:end -->
2017-09-14 16:48:48 -05:00
bors-servo
75e126f139 Auto merge of #18502 - emilio:ua-sheets-unify, r=simonsapin
style: Unify how servo and Gecko handle UA sheets.

<!-- 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/18502)
<!-- Reviewable:end -->
2017-09-14 15:55:21 -05:00
bors-servo
28b1c3818f Auto merge of #18508 - mstange:add-fsbgc-system-colors, r=emilio
style: Add system colors from bug 1387594.

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

These are the necessary servo changes for https://bugzilla.mozilla.org/show_bug.cgi?id=1387594 .

I'm also re-importing the generated Gecko bindings from my object directory:
 - servo/components/style/gecko/generated/structs_debug.rs
 - servo/components/style/gecko/generated/structs_release.rs

But the number of changes to those files surprises me.

---
<!-- 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're tested by compiling mozilla-central once the patches from https://bugzilla.mozilla.org/show_bug.cgi?id=1387594 land - without this patch, Firefox won't compile.

<!-- 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/18508)
<!-- Reviewable:end -->
2017-09-14 14:20:15 -05:00
Tom Tromey
c48226ff6f Preserve sourceURL comment on style sheets
In addition to the sourceMappingURL comment, there is a second special
comment, "sourceURL", that can be used to set the "display name" of a
style sheet for developer tools.  This name is also used as the base
URL for the source-map URL resolution algorithm.  sourceURL is
described here:
https://blog.getfirebug.com/2009/08/11/give-your-eval-a-name-with-sourceurl/
The devtools feature bug is here:
https://bugzilla.mozilla.org/show_bug.cgi?id=880831

This patch changes servo to preserve and expose this value for use in M-C.
2017-09-14 12:39:18 -06:00
Emilio Cobos Álvarez
0a9309aa96
style: Unify how servo and Gecko handle UA sheets. 2017-09-14 20:33:43 +02:00
Matt Brubeck
286888009f Make LRUCache use a linked list to reduce memmoves.
https://bugzilla.mozilla.org/show_bug.cgi?id=1398957
2017-09-14 11:33:02 -07:00
Markus Stange
82012cbf2b
style: Re-import generated Gecko bindings. 2017-09-14 20:28:14 +02:00
bors-servo
ddf7ad4814 Auto merge of #18415 - jdm:moar-codesize, r=SimonSapin
More codesize reductions for generated code

Bloaty says this shaves off another 20kb from style::properties-based functions. The more limited Debug implementations enable sharing the property name strings between more functions, which saves on code size in the end.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors

<!-- 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/18415)
<!-- Reviewable:end -->
2017-09-14 13:01:00 -05:00
Josh Matthews
d41baf7f5f Share more strings between Debug implementations for property-based types. 2017-09-14 11:52:46 -04:00
Josh Matthews
ecd8abb178 Reduce code duplication in TransitionProperty::from. 2017-09-14 11:52:00 -04:00
bors-servo
2cbd27c83a Auto merge of #18501 - emilio:cascade-data-rebuild, r=nox
style: Move DocumentCascadeData::add_stylesheet to CascadeData.

More plumbing in preparation for isolating the UA stuff.

<!-- 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/18501)
<!-- Reviewable:end -->
2017-09-14 10:49:16 -05:00
Markus Stange
d6380188e9 style: Add system colors from bug 1387594. 2017-09-14 13:43:39 +02:00
bors-servo
9dd0513647 Auto merge of #18498 - upsuper:enum-keyword-exhaustive, r=emilio
Use exhaustive match for cloning keyword value by default for property using enum class

rather than casting them to `u8` then do inexhaustive match.

I don't see why we couldn't do this.

<!-- 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/18498)
<!-- Reviewable:end -->
2017-09-14 06:28:16 -05:00
Emilio Cobos Álvarez
7454006d6c
style: Move DocumentCascadeData::add_stylesheet to CascadeData.
More plumbing in preparation for isolating the UA stuff.
2017-09-14 12:49:10 +02:00