Commit graph

25250 commits

Author SHA1 Message Date
Bobby Holley
1d6892afa3 Make it clearer that we never insert elements with preshints into the cache.
MozReview-Commit-ID: 9bdc0sNZeEy
2017-04-23 12:43:11 -07:00
Bobby Holley
e4ed69c52b Reorganize bits and make the flags usize.
These are never stored persistently anywhere, and I'm pretty sure it's slower
for the compiler/CPU to operate on non-word-sized flags.

MozReview-Commit-ID: LQNsJbUsw85
2017-04-23 12:41:27 -07:00
Bobby Holley
60f846b2ca Remove unused StyleRelations.
MozReview-Commit-ID: ed0NiuY9Ek
2017-04-23 12:41:21 -07:00
Bobby Holley
bdb84c7539 Don't skip the style sharing cache if an element is affected by state.
All elements end up with AFFECTED_BY_STATE right now, presumably due to the UA
sheet, and some non-TS pseudo-classes we've added, which means that we currently
never insert anything into the cache.

MozReview-Commit-ID: 5IU4qrjeJFy
2017-04-23 12:40:31 -07:00
bors-servo
c65dea95d7 Auto merge of #16577 - emilio:adjust-overflow, r=Wafflespeanut
style: Refactor overflow fixup to account for overflow: clip.

This is the missing piece to make the remaining contain tests not assert on
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/16577)
<!-- Reviewable:end -->
2017-04-23 06:33:08 -05:00
bors-servo
dfe0f4c201 Auto merge of #16575 - emilio:cleanup-matching, r=Wafflespeanut
style: trivially cleanup the matching code.

I'm reworking this, and found this cleanup that I think is worth to land.

<!-- 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/16575)
<!-- Reviewable:end -->
2017-04-23 04:55:34 -05:00
Emilio Cobos Álvarez
8b0e6ea46e
style: Refactor overflow fixup to account for overflow: clip.
This is the missing piece to make the remaining contain tests not assert on
Gecko.
2017-04-23 11:22:59 +02:00
bors-servo
33c6abb1a8 Auto merge of #16522 - chenpighead:stylo-border-reset-border-image, r=heycam
Reset longhands of border-image to their initial value while parsing border shorthand

To do so, we need to declare the border-image longhands as part of border
shorthand and always reset them.

Spec link: https://drafts.csswg.org/css-backgrounds-3/#the-border-shorthands

<!-- 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 #15202  (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/16522)
<!-- Reviewable:end -->
2017-04-23 02:51:47 -05:00
bors-servo
541db5f9a7 Auto merge of #16458 - stshine:sequential-fallback, r=pcwalton,emilio
layout: Force reflow in the sequential fallback of block format context

When reflowing a block format context during the inorder traversal,
propagate restyle damage manually to its children since they were
already reflowed. Also, test the border box to see if it can fit into
floats according to CSS 2.1 § 9.5.

Improves reddit and yahoo.

---
<!-- 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 #__ (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/16458)
<!-- Reviewable:end -->
2017-04-22 23:55:22 -05:00
Pu Xingyu
68f74d5cbe Force reflow in the sequential fallback of block format context
When reflowing a block format context during the inorder traversal,
propagate restyle damage manually to its children since they were
already reflowed.
2017-04-23 08:32:25 +08:00
bors-servo
cc74b5b36f Auto merge of #16573 - UK992:travis, r=aneeshusa
Auto clean old nightlies on Travis

This could solve `no space left` problem.

<!-- 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/16573)
<!-- Reviewable:end -->
2017-04-22 19:17:12 -05:00
Emilio Cobos Álvarez
7bdd614540
style: trivially cleanup the matching code.
I'm reworking this, and found this cleanup that I think is worth to land.
2017-04-23 01:52:22 +02:00
bors-servo
f795eb1a8b Auto merge of #16550 - froydnj:gecko-bindings-gecko-debug, r=froydnj
switch gecko_bindings over to the gecko_debug feature [DO NOT MERGE]

...so that they use the correct Gecko structs regardless of whether Rust
code is being compiled with debug assertions or not.

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

