Make background gradient cover padding
CSS-gradients should not only cover the content of an
element but also the padding (but not the border).
<!-- Please describe your changes on the following line: -->
Thanks to @atouchet for catching 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#17387 (github issue number if applicable).
<!-- Either: -->
- [x] These changes do not require tests because gradients are hard to test automatically but you can use [this gist](https://gist.github.com/pyfisch/fa263c8dfc57e5812fe8a4869ad61513) as a manual 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/17395)
<!-- Reviewable:end -->
Fix#6799: set stacking_context_position correctly on fragment_border_iterator
Hey,
First of all, this is my first PR to Servo project and I'm learning Rust, so sorry if you see something that it's not correct. I did that as best as I know.
This PR fix the issue #6799; I tried all the corner cases that I can think about it and always get the right result and the same as other browsers.
Related to the build:
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix#6799
In the other hand, I added the test in the cssom folder, is where getBoundingClientRect is defined, so I think that is the best place.
I'm sure that the line 122 can be better, but I didn't find a way to transform a Point2D from f32 to px in a easy way.
I'm here to listen to your recommendations and fix any issue.
Thanks!
<!-- 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/16317)
<!-- Reviewable:end -->
Using TransformStyle::Preserve3D
<!-- Please describe your changes on the following line: -->
The changes were reviewed previously as a part of WR update PRs, but then we decided to move them out.
r? @emilio
---
<!-- 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/16891)
<!-- Reviewable:end -->
Renamed constellation::Frame to constellation::BrowsingContext
<!-- Please describe your changes on the following line: -->
Now that script has `WindowProxy` rather than `BrowsingContext` objects, we can rename `Frame` in the constellation to `BrowsingContext`. In particular, this means that `FrameId`s are now `BrowsingContextid`s, which better captures their purpose (and they are used in a lot of places, not just the constellation).
---
<!-- 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 do not require tests because renaming
<!-- 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/16876)
<!-- Reviewable:end -->
Don't optimize display list for projective transforms
There are situations where elements are transformed from outside the
display list. With projective transforms it's currently difficult to
detect these. In those cases we just don't optimize the display list,
so that they will always be shown.
Fixes#13822.
<!-- 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#13822 (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/16795)
<!-- Reviewable:end -->
In a similar way to Position, now specified and computed gradients share
a common Gradient type defined in style::values::generics::image.
This allows us to reuse most code for many style traits like ToCss,
HasViewportPercentage and ToComputedValue.
The test changes are the fallout of the disappearance of AngleOrCorner::None,
which align our code to the spec for serialisation, where components that can
be omitted should be omitted.
Don't update iframe pipeline until load completes
To preserve the previous functionality of delaying load events when a
new navigation is triggered, pending pipeline id represents the
current pending load. The load event is only fired if the load message's
pipeline id matches the pending pipeline id.
Track frame size on Frame instead of Pipeline
Disabled matchMedia test
Track creator pipeline id
A specified position is now a struct made of two values of different types,
the first one being PositionComponent<X>, and the second one PositionComponent<Y>.
A position component is represented by the new enum PositionComponent<Side>,
with the three values Center, Length(LengthOrPercentage), and
Side(Side, Option<LengthOrPercentage>).
Side keywords are represented by the X and Y enums, which don't include a value
for the center keyword anymore. They are accompanied by the Side trait, which
allows us to determine whether a side keyword is "left" or "top".
This refactor simplified the parsing and serialisation code and exposed bugs in it,
where it would reject valid <position> values followed by arbitrary tokens,
and where it would fail to prefer "left" to "right" when serialising positions
in basic shapes.
There are situations where elements are transformed from outside the
display list. With projective transforms it's currently difficult to
detect these. In those cases we just don't optimize the display list,
so that they will always be shown.
Fixes#13822.
Improvements to gradients.
This is a collection of commits improving the rendering of linear and radial gradients by making them conform more closely to the spec.
All commits are are independent and should work without the others.
These commits address the following issues:
* a956e3fd52resolves#3908 but contains also some other necessary changes to `convert_gradient_stops`. The updated function has a few more copys but should be more correct. Maybe @pcwalton wants to comment since he has originally written the code.
* b230be8aaf partially solves #16638. (Partially because `border-image-outset` is not implemented. This is an older issue for border gradients: #15894.
To quickly catch regressions and see changes to gradients I have created [a set of twelve manual testcases](https://pyfisch.org/stuff/testcases-gradients.html) and placed them in a single file. Attached are two files. One shows how the gradients were rendered before the PR the other one with the changes applied.


r? @emilio
and maybe also @jdm?
---
- [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/16666)
<!-- Reviewable:end -->
If the first stop of a non-repeating gradient is
not placed at offset 0.0 it is duplicated at this
position. This solves the problem of the first
stop being ignored if it is placed at the same
offset as the next stop.
Implement Specification from CSS Images 3.
Improvements:
1. Stops with positions less than preceding stops are moved.
A common pattern is blue `70%, white 0` for sharp transitions.
2. Stop runs are correct if first stop has a position.
The list `black 0%, red, gold` now renders the same as `black, red, gold`.
Other runs may also be corrected.
3. Absolute length are no longer capped to 100%.