Commit graph

18143 commits

Author SHA1 Message Date
Pyfisch
859f002bf2 Correctly place images with background-position: center
Add a regression ref test.
See also #19680.
2018-01-05 10:45:26 +01:00
bors-servo
6131371cc2 Auto merge of #19696 - upsuper:rule-cache-opt, r=emilio
Skip rule node which contains only inherited properties for rule cache

This is one possible fix for [bug 1427681](https://bugzilla.mozilla.org/show_bug.cgi?id=1427681) which tries to skip some rule nodes when using rule cache.

Try push for correctness: https://treeherder.mozilla.org/#/jobs?repo=try&revision=74e3941e2cfc5fba4bce839f2518af8a5a8b7411

It doesn't really show much memory saving on awsy. It only shows several KB save on fresh start memory. But since conceptually it's simple, I guess it's worth taking.

<!-- 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/19696)
<!-- Reviewable:end -->
2018-01-05 03:35:04 -06:00
bors-servo
d1c72fde33 Auto merge of #19691 - pyfisch:cleanup-issues, r=emilio
Remove mention of some old issues

* #228 was done (confirmed by mbrubeck)
* #2012 fixed TODO item
* servo/webrender#28 (zoom does work)

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

---
<!-- 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/19691)
<!-- Reviewable:end -->
2018-01-05 00:25:12 -06:00
bors-servo
97e3979741 Auto merge of #19693 - hiikezoe:drop-animation-name-and-transition-property-from-early-properties, r=boris
Drop animation name and transition property from early properties

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

<!-- 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/19693)
<!-- Reviewable:end -->
2018-01-04 22:14:18 -06:00
bors-servo
0393f9d231 Auto merge of #19692 - stevel98:Contain, r=emilio
style: Make Contain::parse simpler

<!-- Please describe your changes on the following line: -->
---
Makes Contain::parse slightly simpler, as discussed in #19682

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #19682 (github issue number if applicable).

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

<!-- 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/19692)
<!-- Reviewable:end -->
2018-01-04 19:52:44 -06:00
Xidorn Quan
3593392788 Skip rule node which contains only inherited properties for rule cache. 2018-01-05 11:29:01 +11:00
Hiroyuki Ikezoe
a4e687aedd Drop animation-name and transition-property from early properties
We don't need to calculate computed animation-name or transition-property prior
to other properties any more because we no longer fill out those other
properties values in response to animation-name or transition-property length
at the time when we calculate computed property values.
2018-01-05 07:02:05 +09:00
Hiroyuki Ikezoe
9b6c5da98f Don't fill out deficient animation/transition property values in the style struct 2018-01-05 07:02:05 +09:00
Hiroyuki Ikezoe
9c05bc92f8 Check each animation sub property count in animations_equals
In a subsequent patch, we will no longer fill out deficient property values in
mAnimations.
2018-01-05 07:02:05 +09:00
Hiroyuki Ikezoe
cd56223907 Call transition_combined_duration_at to get combined duration instead of calculating directly 2018-01-05 07:02:05 +09:00
Hiroyuki Ikezoe
18a99e50d8 Make transition_combined_duration_at consider duration and delay value are used by repeating the list of values if the given index is greater than the list length 2018-01-05 07:02:05 +09:00
lizhixun
aa1b9a25f6 style: Make Contain::parse simpler 2018-01-04 13:13:49 -08:00
bors-servo
782e3fe4e4 Auto merge of #19689 - pyfisch:san-serif, r=jdm
Fix typo. san-serif -> sans-serif