- [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 building is a sufficient test.

<!-- 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/16550)
<!-- Reviewable:end -->
2017-04-22 18:40:47 -05:00
UK992
c5f13063a5 Optimize clean-nightlies 2017-04-23 01:09:46 +02:00
UK992
534cd3046b Auto clean old nightlies on Travis 2017-04-23 01:09:42 +02:00
bors-servo
bb86bb8514 Auto merge of #16528 - servo:wpt, r=jdm
Update web-platform-tests

<!-- 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/16528)
<!-- Reviewable:end -->
2017-04-22 18:04:31 -05:00
bors-servo
7ff803e322 Auto merge of #16467 - canaltinova:contain, r=emilio
stylo: Add glue for contain property

In gecko, `size` and `content` values aren't implemented yet. So I had to disable these parts with mako. We will need to update the property and the glue once these are implemented in gecko.

---
<!-- 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 [Bug 1354998](https://bugzilla.mozilla.org/show_bug.cgi?id=1354998)

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so tha
t 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/16467)
<!-- Reviewable:end -->
2017-04-22 16:58:24 -05:00
Nathan Froyd
7c6fda8ea9 switch gecko_bindings over to the gecko_debug feature
...so that they use the correct Gecko structs regardless of whether Rust
code is being compiled with debug assertions or not.
2017-04-22 17:00:24 -04:00
Nazım Can Altınova
65b6a89978
stylo: Add glue for contain property 2017-04-22 23:23:02 +03:00
bors-servo
55e2caba4c Auto merge of #16563 - nox:transition, r=hiikezoe
Use all for the default value of transition-property in transition

<!-- 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/16563)
<!-- Reviewable:end -->
2017-04-22 07:24:25 -05:00
Anthony Ramine
6e36a62c8c Use all for the default value of transition-property in transition 2017-04-22 14:23:59 +02:00
Josh Matthews
665817d2a6 Update web-platform-tests to revision 58eb04cecbbec2e18531ab440225e38944a9c444 2017-04-22 14:17:10 +02:00
Anthony Ramine
25e8bf69e6 Remove erroneous <link rel="match"> tags in some Mozilla tests 2017-04-22 14:00:59 +02:00
Anthony Ramine
1c28f5fa7f Add missing test type for /workers/data-url.html 2017-04-22 14:00:59 +02:00
Anthony Ramine
21e5119e2f Remove duplicate tests 2017-04-22 14:00:58 +02:00
bors-servo
bbf292b120 Auto merge of #16337 - stshine:inline-block-intrinsic, r=notriddle
layout: Fix intrinsic inline size calculating of inline blocks

When calculating intrinsic inline sizes of an inline block, take its
nested inline parents into account.

---
<!-- 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 #7636 (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/16337)
<!-- Reviewable:end -->
2017-04-21 22:43:06 -05:00
bors-servo
2d3a7b2001 Auto merge of #16567 - bholley:any_declarations, r=SimonSapin
Avoid pointer-chasing to check whether there are any declarations

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

<!-- 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/16567)
<!-- Reviewable:end -->
2017-04-21 19:30:48 -05:00
Bobby Holley
1d6763c8e9 Avoid pointer-chasing to check whether there are any declarations. 2017-04-21 17:28:10 -07:00
Nazım Can Altınova
fe47726b7c
contain: paint should update overflow and display properties 2017-04-22 03:15:54 +03:00
bors-servo
97c14f05df Auto merge of #16564 - Manishearth:stylo-sys-2, r=xidorn
stylo: Support system fonts

r=xidorn https://bugzilla.mozilla.org/show_bug.cgi?id=1349417

