Commit graph

14432 commits

Author SHA1 Message Date
bors-servo
942fce3a0b Auto merge of #17152 - servo:derive-all-the-things, r=emilio
Derive the most trivial ToCss implementations 🌋

<!-- 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/17152)
<!-- Reviewable:end -->
2017-06-04 10:02:28 -07:00
Manish Goregaokar
cdc230e4d3 stylo: disable @viewport
Firefox doesn't support @viewport, we shouldn't either.
2017-06-04 08:54:48 -07:00
Anthony Ramine
c4f1d647a0 Derive the most trivial ToCss implementations 🌋
For now, all variants get serialised as the space-separated serialisations
of their fields. Unit variants are not supported.
2017-06-04 16:17:56 +02:00
Cameron McCormack
19b61dfc08 style: Recascade the document when rem units are used and the root font-size changes. 2017-06-04 10:03:11 +08:00
bors-servo
7b61d55421 Auto merge of #17147 - emilio:media-query-caching, r=heycam
Bug 1357461 - stylo: Cache media query results and only flush and restyle if they changed.

<!-- 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/17147)
<!-- Reviewable:end -->
2017-06-03 08:11:23 -07:00
Emilio Cobos Álvarez
dd3bf6f952
Ensure the default computed values are up-to-date before evaluating media queries.
Zoom changes can change the meaning of ems, so we can't re-evaluate media
queries with the old values, because otherwise we may miss a restyle.

Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1357461
MozReview-Commit-ID: HQInvR7RPqR
2017-06-03 14:44:12 +02:00
Emilio Cobos Álvarez
5c66d3c77a
Cache effective media query results.
This patch also makes RulesIterator not iterate over rules for which we don't
process nested rules.

There's nothing depending on this behavior right now afaik, and this will make
us duplicate less code in following patches.

Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1357461
MozReview-Commit-ID: CaMFQtAVnJF
2017-06-03 14:43:44 +02:00
Anthony Ramine
56c961af5a Revert "Update Rust nightly to 1.19.0-nightly (6165203c4 2017-06-03)"
This reverts commit f081380dc0.
2017-06-03 14:37:17 +02:00
Emilio Cobos Álvarez
b5232c940d
style: Move the stylesheet invalidation code to another submodule.
Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1357461
MozReview-Commit-ID: DIzZXoHycZs
2017-06-03 14:18:56 +02:00
Anthony Ramine
f081380dc0 Update Rust nightly to 1.19.0-nightly (6165203c4 2017-06-03) 2017-06-03 13:35:55 +02:00
Manish Goregaokar
41f1c3463e Bump cssparser to 0.13.7 2017-06-02 17:43:56 -07:00
bors-servo
eac4f407e2 Auto merge of #15354 - cynicaldevil:manual-redirect, r=jdm
Redirect document loads manually

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

r? @jdm

I ran some tests at random from the `navigating-across-documents` folder, and they are passing.

<!-- 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/15354)
<!-- Reviewable:end -->
2017-06-02 14:49:21 -07:00
J. Ryan Stinnett
b03867da5d Update bindings 2017-06-02 14:39:13 -05:00
J. Ryan Stinnett
56b44d2709 Pull decls from Gecko for link preshints
Based on a link's active state and the visited handling mode, pull in link,
vlink, and alink preshint declaration blocks from Gecko as needed.

MozReview-Commit-ID: A6udMYbzQnK
2017-06-02 14:34:39 -05:00
bors-servo
fa158a78b6 Auto merge of #17139 - emilio:parsing-simplify, r=nox
style: Simplify a bit the parsing code.

I plan to simplify it further, but this is worth landing on its own.

