Commit graph

12995 commits

Author SHA1 Message Date
Xidorn Quan
0a57dbc110 Provide @font-face rules for stylo backend. 2017-03-30 11:41:13 +11:00
Xidorn Quan
01e986f2e6 Record effective @font-face rules when updating stylist. 2017-03-30 11:41:12 +11:00
Xidorn Quan
f68e2948d5 Use Gecko nsCSSFontFaceRule for font face rule. 2017-03-30 11:41:09 +11:00
Xidorn Quan
e0c9a3fa12 Add function for sugar of nsCSSValue. 2017-03-30 11:41:08 +11:00
Xidorn Quan
2c0347ac5b Rename font_face::FontFaceRule to FontFaceData. 2017-03-30 11:41:07 +11:00
Xidorn Quan
e36b92507e Add FFI for nsCSSFontFaceRule. 2017-03-30 10:46:46 +11:00
Xidorn Quan
83badaa718 Lots of fixup for the next patch. 2017-03-30 10:46:32 +11:00
bors-servo
b783cacc54 Auto merge of #16157 - n0max:perspective_parse_non_negative, r=emilio
Parse perspective property as non negative and add tests

<!-- 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 #15449  (github issue number if applicable).

<!-- Either: -->
- [X] There are tests for these changes

<!-- 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/16157)
<!-- Reviewable:end -->
2017-03-29 15:12:07 -05:00
bors-servo
f3a5ad2f49 Auto merge of #16183 - servo:expand-diet, r=emilio
Replace ParsedDeclaration::expand with non-generic method

... to reduce its code size impact.

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

<!-- 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/16183)
<!-- Reviewable:end -->
2017-03-29 13:43:06 -05:00
Simon Sapin
4f2b9a33fe Replace ParsedDeclaration::expand with non-generic method
... to reduce its code size impact.

https://bugzilla.mozilla.org/show_bug.cgi?id=1351737
2017-03-29 20:28:25 +02:00
bors-servo
76a2c9705a Auto merge of #16180 - nox:tungstenite, r=jdm
Make the WebSocket handshake ourselves 🍷

HYPE

<!-- 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/16180)
<!-- Reviewable:end -->
2017-03-29 12:55:38 -05:00
Anthony Ramine
d022535f9c Make the WebSocket handshake ourselves to ease switching libs
We need to switch to tungstenite to finally update openssl, this commit
rewrites the whole websocket infrastructure to properly follow the Fetch
spec and to make switching to a different websocket library easier.
2017-03-29 19:17:27 +02:00
bors-servo
a54e4f33ee Auto merge of #16163 - bholley:revert_threadsafe_array, r=bholley
stylo: Remove ThreadSafeArray

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

This reverts https://bugzilla.mozilla.org/show_bug.cgi?id=1348606

<!-- 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/16163)
<!-- Reviewable:end -->
2017-03-29 12:16:35 -05:00
Anthony Ramine
3ed32f8078 Introduce NetworkError::from_hyper_error and from_ssl_error 2017-03-29 18:01:01 +02:00
bors-servo
1d98e3406a Auto merge of #16177 - emilio:stylo-pseudo-classes, r=heycam,jdm
Bug 1350140: stylo: Implement all the remaining state pseudo-classes.

<!-- 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/16177)
<!-- Reviewable:end -->
2017-03-29 08:48:12 -05:00
bors-servo
d39087fff2 Auto merge of #16178 - BorisChiou:stylo/animation/parse_angle, r=emilio
stylo: Bug 1336769 - Make Angle constructors return a finite value.

It is possible to input an extra large angle, e.g. rotate(9.5e+307rad), so we need to clamp it to avoid any assertion in Gecko.

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix Bug 1336769.
- [X] These changes do not require tests because they fix the test cases failed in Gecko.

<!-- 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/16178)
<!-- Reviewable:end -->
2017-03-29 07:42:22 -05:00
bors-servo
8adf191973 Auto merge of #16159 - bholley:note_dirty_descendants, r=heycam
Centralize note_dirty_descendants implementation, and fully propagate dirty_descendants in resolve_style.

The current code can leave the tree in an inconsistent state, with the dirty
descendants bit not fully propagated.

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

<!-- 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/16159)
<!-- Reviewable:end -->
2017-03-29 06:52:07 -05:00
bors-servo
3a3f258f33 Auto merge of #16135 - emilio:shorthand-reference-variable, r=upsuper
Shorthand with variable reference should not have extra whitespace after colon for serialization.

This is https://github.com/servo/servo/pull/15422 + a manifest update. Fixes  #15295.