(take 2, we backed out the last one due to heap hazards)
2017-04-21 17:03:28 -05:00
Manish Goregaokar
8bfcc6992e tidy and test fixes 2017-04-21 14:53:27 -07:00
Manish Goregaokar
5a07227db5 Bug 1349417 - Part 8: stylo: Serialize system fonts correctly; r?xidorn
MozReview-Commit-ID: 4q1zZUcw6zF
2017-04-21 14:53:25 -07:00
Manish Goregaokar
795ab74f04 stylo: System font support for bitflag properties and font-language-override 2017-04-21 14:53:23 -07:00
Manish Goregaokar
83484c7054 stylo: System font support for font-size-adjust 2017-04-21 14:53:21 -07:00
Manish Goregaokar
5184f29e10 stylo: System font support for font-weight 2017-04-21 14:53:20 -07:00
Manish Goregaokar
b0dcb72722 stylo: System font support for keyword font longhands 2017-04-21 14:53:18 -07:00
Manish Goregaokar
c1c4c8fa59 stylo: Add basic system font support, use for font-size and font-family 2017-04-21 14:53:09 -07:00
bors-servo
2b5c17c43a Auto merge of #15773 - MortimerGoro:android_improvements, r=larsbergstrom,fabricedesre
Android life cycle improvements and Gradle integration

This PR includes Android life cycle Improvements and Gradle integration for android packaging.

