Commit graph

15129 commits

Author SHA1 Message Date
Xidorn Quan
0e91f033cb Serialize font longhands to -moz-use-system-font when using system font like what Gecko does. 2017-07-11 17:19:12 +10:00
bors-servo
8fa2a262dc Auto merge of #17658 - emilio:nesting-level, r=bholley
selectors: Avoid looking at MatchingMode if the selector isn't the topmost.

Also, switch the hover quirk to the same mechanism.

Bug: 1379696
Reviewed-By: bholley
MozReview-Commit-ID: KrmNqNyASf6

<!-- 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/17658)
<!-- Reviewable:end -->
2017-07-10 19:16:35 -07:00
Emilio Cobos Álvarez
1f2b79bc30
selectors: Avoid looking at MatchingMode if the selector isn't the topmost.
Also, switch the hover quirk to the same mechanism.

Bug: 1379696
Reviewed-By: bholley
MozReview-Commit-ID: KrmNqNyASf6
2017-07-11 03:52:07 +02:00
bors-servo
2ddbc92d90 Auto merge of #17655 - jdm:stylo-error-reporter, r=emilio
Hook up Stylo error reporter to Firefox devtools

Reviewed by @emilio in https://bugzilla.mozilla.org/show_bug.cgi?id=1352669.

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] There are tests for these changes

<!-- 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/17655)
<!-- Reviewable:end -->
2017-07-10 18:13:44 -07:00
Josh Matthews
0b43d0072c stylo: Update rust-cssparser; extract more specific error types when reporting (bug 1352669). 2017-07-10 20:46:12 -04:00
Josh Matthews
a08371e8eb stylo: Create error reporters linked to documents (bug 1352669) 2017-07-10 20:46:08 -04:00
Hiroyuki Ikezoe
0d43281fad Consider f64 epsilon for add_weighted portions.
This patch also degrade assert! to debug_assert! since crash reports don't show
us useful information so far (no assertion messages at all).
2017-07-11 08:42:28 +09:00
Hiroyuki Ikezoe
8f1bb25807 Update bindings. 2017-07-11 06:47:17 +09:00
J. Ryan Stinnett
3463a9c210 Pass through visited style for after change
When a transition update is needed during restyling, `get_after_change_style` is
called to re-cascade without transition rules, and this style is then used for
primary styling instead of the style just computed.

`get_after_change_style` used to ignore visited styles, so this meant that if a
transition update was needed, visited styles were effectively dropped.

To fix the crash here, we pass through the existing visited styles when
re-cascading as part of `get_after_change_style`.

MozReview-Commit-ID: 4HBQAdeJ38B
2017-07-10 13:28:12 -05:00
Hiroyuki Ikezoe
1a5e1c6255 Update bindings. 2017-07-10 18:27:19 +09:00
Xidorn Quan
7fd4b43aea Use ComputedValues rather than element to get style rule list. 2017-07-10 13:07:15 +10:00
bors-servo
82f65f6eb3 Auto merge of #17505 - cbrewster:less_blocking, r=asajeffrey,glennw
Remove unnecessary `recv` in the constellation

<!-- 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/17505)
<!-- Reviewable:end -->
2017-07-09 14:39:59 -07:00
Emilio Cobos Álvarez
43d58fc01a
stylo: Run the stylehseet invalidation pass also for stylesheet removals.
People apparently do all sorts of silly stuff with stylesheets, see Google Inbox
in bug 1379203.

Bug: 1379433
Reviewed-By: heycam
MozReview-Commit-ID: 4x2d3glOFu8
2017-07-09 14:17:19 +02:00
bors-servo
104e0b4730 Auto merge of #17640 - emilio:starts-with-ignore-ascii-case, r=stshine
style: Fix starts_with_ignore_ascii_case.

In particular, fix a panic when the input is not ASCII and we happen to index in
something that is not a char boundary.

This fixes https://bugzilla.mozilla.org/show_bug.cgi?id=1379380

