Commit graph

15292 commits

Author SHA1 Message Date
Emilio Cobos Álvarez
1d8e069389
style: Cascade the visited style with the normal rules if we didn't find a relevant link.
MozReview-Commit-ID: HbfZs0jnusn
2017-07-17 23:30:37 +02:00
bors-servo
7f1278a329 Auto merge of #17606 - asajeffrey:canvas-delay-deleting-image-keys, r=jdm
Don't delete webrender image keys immediately.

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

We currently delete webrender image id's immediately on resizing a canvas, which can cause panics. This PR delays deleting the image id until an epoch has passed.

---
<!-- 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 #17534
- [X] These changes do not require tests because the intermittent failure is already triggered by the css-paint-api tests.

<!-- 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/17606)
<!-- Reviewable:end -->
2017-07-17 13:25:37 -07:00
Alan Jeffrey
3002c45184 Don't delete webrender image keys immediately. 2017-07-17 15:24:42 -05:00
Austin Hicks
033b31979b Convert node serialization to a purely iterative algorithm.
We maintain a stack of open element nodes and non-node elements and use it to determine when to close them.
2017-07-17 12:24:30 -04:00
bors-servo
2bb4f65100 Auto merge of #16508 - brainlessdeveloper:fetch-set-origin, r=asajeffrey
Properly set origin of fetch requests

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

These changes aim to fix #15247

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

<!-- Either: -->
- [ ] There are tests for these changes
- [x] These changes do not require tests because cors is already tested with different origins

These changes require changes in tests, but I need help with that (see comments below).

<!-- 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/16508)
<!-- Reviewable:end -->
2017-07-17 08:29:23 -07:00
bors-servo
38f4ae80c4 Auto merge of #17739 - jdm:no-vendor-prefixed-errors, r=emilio
Suppress CSS parser errors for vendor-prefixed properties.

This matches the behaviour of Gecko's CSS parser.

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #17736
- [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/17739)
<!-- Reviewable:end -->
2017-07-17 07:10:11 -07:00
Josh Matthews
94d631c1f4 Suppress CSS parser errors for vendor-prefixed properties. 2017-07-17 10:00:31 -04:00
bors-servo
2d37700cf8 Auto merge of #17731 - emilio:percentage-calc, r=nox
style: Respect calc for percentages.

<!-- 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/17731)
<!-- Reviewable:end -->
2017-07-17 01:29:11 -07:00
Paul Rouget
cd3172c913 allow_navigation: use channel to send response 2017-07-17 08:55:59 +02:00
Fausto Núñez Alberro
6032940fb8 Change RequestInit origin type to ImmutableOrigin 2017-07-16 21:44:33 +02:00
Emilio Cobos Álvarez
1316f3640b
style: Fix a typo that makes us resolve styles for the whole spin to the root.
For undisplayed elements, at least.
2017-07-16 16:32:50 +02:00
bors-servo
17f99e2a7b Auto merge of #17741 - bholley:trim_traversal_fat, r=emilio
Trim some fat from the traversal

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

<!-- 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/17741)
<!-- Reviewable:end -->
2017-07-15 15:07:51 -07:00
Bobby Holley
b7de96e702 Pass a callback to recalc_style_at to avoid traversing children twice.
MozReview-Commit-ID: DIHXaVNzbFM
2017-07-15 14:45:51 -07:00
Bobby Holley
e534ec9e47 Move clearing of dirty descendants bit closer to the last place it's needed.
In the next patch, we'll move logic to identify the children for traversal into
preprocess_children (which will be renamed), and the set_dirty_descendants logic
will move along with it. So left as-is, the code here will clobber the flags.

MozReview-Commit-ID: 7ZskKWD4QC3
2017-07-15 14:27:18 -07:00
Bobby Holley
2a58c0768b Avoid memmoving the large smallvec in Parallel.rs.
MozReview-Commit-ID: 7nzjMwOmszZ
2017-07-15 14:27:18 -07:00
bors-servo
98836ff30d Auto merge of #17745 - SergeevPavel:cleanup, r=emilio
rustify if statements style

<!-- Please describe your changes on the following line: -->
Rewrite if statement in more rusty style.

---
<!-- 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 #17699 (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/17745)
<!-- Reviewable:end -->
2017-07-15 14:07:19 -07:00
bors-servo
9d78008acb Auto merge of #17747 - emilio:more-stuff-going-away, r=wafflespeanut
style: Remove unused ElementStyles::styles_and_restyle_mut.

Never enough code going away.