<!-- 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: -->
- [ ] `./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/19689)
<!-- Reviewable:end -->
2018-01-04 14:06:47 -06:00
Pyfisch
8a57bff59d Remove mention of some old issues
* #228 was done (confirmed by mbrubeck)
* #2012 fixed TODO item
* servo/webrender#28 (zoom does work)
2018-01-04 20:31:41 +01:00
Pyfisch
fea2d7eae5 Fix typo. san-serif -> sans-serif 2018-01-04 19:10:29 +01:00
Emilio Cobos Álvarez
3bbd80d3ab
style: Fix propagation of the can_be_fragmented bit on Servo.
This was bogus before, but seems like the right thing to do.
2018-01-04 14:48:28 +01:00
Emilio Cobos Álvarez
f3ea248188
style: Remove TNode::set_can_be_fragmented and TNode::can_be_fragmented.
Replace them instead by a computed value flag, the same way as the
IS_IN_DISPLAY_NONE_SUBTREE flag works.
2018-01-04 14:45:54 +01:00
Emilio Cobos Álvarez
10a1e1e15f
style: Simplify some ComputedValueFlags setters. 2018-01-04 14:45:38 +01:00
bors-servo
7a9f99eda8 Auto merge of #19682 - stevel98:moveContain, r=emilio
style: Move contain outside of mako

<!-- Please describe your changes on the following line: -->
Sub-PR for #19015.
---
<!-- 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 #19656 (github issue number if applicable).

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

<!-- 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/19682)
<!-- Reviewable:end -->
2018-01-04 04:28:23 -06:00
lizhixun
4c23f09934 style: Move contain outside of mako 2018-01-03 23:13:56 -08:00
bors-servo
3692f13dcb Auto merge of #19681 - pyfisch:rustfmt-display-lists, r=emilio
Format parts of layout

Formats the following files:
* components/layout/display_list_builder.rs
* components/layout/webrender_helpers.rs

Remove outdated options from rustfmt.toml.
Configure rustfmt to place binary operators
at the end of line (to match ./mach test-tidy).

Rationale: I am tired of indenting my patches by hand trying my best to do it correctly and match the surrounding code. Just to be told that either my indentation is wrong or that I should switch to block indentation for this function because it looks better.

The new formatting passes `./mach test-tidy`. Compared to the old formatting it is a lot more consistent but also tends to spread the code across more lines. The diff is this big because a lot of code used visual indentation.

See also #8553

<!-- 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/19681)
<!-- Reviewable:end -->
2018-01-03 19:49:02 -06:00
Pyfisch
83bce468ea Format parts of layout
Formats the following files:
* components/layout/display_list_builder.rs
* components/layout/webrender_helpers.rs

Remove outdated options from rustfmt.toml.
Configure rustfmt to place binary operators
at the end of line (to match ./mach test-tidy).
2018-01-03 21:49:47 +01:00
bors-servo
cdf7c0ceff Auto merge of #19677 - glennw:wr-queries, r=pcwalton
Enable GPU queries by default when opening the profiler view.

<!-- 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/19677)
<!-- Reviewable:end -->
2018-01-03 14:13:42 -06:00
bors-servo
ef4246537d Auto merge of #19675 - pyfisch:issue19649, r=emilio
Implement correct corner clipping for background color

Add one regression ref test.

See also #19649

---
- [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/19675)
<!-- Reviewable:end -->
2018-01-03 13:03:49 -06:00
bors-servo
f71fb8bddc Auto merge of #19654 - emilio:geckolib-nightly, r=jdm
style: Allow building stylo with rust nightly.

See individual commits for details.

<!-- 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/19654)
<!-- Reviewable:end -->
2018-01-03 12:01:42 -06:00
Pyfisch
b3b49e3ff0 Implement correct corner clipping for background color
Add one regression ref test.

See also #19649
2018-01-03 16:16:35 +01:00
Glenn Watson
f50dc7ae31 Enable GPU queries by default when opening the profiler view. 2018-01-03 09:35:48 +10:00
bors-servo
9187c9a093 Auto merge of #19673 - emilio:flattened-tree-parent, r=smaug
style: Make GetFlattenedTreeParent more straight-forward.

Now that accessing nsIContent slots is not a blob of virtual function calls, we
should be able to unify logic here, and speed up the not-so-rare case for
chrome, while keeping the usual case fast.

Bug: 1427511
Reviewed-by: smaug
MozReview-Commit-ID: 87iY5Cbhx4T

<!-- 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/19673)
<!-- Reviewable:end -->
2018-01-02 10:00:22 -06:00
Emilio Cobos Álvarez
51e2942c25
style: Make GetFlattenedTreeParent more straight-forward.
Now that accessing nsIContent slots is not a blob of virtual function calls, we
should be able to unify logic here, and speed up the not-so-rare case for
chrome, while keeping the usual case fast.

Bug: 1427511
Reviewed-by: smaug
MozReview-Commit-ID: 87iY5Cbhx4T
2018-01-02 16:25:59 +01:00
bors-servo
691bff86b6 Auto merge of #19651 - pyfisch:background-placement, r=emilio
Unify background placement code

Merges the implementations for background-image placement
from gradients and images. Add missing parts and fix bugs.

Now supported are the CSS properties:

* background-attachment (except for local value, see #19650)
* background-clip
* background-origin
* background-position-x/y
* background-repeat
* background-size

It should be noted that backgrounds are not clipped to
rounded border corners.
(This was done before but worked only in simple cases)
See: #19649

This solves the following issues:
closes #19626
closes #16657
closes #19482 (examples from http://lea.verou.me/css3patterns/ are rendered perfectly but the round border is completely ignored now)
closes #19577

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

I enabled a few tests with the first commit but I have written about a dozen manual tests I will try to turn into ref tests either before or after this patch lands.

@bors-servo try

The relationship between the different inputs is visualized in this flowchart:
![flowchart-background](https://user-images.githubusercontent.com/2781017/34394430-5a06c72c-eb59-11e7-9d51-3d23e2215f07.png)

<!-- 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/19651)
<!-- Reviewable:end -->
2018-01-02 08:47:24 -06:00
Pyfisch
cf12e27364 Test with fixes for background repeat: spaced
Test the interaction between background-repeat: spaced
and CSS borders. Fix tile_image_axis() function.
2018-01-02 13:57:32 +01:00
Boris Chiou
aebe2cfac2 Dump the requested aligment if out of memory while allocating a table. 2018-01-02 11:31:03 +08:00
bors-servo
2a139cebac Auto merge of #19659 - CYBAI:display-out-of-mako, r=emilio
style: Move display outside of mako

This is a sub-PR of #19015
r? emilio

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #19658
- [x] These changes do not require 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/19659)
<!-- Reviewable:end -->
2018-01-01 12:14:39 -06:00
CYBAI
a764d9065e style: Move display outside of mako 2018-01-01 23:51:08 +08:00
bors-servo
1ce6d8ea2d Auto merge of #19652 - pyfisch:issue18435, r=emilio
Fix division by zero in gradient stop calculation

Check if total_length is zero and return 0.0 instead
of NaN in this case.

Closes #18435

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

<!-- Either: -->
- [x] There are tests for these changes OR
- [x] These changes do not require tests because simple bugfix/no idea for good test

<!-- 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/19652)
<!-- Reviewable:end -->
2018-01-01 09:38:07 -06:00
bors-servo
657d8a2ede Auto merge of #19655 - pyfisch:border-radii-comments, r=emilio
Remove solved FIXMEs about border radii

 cc pcwalton

cgaebel: Is this [comment] still accurate?

    // TODO(cgaebel): Support border radii even in the case of multiple border widths.
    // This is an extension of supporting elliptical radii. For now, all percentage
    // radii will be relative to the width.

[comment]: 446536b9c3/components/layout/display_list_builder.rs (L659-L661)

<!-- 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/19655)
<!-- Reviewable:end -->
2018-01-01 08:19:36 -06:00
Emilio Cobos Álvarez
bab6077c1c
Revert #19666 since we do create NAC elements and expect them to be inline.
This reverts commit 1970e82b0d, reversing
changes made to e882660ea6.

The reparenting logic is still bogus, but I'll figure out how to deal with that
in a bit.
2017-12-31 17:00:26 +01:00
bors-servo
1970e82b0d Auto merge of #19666 - emilio:root-and-item, r=upsuper
style: Simplify the skip item based display fixup adjustment.

In practice the only NAC that possibly inherits from a grid or flex container
are pseudos.

In Gecko, if the root element is an item container, custom anon content would
also sometimes incorrectly inherit from that (see bug 1405635), but that's fixed
in Stylo.

We remove the IS_ROOT_ELEMENT blockification from the "skip display fixup"
check, since the root element is never NAC or anything like that, so there's no
need for the check.

This also fixes some reparenting fishiness related to pseudo-elements. We were
only skipping the fixup when reparenting anon boxes, not when reparenting normal
element styles, nor when reparenting other pseudo styles which are not anon
boxes.

<!-- 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/19666)
<!-- Reviewable:end -->
2017-12-31 07:01:10 -06:00
Emilio Cobos Álvarez
e464f5b020
style: Simplify the skip item based display fixup adjustment.
In practice the only NAC that possibly inherits from a grid or flex container
are pseudos.

In Gecko, if the root element is an item container, custom anon content would
also sometimes incorrectly inherit from that (see bug 1405635), but that's fixed
in Stylo.

We remove the IS_ROOT_ELEMENT blockification from the "skip display fixup"
check, since the root element is never NAC or anything like that, so there's no
need for the check.

This also fixes some reparenting fishiness related to pseudo-elements. We were
only skipping the fixup when reparenting anon boxes, not when reparenting normal
element styles, nor when reparenting other pseudo styles which are not anon
boxes.
2017-12-31 13:57:49 +01:00
bors-servo
e882660ea6 Auto merge of #19664 - emilio:dupe-slots, r=smaug
style: Stop duplicating slots.

Reland of #19660 since it was backed out for not landing its Gecko changes on time.

Bug: 1427001
Reviewed-by: smaug
MozReview-Commit-ID: Cq647BcOzbe

<!-- 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/19664)
<!-- Reviewable:end -->
2017-12-31 05:13:47 -06:00
bors-servo
4ba795081c Auto merge of #19665 - emilio:derive-parse-alias, r=Manishearth
style_derive: Support parse-time aliases.

This will allow #19659 to use derive on display using:

    #[parse(aliases = "-webkit-flex")]
    Flex,
    #[parse(aliases = "-webkit-inline-flex")]
    InlineFlex,

And such.

<!-- 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/19665)
<!-- Reviewable:end -->
2017-12-31 03:46:22 -06:00
Emilio Cobos Álvarez
e6623e23c1
style: Update bindings. 2017-12-31 10:02:47 +01:00
Emilio Cobos Álvarez
537fda543e
style_derive: Support parse-time aliases.
This will allow #19659 to use derive on display using:

    #[parse(aliases = "-webkit-flex")]
    Flex,
    #[parse(aliases = "-webkit-inline-flex")]
    InlineFlex,

And such.
2017-12-31 09:53:17 +01:00
Emilio Cobos Álvarez
bc2ef519ca
style: Renumber CascadeFlags bits. 2017-12-31 09:17:00 +01:00
Emilio Cobos Álvarez
a747de1814
style: Simplify "prohibit display: contents" adjustment.
On top of #19661.

The NAC condition is pointless because NAC don't match author rules unless they
are a pseudo-element too.
2017-12-31 09:17:00 +01:00
Emilio Cobos Álvarez
dd1cef1a6c
style: Stop duplicating slots.
Bug: 1427001
Reviewed-by: smaug
MozReview-Commit-ID: Cq647BcOzbe
2017-12-31 09:01:55 +01:00
Gecko Backout
cf8b8db87d Backed out changeset dda1c7951937 for build bustage force-cargo-library-build. r=backout on a CLOSED TREE
Backs out https://github.com/servo/servo/pull/19660
2017-12-31 01:17:32 +00:00
bors-servo
d3f603ecba Auto merge of #19660 - emilio:dupe-slots, r=smaug
style: Stop duplicating slots.

Bug: 1427001
Reviewed-by: smaug
MozReview-Commit-ID: Cq647BcOzbe

<!-- 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/19660)
<!-- Reviewable:end -->
2017-12-30 17:31:38 -06:00
Emilio Cobos Álvarez
563da3a19c
style: Simplify ::-moz-fieldset-content special-casing.
The style adjuster knows about the pseudo, so there's no reason to thread that
info down.

There are more simplifications that can be done in followups, cleaning a bit the
cascade flags too, those will come later.
2017-12-30 22:08:04 +01:00
Emilio Cobos Álvarez
89e6d1d62e
style: Update bindings. 2017-12-30 20:14:13 +01:00