<!-- 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/17139)
<!-- Reviewable:end -->
2017-06-02 05:38:48 -07:00
Emilio Cobos Álvarez
bbd85ccbda
style: Simplify the namespace setup for stylesheet parsing. 2017-06-02 14:38:05 +02:00
Emilio Cobos Álvarez
26ef0f6178
style: Simplify some attr() parsing code. 2017-06-02 12:51:33 +02:00
Emilio Cobos Álvarez
d6e703a9e9
style: return early when appropriate to deindent some dense code. 2017-06-02 12:43:53 +02:00
Emilio Cobos Álvarez
9a8c5fa7b5
style: Don't unnecessarily use a Cell in the parser. 2017-06-02 12:43:52 +02:00
bors-servo
fab1a6354f Auto merge of #17138 - emilio:parsing-decl-block, r=heycam
Bug 1369198: Ensure pushing a declaration to a declaration block for parsing always inserts it at the last position.

<!-- 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/17138)
<!-- Reviewable:end -->
2017-06-02 03:04:26 -07:00
Emilio Cobos Álvarez
acdd8aa99a
style: Insert declarations last while parsing.
The CSSOM spec forces us to reuse the slot, so we need to conditionally keep the
previous behavior.

This fixes bug 1369198.

MozReview-Commit-ID: LM9mK6ngZ4e
2017-06-02 11:21:02 +02:00
Anthony Ramine
e58f541951 Rename BorderImageWidthSide to BorderImageSideWidth 2017-06-02 10:53:28 +02:00
Anthony Ramine
7da94d0880 Use BorderSideWidth for outline-width 2017-06-02 10:53:27 +02:00
Anthony Ramine
2c7fbb4b4c Use generics for text spacing properties 2017-06-02 10:21:22 +02:00
Anthony Ramine
5c6987a50d Use generics for the line-height property 2017-06-02 10:21:21 +02:00
Hiroyuki Ikezoe
ac86d2d648 Update bindings. 2017-06-02 12:18:08 +09:00
bors-servo
373d3b91dd Auto merge of #17130 - Manishearth:stylo-attr, r=heycam,emilio
stylo: Handle attr() in `content`

r=heycam https://bugzilla.mozilla.org/show_bug.cgi?id=1346693

<!-- 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/17130)
<!-- Reviewable:end -->
2017-06-01 15:34:55 -07:00
Manish Goregaokar
5de2f29080 stylo: Create separate Attr type 2017-06-01 14:20:56 -07:00
Manish Goregaokar
25d193ba34 stylo: Use namespace ids for content: attr(..)
MozReview-Commit-ID: FZ9YEpHQCBh
2017-06-01 14:11:31 -07:00
Manish Goregaokar
7deeccf4cb stylo: Move reference of namespace map to parser context
MozReview-Commit-ID: 74Kaj2Rqkdb
2017-06-01 14:10:40 -07:00
bors-servo
cfdb6af53b Auto merge of #17121 - Manishearth:stylo-system-font-ser, r=upsuper
stylo: Fix serialization of system fonts

<!-- 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/17121)
<!-- Reviewable:end -->
2017-06-01 14:04:41 -07:00
Jeff Hajewski
878b9a4db3 Use enum class for white-space 2017-06-01 13:55:54 -07:00
Manish Goregaokar
7123e5333f stylo: Fix serialization of system fonts 2017-06-01 13:55:52 -07:00
Emilio Cobos Álvarez
93c39b0730
Bug 1369187: style: Assert that if we find an eager, element-backed pseudo, it's ::before or ::after. r=bholley
This holds because ::first-line and ::first-letter are not element-backed.

MozReview-Commit-ID: 67FU15pCLqW
2017-06-01 21:10:45 +02:00
Emilio Cobos Álvarez
a529c13904
Bug 1369187: style: Use ArrayVec for the pseudo-elements we need to restyle. r=bholley
Just a drive-by, easy optimization.