<!-- 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/17747)
<!-- Reviewable:end -->
2017-07-15 11:11:13 -07:00
Emilio Cobos Álvarez
65d2e8ff99
style: Remove unused ElementStyles::styles_and_restyle_mut. 2017-07-15 19:15:27 +02:00
Emilio Cobos Álvarez
3faba0cfff
style: Remove some no longer needed type arguments. 2017-07-15 19:02:19 +02:00
Pavel Sergeev
729b8120e0 rustify if statements style 2017-07-15 19:57:47 +03:00
Emilio Cobos Álvarez
bf9369b29d
script: Move the layout_wrapper outside of script.
This allows us to have ensure_data() and clear_data() functions on the TElement
trait, instead of hacking around it adding methods in random traits.

This also allows us to do some further cleanup, which I'd rather do in a
followup.
2017-07-15 16:41:12 +02:00
Hiroyuki Ikezoe
0053efb154 Update bindings. 2017-07-15 11:54:43 +09:00
Hiroyuki Ikezoe
e700a66e9f Preserve restyle hints after ForThrottledAnimationFlush restyle.
Those remaining restyle hints are needed for normal traversal later.
2017-07-15 11:54:43 +09:00
bors-servo
3fb309c755 Auto merge of #17696 - jyc:image-orientation-redux, r=Manishearth
Sync Servo / Gecko image-orientation rounding; pass as enum.

Make Servo's rounding of image-orientation values agree with Gecko's,
and pass orientations directly as an enum instead of as angles.

Depends on a Gecko change to be subsequently landed in m-c.

Were reviewed here: https://reviewboard.mozilla.org/r/155336/

<!-- 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 [Bugzilla Bug 1355380](https://bugzilla.mozilla.org/show_bug.cgi?id=1355380) (github issue number if applicable).

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

<!-- 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/17696)
<!-- Reviewable:end -->
2017-07-14 18:54:45 -07:00
Nazım Can Altınova
ade76f10b7 Convert TrackList's 'values' field to store only TrackSize.
It was storing both TrackSize and TrackRepeat before and TrackRepeat have to be
converted into sequence of TrackSize during serialization. Instead of doing this
in serialization process(which is hard and hacky), we converted to do this in
parsing process. We were doing this conversion in the ComputedValue conversion.
So we only had to move this process to parsing.
2017-07-14 15:55:40 -07:00
Jonathan Chan
c6a7f10182 Sync Servo / Gecko image-orientation rounding; pass as enum.
Make Servo's rounding of image-orientation values agree with Gecko's,
and pass orientations directly as an enum instead of as angles.

Depends on a Gecko change to be subsequently landed in m-c.
2017-07-14 14:44:23 -07:00
bors-servo
2913d65b75 Auto merge of #17726 - paulrouget:rm_WindowNavigateMsg, r=jdm
Remove WindowNavigateMsg

Two reasons:

- We want to be able to jump further in history from the embedder.
- We don't want to have an extra translation step in the compositor, where `WindowNavigateMsg` is translated to `TraversalDirection`

---
<!-- 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/17726)
<!-- Reviewable:end -->
2017-07-14 07:16:18 -07:00
bors-servo
bb0c05dd2b Auto merge of #17732 - emilio:font-size-as-ratio, r=nox
style: Simplify font_size::SpecifiedValue::as_font_ratio.

<!-- 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/17732)
<!-- Reviewable:end -->
2017-07-14 05:01:48 -07:00
Emilio Cobos Álvarez
e30ed4ef44
style: Simplify font_size::SpecifiedValue::as_font_ratio.
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-07-14 13:47:54 +02:00
Emilio Cobos Álvarez
310be02ba8
style: Respect calc for percentages. 2017-07-14 13:43:27 +02:00
bors-servo
a240054c93 Auto merge of #17729 - emilio:cursor-progress, r=heycam
stylo: Honor cursor: progress.

Gecko maps it to NS_STYLE_CURSOR_SPINNING:

http://searchfox.org/mozilla-central/rev/cbd628b085ac809bf5a536109e6288aa91cbdff0/layout/style/nsCSSProps.cpp#1217

<!-- 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/17729)
<!-- Reviewable:end -->
2017-07-14 03:04:38 -07:00
Emilio Cobos Álvarez
465e6f14fe
stylo: Honor cursor: progress.
Gecko maps it to NS_STYLE_CURSOR_SPINNING:

http://searchfox.org/mozilla-central/rev/cbd628b085ac809bf5a536109e6288aa91cbdff0/layout/style/nsCSSProps.cpp#1217
2017-07-14 11:26:31 +02:00
bors-servo
6597178b91
Auto merge of #17701 - bholley:reuse_allocations, r=emilio
reuse the bloom filter and style sharing cache across traversals

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

