Commit graph

10190 commits

Author SHA1 Message Date
bors-servo
f80623fd93 Auto merge of #13694 - emilio:style-animation, r=Manishearth,birtles
Introduce AnimationValue to manage animated properties in Gecko.

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

Doesn't compile because there are a bunch of `from_computed_value` missing, and I need to take care of fixing that before, but open for discussion.

@birtles: is an interface like this something like what you were looking for?

cc @Manishearth

<!-- 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/13694)
<!-- Reviewable:end -->
2016-10-12 10:34:10 -05:00
bors-servo
f584003191 Auto merge of #13701 - Manishearth:nsstring, r=emilio,mystor
Vendor nsstring bindings, use for text-overflow

From [bug 1309165](https://bugzilla.mozilla.org/show_bug.cgi?id=1309165)

<!-- 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/13701)
<!-- Reviewable:end -->
2016-10-12 08:28:27 -05:00
Manish Goregaokar
0c793d7277 Implement text-overflow using nsstring bindings
MozReview-Commit-ID: BxoFVigIOyV
2016-10-12 18:12:53 +05:30
Manish Goregaokar
398a6343b3 Vendor m-c's nsstring in-tree
It is called nsstring_vendor since libgkrust already depends on nsstring, and
we can't have two crates with the same name in-tree. We can't directly depend
on the in-tree one since this will stop independent `./mach build-geckolib` builds from working.

MozReview-Commit-ID: CR4tHgzXWFZ
2016-10-12 18:12:52 +05:30
bors-servo
a466f43fe5 Auto merge of #13493 - scotttrinh:webgl-idl, r=jdm
Partial fix for #12415: expose WebGL interfaces

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

<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because they do not add any features

<!-- 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/13493)
<!-- Reviewable:end -->
2016-10-12 06:53:17 -05:00
bors-servo
494a89c27f Auto merge of #13691 - servo:mem-replace, r=emilio
Use mem::replace in take_pseudo_styles.

<!-- 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/13691)
<!-- Reviewable:end -->
2016-10-12 04:49:22 -05:00
Emilio Cobos Álvarez
79d64f2a38
style: Use progress consistently instead of time. 2016-10-12 10:35:29 +02:00
Emilio Cobos Álvarez
b79689361b
Introduce AnimationValue to manage animated properties in Gecko. 2016-10-12 10:31:22 +02:00
Ms2ger
d8203e6f6b Use mem::replace in take_pseudo_styles. 2016-10-12 09:22:58 +02:00
bors-servo
cd2f950de3 Auto merge of #13056 - KiChjang:transition-event, r=mbrubeck
Implement transition event and infrastructure

Fixes #10245.

<!-- 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/13056)
<!-- Reviewable:end -->
2016-10-12 02:08:37 -05:00
bors-servo
f12b770079 Auto merge of #13692 - heycam:into-box, r=Manishearth
Fix return types of Owned<T>::into_box Gecko sugar types.

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

We're not transmuting to the right type.  The only current use of `into_box` is to drop a `PerDocumentStyleData`, so we weren't accidentally doing anything terribly bad, just not calling the `Drop` impl for that type.

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

<!-- 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/13692)
<!-- Reviewable:end -->
2016-10-12 01:15:12 -05:00
bors-servo
7e192ce644 Auto merge of #13700 - Manishearth:bindgen-testing, r=emilio
Run bindings tests with whole crate

We currently run bindgen's autogenerated `#[test]` blocks directly on the structs files.

That is, after generating them, we run `rustc --test` on them. This works fine for now, but
if you want to refer to types defined outside of these files (e.g. in https://bugzilla.mozilla.org/show_bug.cgi?id=1309165),
the tests are broken.

This puts a `cargo test -p style` in `./mach test-stylo`. I disabled doctests because they were failing (unable to find the `ns!()` and `atom!()` macros), and I couldn't figure out why -- will investigate in a later bug.

r? @emilio

<!-- 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/13700)
<!-- Reviewable:end -->
2016-10-12 00:14:35 -05:00
Manish Goregaokar
3d7c997a4f Run bindings tests with whole crate 2016-10-12 10:00:31 +05:30
Keith Yeung
668163ec5c Emit TransitionEnd events in the layout thread and process it in the script thread 2016-10-11 19:36:06 -07:00
bors-servo
b9bd15ebb0 Auto merge of #13696 - mrobinson:clipping_region_print, r=emilio
Add a custom Debug formatter for ClippingRegion

<!-- 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 debug printing is untested.

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