<!-- 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/16135)
<!-- Reviewable:end -->
2017-03-29 06:11:32 -05:00
Emilio Cobos Álvarez
66f00c5566
style: Multiple style nits and cleanups. 2017-03-29 12:40:34 +02:00
Emilio Cobos Álvarez
835d95eb41
style: Correctly track whether a longhand contains any variable. 2017-03-29 12:16:28 +02:00
Matthias Devlamynck
05b5aabc69
Shorthand with variable reference should not have extra whitespace after colon for serialization 2017-03-29 12:16:28 +02:00
bors-servo
17da52bf2b Auto merge of #15951 - upsuper:image-layer-serialization, r=canaltinova
Skip some parts of image-layer shorthands when they are initial

To make it closer to Gecko's serialization algorithm.

Neither Servo nor Gecko currently perfectly matches the spec. Gecko has some test for this, but I don't think that's sufficient, so I'll add some later if there aren't any in Servo.

<!-- 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/15951)
<!-- Reviewable:end -->
2017-03-29 04:53:27 -05:00
Emilio Cobos Álvarez
f61afa15df
Bug 1350140: Fix computation of border and outline-width when the border or outline style change. r=heycam
MozReview-Commit-ID: FjMS47YNNX8
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-03-29 11:53:05 +02:00
Emilio Cobos Álvarez
a6277d5513
Bug 1350140: stylo: Implement all the remaining state pseudo-classes. r=heycam
Also implements :link, :visited, and :any-link more efficiently, and stops
matching :-moz-read-only in everything that is not read-write, which is kind of
dumb, and probably creates some artifacts.

MozReview-Commit-ID: 6BQqi7nAWdT
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-03-29 11:52:53 +02:00
Boris Chiou
29c87224c7 Bug 1336769 - Make Angle constructors return a finite value.
It is possible to input an extra large angle, e.g. rotate(9.5e+307rad),
so we need to clamp it to avoid any assertion in Gecko.
2017-03-29 17:51:40 +08:00
bors-servo
299f9446e6 Auto merge of #16160 - nox:tungstenite, r=jdm
Some enhancements in the net crate

See the individual commits.

<!-- 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/16160)
<!-- Reviewable:end -->
2017-03-29 03:33:53 -05:00
bors-servo
572c4dde26 Auto merge of #16174 - Adynatos:15200-serialization-with-comma, r=Wafflespeanut
Added missing comma in {background,mask}-position

<!-- Please describe your changes on the following line: -->
Fixed #15200 - missing comma in serialized {background,mask}-position with multiple values.

---
<!-- 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 #15200 (github issue number if applicable).

<!-- Either: -->
- [X] 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/16174)
<!-- Reviewable:end -->
2017-03-29 01:33:19 -05:00
bors-servo
6311321882 Auto merge of #16164 - heycam:stale-styles, r=bholley
stylo: Add argument to Servo_ResolveStyle to allow stale styles to be returned.

This is the Servo-side part of https://bugzilla.mozilla.org/show_bug.cgi?id=1350671.

<!-- 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/16164)
<!-- Reviewable:end -->
2017-03-28 23:39:06 -05:00
bors-servo
f0da7648fc Auto merge of #16168 - bzbarsky:update-atoms, r=Manishearth
Update Gecko atom bindings for Gecko bug 1351139.

<!-- 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
- [ ] 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/16168)
<!-- Reviewable:end -->
2017-03-28 21:52:36 -05:00
Kuba Pawlaczyk
fbdee15c53 Fixed #15200 - added missing comma in {background,mask}-position
serialization
2017-03-28 23:28:24 +02:00
n0max
20c07332a1 Parse perspective property as non negative and add tests 2017-03-28 22:57:06 +02:00
bors-servo
af243d5dec Auto merge of #16155 - chenpighead:gecko-glue-for-font-language-override, r=emilio
stylo: Implement gecko glue for font-language-override.

To be aligned with the implementation from Gecko side, we parse
font-language-override as Normal keyword or String. Then, we compute
and store it as a u32. So, as to the stylo glue, we can just pass the
u32 to Gecko.

The extra crate, byteorder, is used to simplify the computing and
serialization.

Since we now implement font-language-override for Gecko, we can remove
the additional branches for font-language-override in font shorthand.

ref: Gecko [Bug 1347821](https://bugzilla.mozilla.org/show_bug.cgi?id=1347821)

<!-- 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
- [ ] 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/16155)
<!-- Reviewable:end -->
2017-03-28 15:05:33 -05:00
bors-servo
f2cd9efa96 Auto merge of #16127 - jbendig:issue_14954, r=emilio
Add full parsing/serialization for mask-repeat and background-repeat