<!-- 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/17640)
<!-- Reviewable:end -->
2017-07-08 12:59:29 -07:00
Emilio Cobos Álvarez
9e00efc8a5
style: Make starts_with_ignore_ascii_case not lie if the strings are the same length. 2017-07-08 19:41:28 +02:00
Emilio Cobos Álvarez
d8a22d8bd7
style: Fix starts_with_ignore_ascii_case.
In particular, fix a panic when the input is not ASCII and we happen to index in
something that is not a char boundary.

This fixes https://bugzilla.mozilla.org/show_bug.cgi?id=1379380
2017-07-08 19:32:11 +02:00
bors-servo
7a17de4fd0 Auto merge of #17639 - emilio:gdcs-rem, r=heycam
style: Avoid overriding the root font size from a getDefaultComputedStyle call

<!-- 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/17639)
<!-- Reviewable:end -->
2017-07-08 10:28:10 -07:00
Emilio Cobos Álvarez
c2cc6b08f8
style: Avoid overriding the root font size from a getDefaultComputedStyle call.
MozReview-Commit-ID: 2WFyGj868fJ
2017-07-08 18:05:31 +02:00
Emilio Cobos Álvarez
5d03ba3cbe
style: Move root font size handling outside of the cascade.
And merge it with the rest of the code handling root font-size changes.

MozReview-Commit-ID: 3rW1C3mXiMd
2017-07-08 18:05:30 +02:00
Ralph Giles
ec49c4d8c8 Better bindgen error message when files are missing.
This is only slightly more informative because it doesn't give
the filename, but I think it's an improvement on the simple
unwrap() panic when we try to read a file which isn't there.

See also [Gecko bug 1368083](https://bugzilla.mozilla.org/show_bug.cgi?id=1368083).
2017-07-07 22:49:45 -07:00
Ralph Giles
8db2775ba6 Read bindgen flags from a generated file.
Bindgen needs some build-specific flags, like the -isysroot
passed to clang for the C++ compilation. Try to read
these from $objdir/layout/style/bindgen.toml which is
created by the Firefox build system, and merge them
into the config.

See also [Gecko bug 1368083](https://bugzilla.mozilla.org/show_bug.cgi?id=1368083).
2017-07-07 22:48:55 -07:00
bors-servo
6e2e7151d8 Auto merge of #17632 - omakk:master, r=jdm
Clean up HTMLImageElement::handle_event

Reflects desired changes in #15832

<!-- Please describe your changes on the following line: -->
Cleans up `HTMLImageElement::handle_event` located in `components/script/dom/htmlimageelement.rs`

---
<!-- 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 #15832

- [X] These changes do not require tests because this change maintains the same logic

<!-- 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/17632)
<!-- Reviewable:end -->
2017-07-07 11:21:16 -07:00
Omar Akkila
420a7878b9 Refactor HTMLImageElement::handle_event to be idiomatic
Clean up HTMLImageElement::handle_event

Area::hit_test now uses a reference instead of taking ownership

Fix trailing whitespace

Unalign => in match

Fix Area::hit_test tests to reflect updated function signature
2017-07-07 21:07:12 +04:00
Simon Sapin
665e9203a1 Upgrade to rustc 1.20.0-nightly (696412de7 2017-07-06) 2017-07-07 15:28:22 +02:00
bors-servo
eec51cdd57 Auto merge of #17619 - clarcharr:master, r=SimonSapin
Update parse-hosts.

The `parse-hosts` crate was recently updated so that it doesn't use any unstable features.

---
- [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 tests were already implemented.

<!-- 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/17619)
<!-- Reviewable:end -->
2017-07-06 23:34:13 -07:00
Nazım Can Altınova
710637c53b stylo: Properly serialize grid shorthand 2017-07-06 21:44:42 -07:00
Clar Charr
d86fa9d25b Update parse-hosts. 2017-07-06 21:37:31 -04:00
bors-servo
ba2a6c1727 Auto merge of #17628 - hiikezoe:restyle-damage, r=heycam
Return no damage if there is no display property changes

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

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

<!-- 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/17628)
<!-- Reviewable:end -->
2017-07-06 17:20:38 -07:00
bors-servo
f11a922760 Auto merge of #17430 - upsuper:font-weight-int, r=nox
Store font-weight as integer directly