This will make display list dumps more likely to fit on a single line.

<!-- 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/13696)
<!-- Reviewable:end -->
2016-10-11 20:58:49 -05:00
bors-servo
4ca7ce6329 Auto merge of #13695 - heycam:layer-init, r=Manishearth
avoid initializing image layers after repeat/origin values have already been written

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

@bors-servo r=manishearth

given in https://bugzilla.mozilla.org/show_bug.cgi?id=1309081

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

<!-- 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/13695)
<!-- Reviewable:end -->
2016-10-11 18:37:39 -05:00
bors-servo
cf2a6475cb Auto merge of #13647 - nox:rootedreference, r=jdm
Unify all rooting traits under RootedReference

<!-- 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/13647)
<!-- Reviewable:end -->
2016-10-11 17:00:55 -05:00
bors-servo
768a699fa5 Auto merge of #13602 - pcwalton:vertical-align-middle, r=mbrubeck
layout: Rewrite Servo's `vertical-align` support to match CSS 2.1 § 10.8, and implement `vertical-align: middle` per CSS 2.1 § 10.8.1.

`InlineMetrics` has been split into `InlineMetrics` for fragments and
`LineMetrics` for lines. Both structures' fields have been renamed in
order to more clearly delineate the difference between *space* and
*content*. Vertical positioning of fragments has been reworked to take
margins and borders into account only for replaced content.

This patch fixes the `vertical_align_super_a.html` reftest. Servo now
matches the rendering that Gecko and WebKit produce.

Additionally, this includes a test for the popular inline-block
centering technique described here:
https://s.codepen.io/shshaw/fullpage/gEiDt?#Inline-Block

r? @mbrubeck

<!-- 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/13602)
<!-- Reviewable:end -->
2016-10-11 15:33:47 -05:00
Patrick Walton
773614f84c layout: Rewrite Servo's vertical-align support to match CSS 2.1 §
10.8, and implement `vertical-align: middle` per CSS 2.1 § 10.8.1.

`InlineMetrics` has been split into `InlineMetrics` for fragments and
`LineMetrics` for lines. Both structures' fields have been renamed in
order to more clearly delineate the difference between *space* and
*content*. Vertical positioning of fragments has been reworked to take
margins and borders into account only for replaced content.

This patch fixes the `vertical_align_super_a.html` reftest. Servo now
matches the rendering that Gecko and WebKit produce.

Additionally, this includes a test for the popular inline-block
centering technique described here:
https://s.codepen.io/shshaw/fullpage/gEiDt?#Inline-Block
2016-10-11 12:47:50 -07:00
Keith Yeung
752c6e6019 Implement TransitionEvent 2016-10-11 12:47:17 -07:00
Patrick Walton
56b41fa2ea gfx: On the Mac, take the scale into account when determining the
x-height of a font.
2016-10-11 12:36:19 -07:00
Patrick Walton
7bf06ed459 layout: Take the position of InlineFlows in account when determining
the baseline offset of the last line box in flow.

This caused incorrect layouts in some cases.
2016-10-11 12:36:19 -07:00
bors-servo
717e438b64 Auto merge of #13693 - mrobinson:hexadecimal, r=emilio
Correct the unicode codes used for tree printing

<!-- 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 the tree printing code is untested and this is just a correction of a build fix.

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

These were converted from inline UTF-8 to escape sequences, but the
sequences should be in hexadecimal instead of decimal.

<!-- 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/13693)
<!-- Reviewable:end -->
2016-10-11 14:19:44 -05:00
Anthony Ramine
3a547cc113 Generalise RootedVec::<JS<T>>::r as [JS<T>]::r 2016-10-11 19:44:33 +02:00
Anthony Ramine
45c9aa7487 Generalise RootedReference
It now becomes RootedReference<'root> and includes an associated type for
the return type of its 'r' method.

This removes the need for OptionalRootedReference.
2016-10-11 19:44:33 +02:00
Anthony Ramine
0b3ab875f4 Remove intrinsic Root::r() 2016-10-11 19:44:32 +02:00
bors-servo
3916d1d613 Auto merge of #13688 - bholley:styleset_refcell, r=Manishearth
stylo: Use AtomicRefCell for PerDocumentStyleData

Gecko bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1309090

<!-- 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/13688)
<!-- Reviewable:end -->
2016-10-11 12:03:29 -05:00
Bobby Holley
63ac0d2540 Use AtomicRefCell for RawServoStyleSet.
MozReview-Commit-ID: 27JeRluDAo3
2016-10-11 09:31:52 -07:00
bors-servo
51bcf516c8 Auto merge of #13677 - servo:media-fetch, r=Manishearth
Use the fetch stack for HTMLMediaElement.