MozReview-Commit-ID: AVaeWvBHLzc
2017-06-01 21:10:37 +02:00
Emilio Cobos Álvarez
509a450cff
Bug 1369187: style: Add first-line and first-letter to the set of eager pseudo styles. r=bholley
MozReview-Commit-ID: DmpX0nA2DOw
2017-06-01 21:09:34 +02:00
Emilio Cobos Álvarez
fe74e70a2d
Bug 1369187: style: Add an API to fast-reject eager pseudos. r=bholley
Also, do nothing for now (we'll hook the Gecko pieces here when the time comes).

Let me know if you want to hold-off landing this.

MozReview-Commit-ID: 6PIhfp6sxk4
2017-06-01 21:09:26 +02:00
bors-servo
12de616532 Auto merge of #17067 - est31:master, r=jdm
Bring back clipboard support

Brings back clipboard support.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #17065
- [x] These changes fix #12805

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because _____
- [x] Testing these chances would require a full integration-style test suite, which servo currently lacks.

<!-- 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/17067)
<!-- Reviewable:end -->
2017-06-01 10:07:16 -07:00
est31
28b854d724 Bring back clipboard support 2017-06-01 16:37:29 +02:00
bors-servo
6a638876fd Auto merge of #17120 - gterzian:fix_double_borrowing_of_image_request, r=jdm
fix double borrowing of image request

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

@jdm I couldn't reproduce the crashes, but looking at the code, I can tell that if we hit the cache inside `fetch_image`, we go straight to `process_image_response`, so we're still in the same scope as that where the borrowing occurs in `prepare_image_request`. When there is no cache hit, `process_image_response` is executed as part of a task...

This should fix the issue, while retaining the original logic.

All tests in `the-img-element` are passing...

---
<!-- 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 #17109 (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/17120)
<!-- Reviewable:end -->
2017-05-31 21:47:33 -07:00
bors-servo
af6a140707 Auto merge of #17118 - upsuper:unicode-bidi-serde, r=heycam
Remove unicode-bidi/with_serde feature from style deps

It seems removing this feature from here would unbust stylo build on Gecko side, and style crate doesn't need it anyway, and for Servo, other crates would bring this feature back, so it shouldn't break Servo either.

<!-- 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/17118)
<!-- Reviewable:end -->
2017-05-31 19:28:12 -07:00
Gregory Terzian
5bf1105f02 fix double borrowing of image request 2017-06-01 10:25:34 +08:00
bors-servo
04d84a2624 Auto merge of #17111 - servo:jdm-patch-1, r=mbrubeck
Remove cssparser dependency from msg.

This removes a bunch of unnecessary rebuilds when modifying rust-cssparser.

<!-- 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/17111)
<!-- Reviewable:end -->
2017-05-31 18:06:28 -07:00
Xidorn Quan
764ed57c33 Remove unicode-bidi/with_serde feature from style deps 2017-06-01 10:53:35 +10:00
bors-servo
3337fccd99 Auto merge of #17105 - heycam:rayonup, r=nox
Update rayon to 0.7.1.

To take advantage of nikomatsakis/rayon#348.

<!-- 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/17105)
<!-- Reviewable:end -->
2017-05-31 15:20:22 -05:00
bors-servo
71eb672923 Auto merge of #17093 - ferjm:bug1365674.simulate.compute.value.failure, r=hiikezoe
Stylo - Bug 1365674: Simulate compute value failure for tests

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

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

<!-- 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/17093)
<!-- Reviewable:end -->
2017-05-31 12:03:50 -05:00
bors-servo
cd22fc6b90 Auto merge of #17095 - servo:derive-all-the-things, r=emilio
Refactor a few CSS properties

<!-- 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/17095)
<!-- Reviewable:end -->
2017-05-31 11:08:56 -05:00
Josh Matthews
d4d486197d Remove cssparser dependency from msg. 2017-05-31 11:35:18 -04:00
Bobby Holley
47404cfc4e Compare style attributes rather than rejecting them from the cache.
MozReview-Commit-ID: Jmu7Pie2mBP
2017-05-31 06:48:40 -07:00
Bobby Holley
f40c45fe1a Reduce the number of places where we need to enumerate ValidationData members.
MozReview-Commit-ID: 9m2ebknBFSE
2017-05-31 06:48:33 -07:00