<!-- 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/17701)
<!-- Reviewable:end -->
2017-07-14 11:01:07 +02:00
Emilio Cobos Álvarez
af36ce2ae1
style: Ensure sequential tasks run after the bloom filter is dropped.
MozReview-Commit-ID: 3LjiPP7THg7
2017-07-14 11:00:19 +02:00
bors-servo
1c85c55d02 Auto merge of #17713 - emilio:less-code-is-lovely, r=heycam
style: Kill some style sharing code.

It's trivial to do so after #17688.

<!-- 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/17713)
<!-- Reviewable:end -->
2017-07-14 00:25:37 -07:00
Emilio Cobos Álvarez
bd10081919
style: Move comment to a closer location. 2017-07-14 09:24:38 +02:00
Paul Rouget
0cce5776a7 Remove WindowNavigateMsg 2017-07-14 08:56:38 +02:00
Cameron McCormack
69b839f22e style: Update Gecko bindings. 2017-07-14 14:20:41 +08:00
Cameron McCormack
e8ffd9dbba style: Add FFI function to compare ComputedValues for custom property differences. 2017-07-14 14:19:01 +08:00
bors-servo
18c5ba108d Auto merge of #17722 - upsuper:ruby-fixup, r=heycam,bz
Implement style adjustments for ruby

This is the Servo side changes of [bug 1378287](https://bugzilla.mozilla.org/show_bug.cgi?id=1378287) and [bug 1364274](https://bugzilla.mozilla.org/show_bug.cgi?id=1364274).

<!-- 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/17722)
<!-- Reviewable:end -->
2017-07-13 20:02:36 -07:00
bors-servo
394921e33c Auto merge of #17716 - emilio:reconstruct-root, r=heycam
style: Don't early return before updating the root font-size.

We never use the reconstruct path for the root, but feels less handwavy.

<!-- 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/17716)
<!-- Reviewable:end -->
2017-07-13 18:57:47 -07:00
Xidorn Quan
1362ba5f3c Update binding file. 2017-07-14 10:54:00 +10:00
Xidorn Quan
6a12de1c1a Add style adjustments for ruby. 2017-07-14 10:53:58 +10:00
Xidorn Quan
fcf37b19fd Move HAS_TEXT_DECORATION_LINES setting into StyleAdjuster. 2017-07-14 10:53:50 +10:00
Xidorn Quan
86799d4d6e Inherit computed value flags when inheriting computed values. 2017-07-14 10:53:48 +10:00
Xidorn Quan
2a05c29c30 Rename HAS_TEXT_DECORATION_LINE to match gecko side name. 2017-07-14 10:53:46 +10:00
Xidorn Quan
5270b766c1 Skip parent-display-based display type fixup for all anonymous boxes. 2017-07-14 10:53:38 +10:00
bors-servo
9c3c14cbd1 Auto merge of #17720 - hgallagher1993:local_branch, r=emilio
Removed unsused import

<!-- Please describe your changes on the following line: -->
Removed IS_ABSOLUTELY_POSITIONED from use flow::{self, BaseFlow, Flow, FlowClass, ForceNonfloatedFlag, IS_ABSOLUTELY_POSITIONED};

components/layout/inline.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
- [ ] These changes fix #__ (github issue number if applicable).

<!-- 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/17720)
<!-- Reviewable:end -->
2017-07-13 17:07:21 -07:00
bors-servo
af48b42c57 Auto merge of #17706 - glennw:linux-fonts, r=stshine,emilio
Improve font layout in Linux / Freetype platforms.

This patch contains two small changes:

* Fix the font size calculation that is passed to Freetype. This
  now matches exactly how Webrender and Gecko calculate font size
  to pass to layout.
* Enable light hinting by default for fonts when using Freetype.
  We should make this configurable in the future, but this is a
  better default than no hinting (and matches what most Linux
  distros default to).

These two changes (along with the pending WR update) fix a lot
of the font layout issues on Linux. There is still at least one
remaining issue with hidpi displays on Linux that will be fixed
in a follow up patch.

<!-- 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/17706)
<!-- Reviewable:end -->
2017-07-13 16:13:41 -07:00
Glenn Watson
83e5a82388 Improve font layout in Linux / Freetype platforms.
This patch contains two small changes:

* Fix the font size calculation that is passed to Freetype. This
  now matches exactly how Webrender and Gecko calculate font size
  to pass to layout.
* Enable light hinting by default for fonts when using Freetype.
  We should make this configurable in the future, but this is a
  better default than no hinting (and matches what most Linux
  distros default to).

These two changes (along with the pending WR update) fix a lot
of the font layout issues on Linux. There is still at least one
remaining issue with hidpi displays on Linux that will be fixed
in a follow up patch.
2017-07-14 08:40:10 +10:00