<!-- 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/13677)
<!-- Reviewable:end -->
2016-10-11 11:10:39 -05:00
bors-servo
928e5ad1e5 Auto merge of #13675 - nox:servoparser, r=Ms2ger
Clean up the parsers into a single interface

<!-- 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/13675)
<!-- Reviewable:end -->
2016-10-11 10:16:23 -05:00
Anthony Ramine
4b813e0bdc Merge script::parse and script::dom::servoparser 2016-10-11 16:42:01 +02:00
Anthony Ramine
1405be6917 Unify ServoHTMLParser and ServoXMLParser in ServoParser 2016-10-11 15:08:37 +02:00
Anthony Ramine
609299e1e4 Add time profiling to ServoXMLParser::parse_sync 2016-10-11 15:03:25 +02:00
Anthony Ramine
1f23810a34 Introduce ServoParser::pipeline 2016-10-11 15:03:24 +02:00
Anthony Ramine
02162a8bda Move ParserContext to script::parse 2016-10-11 15:03:22 +02:00
Anthony Ramine
881f7f4de7 Move last chunk received logic to ServoParser 2016-10-11 15:03:21 +02:00
Anthony Ramine
e1a1bf46ca Move pending input logic to ServoParser 2016-10-11 15:00:11 +02:00
Martin Robinson
3474a2f9e1 Add a custom Debug formatter for ClippingRegion
This will make display list dumps more likely to fit on a single line.
2016-10-11 14:55:57 +02:00
Anthony Ramine
27f245e6ae Introduce ServoParser::document 2016-10-11 14:51:00 +02:00
Anthony Ramine
ea27f9d5ec Introduce ServoParser
This is a common inline parent to ServoHTMLParser and ServoXMLParser.
2016-10-11 14:50:58 +02:00
bors-servo
e597719b73 Auto merge of #13686 - bholley:fix_warnings, r=Manishearth
Fix warnings and make style and geckolib #![deny(warnings)]

Warnings have been piling up in the style system, and making it harder to tell when new warnings are introduced. I think we should tighten up on them.

CC @emilio @Manishearth @SimonSapin @heycam @pcwalton @metajack @larsbergstrom

<!-- 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/13686)
<!-- Reviewable:end -->
2016-10-11 06:17:44 -05:00
Scott Trinh
5bdc8c806d Partial fix for #12415: expose WebGL interfaces 2016-10-11 06:33:04 -04:00
Cameron McCormack
1a24469398 Avoid initializing image layers after repeat/origin values have been written.
MozReview-Commit-ID: LeetT5lKKKB
2016-10-11 17:49:45 +08:00
Cameron McCormack
c50402946b Regenerate bindings.
MozReview-Commit-ID: 6Msio9WdI5M
2016-10-11 17:49:36 +08:00
Martin Robinson
b0b7068cd3 Correct the unicode codes used for tree printing
These were converted from inline UTF-8 to escape sequences, but the
sequences should be in hexadecimal instead of decimal.
2016-10-11 11:44:38 +02:00
Cameron McCormack
ef357f5372 Fix return types of Owned<T>::into_box Gecko sugar types. 2016-10-11 17:20:45 +08:00
bors-servo
4dcd223e83 Auto merge of #13680 - frewsxcv:user-agent-cow, r=nox
Migrate user agent string to `Cow<'static, str>`.

In most scenarios, where the user of Servo will not override the default
user agent, the user agent can be a `&'static str`. But since we allow
for customization, we currently use a `String` to represent the user
agent. This commit migrates the user agent to be represented as a
`Cow<'static, str`, which (at the cost of ergonomics) prevents
unnecessary allocations whenever cloning the user agent string in the
scenario the user doesn't override the user agent.

<!-- 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/13680)
<!-- Reviewable:end -->
2016-10-11 04:04:20 -05:00
Bobby Holley
226e4cf7c0 Deny warnings in stylo crates.
MozReview-Commit-ID: 3lQNUzX77PX
2016-10-11 14:05:31 +05:30
Bobby Holley
a5aed43cd8 Fix bindings.rs warnings.
MozReview-Commit-ID: G03MWTQMkWt
2016-10-11 14:05:29 +05:30
Bobby Holley
4398512c12 Fix property warnings.
MozReview-Commit-ID: BmT9CmbDZlX
2016-10-11 14:05:28 +05:30