Android life cycle improvements are implemented in both the new [MainActivity](https://github.com/servo/servo/compare/master...MortimerGoro:android_improvements?expand=1#diff-f43708b102e98272c2af7454b8846927) and native code in this related PR: https://github.com/servo/glutin/pull/117
- Properly handle the life cycle of the Android Activity: manage EGLContext lost & restore, and animation loop pause/resume when the app goes to background/foreground or orientation changes. In the current upstream Servo crashes when the app goes to background, activity stops or changes orientation
- Handle event loop awake for Servo Animation loop
- Handle screen resize & orientation events
- Implement new keep_screen_on preference which keeps Android device's screen from ever going to sleep: very useful for games or WebVR
- Implement a full screen mode enabled by preference: very useful for games or WebVR
- Implement new shell.native-orientation preference which allows to lock the Activity to a specific orientation
- Automatically sync new android assets to sdcard when the Android version code is changed.  In the current upstream only the existence of the folder is check but resources are not updated

ofscreen_gl_context is updated to fix this: https://github.com/emilio/rust-offscreen-rendering-context/pull/83

This PR integrates Gradle build system for android packaging. Most of the code is implemented in this [build.gradle](https://github.com/servo/servo/compare/master...MortimerGoro:android_improvements?expand=1#diff-89cdb9324addb994cdba0a158b209547) . We can get rid of [build-apk](https://github.com/servo/servo/compare/master...MortimerGoro:android_improvements?expand=1#diff-40f5a7cf22f94aad059b2c1795347f5e) and manual jar dependency copying in the [package_commands.py](https://github.com/servo/servo/compare/master...MortimerGoro:android_improvements?expand=1#diff-0d425b142c8d10ae6ac1f3711fb5c23a). The correct version of gradle is automatically downloaded using the gradlew wrapper.

Some improvements:
- Allows to include more complex android dependencies/SDKs like AARs, manifest auto-merging and more.
- Improved packaging process: The gradle project is always in the same folder, it uses relative paths for everything (assets, native libraries) and outputs the apk into the correct target folder in servo. In the current upstream, ant/python build system copies the manifest, project, resources and jars each time so you end with multiple copies of the same files.
- Improved dependency declaration. We do not have to manually copy jar dependencies in the python script anymore. The gradle build scripts itself is able to search for the dependencies in the correct servo target folder.
- Supports packaging apks with different architectures: armeabi, armeabi-v7a, aarch64. We still need to fix some native servo compilation issues with armeabi-v7a, aarch64 due to dependencies which use `make`. I'll push this changes in a separate PR of the python build files but the gradle file is already ready to handle that.
- We can easily create product flavors for different versions of Servo. For example a default browser, a WebVR browser with additional dependencies or a Servo android Webview component
- Fixes minor.major.52 build error when blurdroid cargo dependency is compiled using java8 (the default in new Linux machines). The gradle build file enables the new Jack compiler which supports Java8 dependencies.
- The project can be opened with Android Studio and run the brand new GPU debugger on any Android phone. I'll add some docs in the Wiki about this.

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

<!-- Either: -->
- [x] 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/15773)
<!-- Reviewable:end -->
2017-04-21 15:52:13 -05:00
bors-servo
1661ae6cf4 Auto merge of #16544 - MortimerGoro:get_shader_precision_format, r=jdm
Implement WebGL::GetShaderPrecisionFormat

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

Implement WebGL::GetShaderPrecisionFormat. See https://github.com/servo/gleam/pull/119 && https://github.com/servo/webrender/pull/1127

---
<!-- 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 #13985 (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/16544)
<!-- Reviewable:end -->
2017-04-21 15:16:07 -05:00
bors-servo
dcbb3c7eb9 Auto merge of #16548 - nox:webkit-gradients, r=emilio
Improve parsing of gradients

<!-- 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/16548)
<!-- Reviewable:end -->
2017-04-21 14:40:02 -05:00
bors-servo
e9658bb5b4 Auto merge of #16558 - nox:placement, r=emilio
Properly parse alignment shorthands (fixes #16391)

<!-- 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/16558)
<!-- Reviewable:end -->
2017-04-21 14:03:43 -05:00
Anthony Ramine
88f682a5d5 Properly parse alignment shorthands (fixes #16391) 2017-04-21 21:03:16 +02:00
Imanol Fernandez
6b0c898e1a Fix highp precision in shaders & Implement WebGL::GetShaderPrecisionFormat 2017-04-21 20:23:55 +02:00
Imanol Fernandez
7a2a90959e Android life cycle improvements and Gradle integration 2017-04-21 18:24:10 +02:00
Jeremy Chen
43525819f4 Stylo - reset longhands of border-image to their initial value while parsing border shorthand.
To do so, we need to declare the border-image longhands as part of border
shorthand and always reset them. This could fix couple stylo test failures.
See Gecko Bug 1357350 for the test update patches.

Spec link: https://drafts.csswg.org/css-backgrounds-3/#the-border-shorthands

Note that two unit tests have been fixed as well:

1. border_should_serialize_correctly
To verify the correctness of serialization of 'border' shorthand, we need
to reset 'border-image' as well.

2. same_longhands_should_serialize_correctly
Due to the same reason as above, since the 'border-image' is not reset,
the test expectation should be fixed.
2017-04-21 18:52:39 +08:00
bors-servo
f51170a2a1 Auto merge of #16557 - hiikezoe:dont-support-moz-keyframes, r=SimonSapin
Servo does not need to support -moz-keyframes

<!-- Please describe your changes on the following line: -->
In #16553 I did innocently add a support for @-moz-keyframes but as @SimonSapin pointed out, servo does not need to support -moz prefix one.
Whereas, I think servo should support @-webkit-keyframes since it is described in web
compatibility [1].

[1] https://compat.spec.whatwg.org/#css-at-rules

---
<!-- 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/16557)
<!-- Reviewable:end -->
2017-04-21 05:14:50 -05:00
Hiroyuki Ikezoe
3af69cf9bf Servo does not need to support -moz-keyframes 2017-04-21 18:12:11 +09:00
Anthony Ramine
0854df922d Fix parsing of -webkit-linear-gradient()
No code can actually be shared between WebKit and modern gradients. :(
2017-04-21 11:08:44 +02:00
bors-servo
350d9c6c47 Auto merge of #16554 - BorisChiou:stylo/animation/compute_distance, r=emilio
stylo: Bug 1332633 - Implement ComputeDistance trait.

These patches implement ComputeDistance trait, so we can use it for SMIL animation and for testing test_transitions_per_property.html, which uses nsDOMWindowUtils::ComputeAnimationDistance() to get the the distance between two AnimationValues.

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix Bug 1332633.
- [X] These changes do not require tests because we have test cases in Gecko. (If Servo wants to use this feature, we can add more tests in Servo in the future.)

<!-- 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/16554)
<!-- Reviewable:end -->
2017-04-21 00:52:13 -05:00
bors-servo
85aba7ab14 Auto merge of #16553 - hiikezoe:vendor-prefix-keyframes, r=emilio
Support vendor prefix keyframes rule.

If there are multiple prefixed/non-prefixed @keyframes with the same name;

* non-prefixed rule overrides earlier rules.
* prefixed rule overrides earlier prefixed rules.

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

This is PR of https://bugzilla.mozilla.org/show_bug.cgi?id=1356779

---
<!-- 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/16553)
<!-- Reviewable:end -->
2017-04-21 00:17:06 -05:00