It doesn't make much sense to store `font-weight` as separate enums, especially given that we would need to support (somehow) arbitrary font weight value when we implement CSS Fonts Level 4.

This PR refactors the `font-weight` a bit to make it store as `u16` directly.

<!-- 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/17430)
<!-- Reviewable:end -->
2017-07-06 16:18:36 -07:00
Gecko Backout
32269fa7cc Backed out changeset fec394734f83 (bug 17624) for build bustage a=backout CLOSED TREE
Backs out https://github.com/servo/servo/pull/17624
2017-07-06 21:58:15 +00:00
Hiroyuki Ikezoe
342b7f7698 Return no damage if there is no display property changes 2017-07-07 05:46:41 +09:00
bors-servo
585468da9a Auto merge of #17624 - jdm:stylo-error-reporter, r=emilio
Hook up Stylo error reporter to Firefox devtools

Reviewed by @emilio in https://bugzilla.mozilla.org/show_bug.cgi?id=1352669.

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] There are tests for these changes

<!-- 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/17624)
<!-- Reviewable:end -->
2017-07-06 11:44:47 -07:00
Josh Matthews
f5a3830ea2 stylo: Update rust-cssparser; extract more specific error types when reporting (bug 1352669). 2017-07-06 14:32:37 -04:00
Josh Matthews
dc2a500f4b stylo: Create error reporters linked to documents (bug 1352669) 2017-07-06 14:05:52 -04:00
bors-servo
f18782fb0e Auto merge of #17578 - pyfisch:input-event, r=jdm
Implement the InputEvent

Add WebIDL, from UI Events working draft.
Implement script type for event.

Note that actually firing InputEvents is not part of this commit.

<!-- Please describe your changes on the following line: -->
As part of my effort to improve [keyboard handling](https://groups.google.com/forum/#!topic/mozilla.dev.servo/e6R7eBDjo4M) it is necessary to introduce the InputEvent. While I have a working prototype using the input event this still needs a lot of work  before it can be merged into servo.

cc @jdm

<!-- 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/17578)
<!-- Reviewable:end -->
2017-07-06 10:55:41 -07:00
Pyfisch
1102660015 Implement the InputEvent
Add WebIDL, from UI Events working draft.
Implement script type for event.

Note that actually firing InputEvents is not part of this commit.
2017-07-06 19:37:55 +02:00
bors-servo
901525c911 Auto merge of #17536 - ferjm:influxdb.profiler, r=jdm
Add cli options to write profiler output to InfluxDB

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

This patch adds the command line options and associated code to write the output of running the profiler to an InfluxDB instance, so we can create graphs like [1] with Grafana.

This is part of the work required to record and watch PWM results during CI to catch performance regressions.

[1] https://screenshots.firefox.com/j6sSZrN7pTuPK2kX/localhost

<!-- 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/17536)
<!-- Reviewable:end -->
2017-07-06 08:27:55 -07:00
bors-servo
ddd3a15b50 Auto merge of #17608 - MortimerGoro:webvr_11, r=jdm
WebVR 1.1 spec compatibility

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

Servo WebVR implementation started when WebVR spec 1.2 was about to be released. 1.2 API included some minor breaking changes from spec 1.1 in order to improve the support of the API in WebWorkers.

But eventually the WebVR  committee decided not to release 1.2 and make it a major version number with a lot more changes. WebVR API 2.0 is still under heavy churn.

This PR removes the WebVR changes that non-released 1.2 version introduced to support full WebVR 1.1 spec.

I pushed some GC fixes in a separate commit. See https://github.com/servo/servo/issues/17076 and https://github.com/servo/rust-mozjs/issues/351