I implemented full parsing and serialization for the mask-repeat and background-repeat style properties. I think some more tests are required but I'm not what I'm missing. I'd appreciate some direction.

I also had to modify some layout code to get my changes to compile. As a result, background-repeat should work individually in both directions now too.

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

<!-- Either: -->
- [ ] There are tests for these changes

<!-- 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/16127)
<!-- Reviewable:end -->
2017-03-28 13:30:13 -05:00
Boris Zbarsky
76a8e1ca1c Update Gecko atom bindings for Gecko bug 1351139. 2017-03-28 10:19:09 -04:00
Jeremy Chen
a9e4b9caa6 stylo: Implement gecko glue for font-language-override.
To be aligned with the implementation from Gecko side, we parse
font-language-override as Normal keyword or String. Then, we compute
and store it as a u32. So, as to the stylo glue, we can just pass the
u32 to Gecko.

The extra crate, byteorder, is used to simplify the computing and
serialization.

Since we now implement font-language-override for Gecko, we can remove
the additional branches for font-language-override in font shorthand.

ref: Gecko Bug 1347821
2017-03-28 15:34:08 +08:00
Cameron McCormack
13c49606a4 stylo: Add argument to Servo_ResolveStyle to allow stale styles to be returned. 2017-03-28 15:32:35 +08:00
Bobby Holley
7c58483aff Centralize note_dirty_descendants implementation, and fully propagate dirty_descendants in resolve_style.
The current code can leave the tree in an inconsistent state, with the dirty
descendants bit not fully propagated.

MozReview-Commit-ID: ALI6etmlrDa
2017-03-27 20:43:24 -07:00
Bobby Holley
7654488988 stylo: Remove ThreadSafeArray.
MozReview-Commit-ID: JSpV8nhIVQA
2017-03-27 20:36:42 -07:00
bors-servo
0ebb9ec9e8 Auto merge of #16148 - emilio:cleanup-animation-only-restyle, r=hiikezoe
style: Cleanup a bit the restyle hint propagation code.

<!-- 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/16148)
<!-- Reviewable:end -->
2017-03-27 16:08:09 -07:00
Anthony Ramine
02b2aa159a Store SSL context in ResourceGroup
This allows sharing it with the HTTP state in CoreResourceManager::fetch.
2017-03-28 00:52:10 +02:00
Anthony Ramine
7a4632bfa2 Introduce create_ssl_context 2017-03-28 00:37:25 +02:00
bors-servo
c85a02b144 Auto merge of #16048 - ferjm:issue-15701-image-cache, r=jdm
Make image cache per-document rather than global

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #15701.
- [X] These changes do not require new tests because there should already be WPTs for image loads.

<!-- 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/16048)
<!-- Reviewable:end -->
2017-03-27 13:50:46 -07:00
James Bendig
67282f9bee Add full parsing/serialization for mask-repeat and background-repeat 2017-03-27 14:52:56 -05:00
Fernando Jiménez Moreno
fa433a74b1 Remove useless ImageDecoderRunnable struct 2017-03-27 20:44:04 +02:00
Fernando Jiménez Moreno
f4da16566d Make ImageCacheImpl have a single Mutex<ImageCacheStore> and use ImageDecoderRunnable 2017-03-27 19:54:15 +02:00
Fernando Jiménez Moreno
166c4e8bb2 Move image cache implementation to the net crate 2017-03-27 19:54:15 +02:00
Fernando Jiménez Moreno
72d7ee613b Make image cache per-document rather than global 2017-03-27 19:54:13 +02:00
Emilio Cobos Álvarez
17f055cd78
style: Re-introduce the -webkit- prefix for the order property.
I accidentally removed it while converting "order" to a predefined type
in #16144.
2017-03-27 18:02:58 +02:00
bors-servo
9f5b17202f Auto merge of #16146 - mrobinson:containing-block-scrolling, r=glennw
Fix scroll root of absolutely positioned elements

Absolutely positioned elements should be given the scroll root of their
containing block and not necessarily the scroll root of their parent.
This fixes several CSS tests, though others are still failing pending a
similar fix for inherited clipping rectangles.

Fixes #13530.

<!-- 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: -->
- [x] 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/16146)
<!-- Reviewable:end -->
2017-03-27 06:57:32 -07:00
bors-servo
b6bc49225e Auto merge of #16144 - emilio:number-calc, r=heycam
style: Make numbers keep track of whether they were specified as calc().

Fixes #15960

<!-- 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/16144)
<!-- Reviewable:end -->
2017-03-27 06:13:39 -07:00