Commit graph

26425 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
bors-servo
7176e3ae9e Auto merge of #17153 - Manishearth:stylo-vp-disable, r=emilio
stylo: disable @viewport

Firefox doesn't support @viewport, we shouldn't either.

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

<!-- 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/17153)
<!-- Reviewable:end -->
2017-06-04 08:56:26 -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
bors-servo
6d6f03974d Auto merge of #17151 - heycam:rem-recascade, r=emilio
style: Recascade the document when rem units are used and the root font-size changes.

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

Reviewed in https://bugzilla.mozilla.org/show_bug.cgi?id=1367592.

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

<!-- 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/17151)
<!-- Reviewable:end -->
2017-06-03 19:04:45 -07: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
Anthony Ramine
befb017f7f Revert "Update Rust stable to 1.17.0"
This reverts commit 8a9d9ab2f9.
2017-06-03 14:37:10 +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
8a9d9ab2f9 Update Rust stable to 1.17.0 2017-06-03 13:36:00 +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
bors-servo
985050d364 Auto merge of #17145 - Manishearth:bump, r=mbrubeck
Bump 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/17145)
<!-- Reviewable:end -->
2017-06-02 17:46:35 -07: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
bors-servo
54448305de Auto merge of #17144 - jryans:link-pres-hints, r=Manishearth
Stylo: Support link preshints on <body>

https://bugzilla.mozilla.org/show_bug.cgi?id=1367923
2017-06-02 13:08:04 -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
bors-servo
028908ee26 Auto merge of #17122 - servo:derive-all-the-things, r=emilio
Continue to slim down the code for 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/17122)
<!-- Reviewable:end -->
2017-06-02 01:53:55 -07: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
bors-servo
cf71a0cd96 Auto merge of #17137 - hiikezoe:get-parent-style-in-servo-side, r=birtles
Get parent style in servo side

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

---
- [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 it's for stylo

<!-- 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/17137)
<!-- Reviewable:end -->
2017-06-01 20:56:48 -07:00
Hiroyuki Ikezoe
ac86d2d648 Update bindings. 2017-06-02 12:18:08 +09:00
Hiroyuki Ikezoe
4af88b137b Get parent style from the target element.
We can get the parent style from element tree in servo side.
The parent style has been already restyled.
E.g.;
 When we get target element style with nsComputedDOMStyle::GetStyleContext,
 the function flushes styles so that the parent style has also
 restyled.

 When we call Servo_GetComputedKeyframeValues, it's called from a
 SequentialTask, that means all elements have been already restyled.

Unfortunately we can't assert that the parent style is not stale
to check the parent element has no dirty descendant bit since
Servo_GetComputedKeyframeValues is called in a SequantialTask
that is processed before post traversal, that means elements
still have the dirty bit to update nsStyleContext in the
post traversal.
2017-06-02 12:18:04 +09:00
Hiroyuki Ikezoe
e0ec2dcd54 Factor out creating context. 2017-06-02 09:33:53 +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
bors-servo
17e69af0c9 Auto merge of #17128 - emilio:first-line-letter, r=bholley
stylo: Basic support for first-line/letter dynamic changes.
2017-06-01 12:13:43 -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