---
<!-- 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/17608)
<!-- Reviewable:end -->
2017-07-06 07:25:57 -07:00
Omar Akkila
186d15edc2 Clean up Area::parse (#15834)
Replace mutable reference to array with direct use

Remove unecessary clone

Replace call to unwrap()
2017-07-06 15:16:00 +04:00
Xidorn Quan
8b842f5417 Use integer for specified and computed font-weight 2017-07-06 15:31:24 +10:00
bors-servo
7323c7745c Auto merge of #17617 - mantaroh:svg-paint-server, r=hiro,manishearth
Handling of invalid values in svg paint server

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

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

<!-- Either: -->
There are tests for these changes, a test case will be landed in reftests in https://bugzilla.mozilla.org/show_bug.cgi?id=1374161.

<!-- 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/17288)
<!-- Reviewable:end -->
2017-07-05 21:49:27 -07:00
bors-servo
9bb3728eb9 Auto merge of #17616 - canaltinova:subgrid-autofill, r=wafflespeanut
stylo: Add auto-filled line names to mRepeatAutoLineNameListBefore array

Line names with `repeat(auto-fill, ...)` were not being added to mRepeatAutoLineNameListBefore. They were being added into mLineNameLists instead.
Basically, `subgrid repeat(auto-fill, [abc]) [y z]` was becoming  `subgrid repeat(auto-fill, []) [abc] [y z]` in computed value.

---
- [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/17616)
<!-- Reviewable:end -->
2017-07-05 20:34:57 -07:00
bors-servo
8923a9e5f0 Auto merge of #17615 - bholley:simplify_local_context, r=emilio
Rip out the generic abstractions around ThreadLocalStyleContext

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

<!-- 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/17615)
<!-- Reviewable:end -->
2017-07-05 19:29:01 -07:00
bors-servo
340d350894 Auto merge of #17612 - bholley:custom_threshold, r=emilio
Make the style statistics dump threshold configurable.

I've wanted to change the threshold a couple of times, and adding in a
10-minute opt rebuild cycle is always a bit de-motivating.

I'm making this option gecko-only because it's pretty niche, and adding
support in servo would require threading it through all the options
stuff. We can add support for it there if we ever need it.

<!-- 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/17612)
<!-- Reviewable:end -->
2017-07-05 18:37:04 -07:00
Bobby Holley
41fe5db454 Make the style statistics dump threshold configurable.
I've wanted to change the threshold a couple of times, and adding in a
10-minute opt rebuild cycle is always a bit de-motivating.

I'm making this option gecko-only because it's pretty niche, and adding
support in servo would require threading it through all the options
stuff. We can add support for it there if we ever need it.

MozReview-Commit-ID: HYlJpS3usP4
2017-07-05 17:59:49 -07:00
bors-servo
03450ee8e1 Auto merge of #17556 - jyc:inline-metrics-of-block, r=emilio
layout: Clean up inline_metrics_of_block a little.

Previously the variable names were a little confusing (ascent was used
for the space_above_baseline in one branch and the and ascent field in
another branch, and was not really the ascent in one). Also add a
small diagram.

<!-- 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 they just refactor existing 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/17556)
<!-- Reviewable:end -->
2017-07-05 17:35:49 -07:00
Mantaroh Yoshinaga
5e35b491bb Support none fallback for Paint server with URL. 2017-07-06 09:01:41 +09:00
Mantaroh Yoshinaga
338eeed474 Clone the url data of paint server. 2017-07-06 09:01:41 +09:00
bors-servo
dd11ee1257 Auto merge of #17613 - birtles:zero-length-lists, r=hiro
Handle zero length lists when interpolating

These are the Servo side changes for [Gecko bug 1377053](https://bugzilla.mozilla.org/show_bug.cgi?id=1377053).

These patches have been reviewed by @hiikezoe.

<!-- 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/17613)
<!-- Reviewable:end -->
2017-07-05 16:47:36 -07:00
Bobby Holley
3330653dc8 Rip out the generic abstractions around ThreadLocalStyleContext.
MozReview-Commit-ID: 5WTLuk323Ac
2017-07-05 16:37:17 -07:00