Commit graph

95 commits

Author SHA1 Message Date
Martin Robinson
bc455c8a1f Add support for position:sticky
This leverages the position:sticky support in WebRender to bring basic
support for position:sticky in Servo. There are still some issues with
nested sticky flows as well as a few other corner cases. Tests are
imported from WPT and can be removed once we update to the latest
version.
2017-09-05 09:10:55 +02:00
Anthony Ramine
676f2c8acf Revert "Auto merge of #18114 - emilio:revert-webgl-refactor, r=nox"
This reverts commit 4d10d39e8f, reversing
changes made to ee94e2b7c0.
2017-08-16 23:23:18 +02:00
Emilio Cobos Álvarez
cfe22e3979
Revert "Auto merge of #17891 - MortimerGoro:webgl_move, r=glennw,emilio"
This reverts commit 90f55ea458, reversing
changes made to 2e60b27a21.
2017-08-16 16:42:13 +02:00
Imanol Fernandez
703962fe61 Improve WebGL architecture. 2017-08-15 22:14:32 +02:00
bors-servo
016ea11cba Auto merge of #17783 - BorisChiou:stylo/animation/restrictions, r=nox
stylo: Bug 1374233 - Clamp interpolated values for properties which need to be restricted

Some properties only accept non-negative values, or values greater than or equal to one. It is possible to produce an negative interpolated values while using negative timing functions, so we have to apply a restriction to these values to avoid getting invalid values.

For example, line-height must be non-negative, but the output progress of some timing functions (e,g. cubic-bezier(0.25, -2, 0.75, 1)) may be a negative value, so the interpolated result of line-height is also negative.

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix Bug 1374233.
- [X] These changes do not require tests because we have tests in Gecko side already.

<!-- 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/17783)
<!-- Reviewable:end -->
2017-08-07 11:05:17 -05:00
Boris Chiou
8651acd94c Bug 1374233 - Part 13: Use NonNegative{*} types for components of Shadow and Filter.
MozReview-Commit-ID: Im4KGy1n9IJ
2017-08-04 14:23:30 +08:00
Martin Robinson
daf638bc3f Fix fixed position items with parents with CSS clips
In order to properly handle CSS clipping, we need to keep track of what
the different kinds of clips that we have. On one hand, clipping due to
overflow rules should respect the containing block hierarchy, while CSS
clipping should respect the flow tree hierarchy. In order to represent
the complexity of items that are scrolled via one clip/scroll frame and
clipped by another we keep track of that status with a
ClipAndScrollInfo.
2017-08-03 17:52:02 +02:00
Martin Robinson
537025800f Allow overflow:hidden to scroll via script 2017-07-26 09:58:33 +10:00
Alexis Beingessner
855b1fe6f1 use DisplayListBuilder::with_capacity 2017-07-24 11:47:38 -04:00
Glenn Watson
dc82366f72 Update WR (switch to new text-decorations API in WR).
This only makes use of the "Solid" text decoration type, which
matches the existing support. WR now supports dotted, dashed
and wavy text decorations, but supporting those will need some
extra work in Servo to pass through the correct values.
2017-07-24 13:02:21 +10:00
Martin Robinson
2aa34f9dc2 Rounded corners for images and iframes. 2017-07-18 15:25:45 +02:00
Alexis Beingessner
2d3eae3e3a Implement new Webrender PushTextShadow API
Also includes an incidental bugfix for the rendering order of text decorations.

This change depends on servo/webrender#1454 being merged and upstreamed to servo.
2017-07-18 12:53:34 +02:00
Martin Robinson
e58e8ab42e Upgrade to the latest version of WebRender 2017-07-13 07:44:08 +10:00
Anthony Ramine
395f6be0a6 Use the Separator trait for the filter property 2017-06-27 23:40:16 +02:00
Glenn Watson
206fb3eb7f Update WR (z-buffer fix, border-image fill support). 2017-06-21 06:21:08 +10:00
Anthony Ramine
6f4061d4ad Use generics for the filter property
This introduces an additional shadow type for drop-shadow().
2017-06-20 13:48:53 +02:00
Nicolas Silva
8617320500 Bump euclid to 0.14. 2017-06-14 16:00:59 +02:00
Dzmitry Malyshau
d04a64394e Using TransformStyle::Preserve3D 2017-05-16 11:08:32 -04:00
Glenn Watson
d175986501 Update WR (ellipse border-radius clip, preserve-3d functionality). 2017-05-16 11:09:40 +10:00
bors-servo
3f1ae64255 Auto merge of #16666 - pyfisch:gradients, r=emilio
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:
* a956e3fd52 resolves #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.

![testcases-old](b433278e-2e7d-11e7-9396-500fef12eee0.png)
![testcases-new](b43222c6-2e7d-11e7-99ab-c0a2709baf41.png)

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 -->
2017-05-07 07:56:51 -05:00
Martin Robinson
83ac0a8505 Rename PushScrollRoot and remove PopScrollRoot
PopScrollRoot was unused and PushScrollRoot no longer pushes a scroll
root, but defines a new one.
2017-05-05 09:02:24 +02:00
Alexis Beingessner
db02979c4f Update to use webrender bincode IPC 2017-05-03 12:37:20 -04:00
Pyfisch
b230be8aaf Implement radial gradients for borders.
The property border-image-outset is not yet implemented.
Note: Also support repeating-linear-gradients for borders.
2017-04-30 22:36:45 +02:00
Pyfisch
1c4ae53a88 Pass repeating gradients to webrender. 2017-04-27 22:07:31 +02:00
Pyfisch
f4bad2d920 Partially implement radial gradients.
Missing: repeating radial gradients and keyword sizes.
2017-04-27 22:07:31 +02:00
Glenn Watson
c879584a19 Update WR (new groove/ridge border path, mix-blend-mode optimizations)
A few other minor additions too.
2017-04-26 14:34:07 +10:00
Glenn Watson
c4b1033b17 Update WR (improved double border quality, minor API changes). 2017-04-21 11:33:40 +10:00
Martin Robinson
d150cc9f95 Eliminate ScrollRootId
Just use WebRender's ClipId directly. This will allow us to create and
use ReferenceFrames in the future, if we need to do that. It will also
make it easier to have Servo responsible for creating the root
scrolling area, which will allow removing some old hacks in the future.
2017-04-20 08:51:38 +02:00
Martin Robinson
4451b8a771 Used shared clips for overflow:hidden and CSS clip
Instead of passing down a complex clipping region to each item, used
shared clipping to handle overflow:hidden and CSS clips. In addition to
being more efficient, this should also fix quite a few issues related
to absolutely positioned elements.

One existing reftest is slightly modified to avoid tickling a quirk
with the way that WebRender rasterizes masks. We are working out how to
best express these combined masks with the API or need to. The change
does not affect the original subject of the reftest.

Fixes #13109.
Fixes #10151.
Fixes #7575.
Fixes #8074.
Fixes #8780.
2017-04-17 17:06:43 +02:00
Glenn Watson
2cdd82f78e Update WR (new border code path).
This includes the new border code path for simple (solid) borders.
This gives much higher quality border rendering, including proper
support for elliptical border segments.

The quality on https://github.com/servo/servo is noticeably improved.
2017-04-13 16:41:43 +10:00
Glenn Watson
9e874f50ae Update WR (gradients, batching, text run, border changes).
- Tidy and optimize the batching code.
- Support tiling / repeat for linear and radial gradients.
- Fix some edge cases of subpixel text AA.
- Add clip mask support to border shaders.
- Optimization to text run creation on CPU.
- Handle more box-shadow clipping cases.
- Fix a panic that could occur when window size is 0.
- Clip / scroll API improvements.
2017-04-12 13:29:03 +10:00
Martin Robinson
0353aad4e3 Use real clips when generating scroll roots
This is the first step toward removing inherited clips in favor of
scroll roots for handling overflow and CSS clipping. This will allow us
to more easily handle elements that should not be clipped. While we are
still using inherited clips here, we now properly clip some types of
content that wasn't clipped before.
2017-04-06 14:46:02 +02:00
Glenn Watson
2fceb6e009 Update WR (more border fast paths, clip interface changes). 2017-04-05 10:50:06 +10:00
Martin Robinson
39600f9f4e Update to support new clipping coordinates change 2017-04-05 10:45:31 +10:00
Glenn Watson
aea7d46b91 Update WR (gradient features). 2017-04-05 05:40:29 +10:00
Glenn Watson
6dd3bc29e1 Update WR (various optimizations, gradient improvements). 2017-04-03 06:48:27 +10:00
Emilio Cobos Álvarez
fc72f096a0
style: Properly track whether <angle> or <time> values came from calc() expressions. 2017-03-27 12:42:22 +02:00
bors-servo
3b79bc2582 Auto merge of #16113 - glennw:update-wr-opaque-opt, r=mrobinson
Update WR (opaque rect optimization, stacking context culling).

<!-- 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/16113)
<!-- Reviewable:end -->
2017-03-26 14:04:07 -07:00
Glenn Watson
3ca0f8a9ac Update WR (opaque rect optimization, stacking context culling).
Correct viewport test references

These references were using an incorrect value for the expected
container width. Now that WebRender is no longer clipping to stacking
context boundaries the rendered width is correct (100% of viewport
width = 240px).
2017-03-27 06:14:34 +10:00
bors-servo
fd8127b23b Auto merge of #15905 - mephisto41:add-border-gradient, r=emilio
Add gradient border support.

webrender add gradient border support in https://github.com/servo/webrender/pull/953. This pr add support in servo.

---
<!-- 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: -->
- [X] These changes do not require tests because it should be covered by wpt

<!-- 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/15905)
<!-- Reviewable:end -->
2017-03-26 02:29:16 -07:00
Martin Robinson
9d72e89ce3 Stop splitting scroll roots
Now that WebRender can handle splitting scrolling layers on its own, we
don't need to do any work to split up scroll roots. This should also
make it possible to handle overflow:scroll and containing block scroll
roots in the future.
2017-03-21 16:42:31 -07:00
Morris Tseng
02c675204a Add gradient border support. 2017-03-13 17:00:26 +08:00
Glenn Watson
ce49bc5f89 Update WR (scroll root changes, border gradients, yuv updates). 2017-03-09 16:01:47 +10:00
Glenn Watson
034feafa8c Update WR (types updates, stacking context culling) 2017-03-09 10:32:40 +10:00
Glenn Watson
750794eb77 Update WR (reference frames for fixed position elements). 2017-03-03 10:33:52 +10:00
Glenn Watson
ffcb319324 Add support for most of the border-image properties, pass to WR.
This adds support for:
 * border-image (images, not gradients yet)
 * border-image-source
 * border-image-slice
 * border-image-repeat (stretch + repeat only for now)

Remaining work:
 * Connect border-image-outset (WR supports this).
 * border-image-width
2017-02-23 14:15:20 +10:00
Glenn Watson
c4a972aa7b Update WR (inset box shadow fix, border-image support).
I have a follow up PR for Servo that uses the new border-image
APIs, but I'll land that separately, so that we don't delay
landing the WR update itself.
2017-02-22 16:12:21 +10:00
Glenn Watson
cbe7f09f81 Update WR (pixel snapping improvements).
This includes a WR update that improves pixel snapping. Specifically,
the non-transform shader now snaps to device pixels in world space,
rather than local space.

This makes 31 new tests pass, and adds 4 new failures.

Of the new failures:
 - The three background size tests appear to be an OSMesa accuracy
   issue. Near the bottom of the image, a small number of pixels
   are different from the reference by a value of 1.0 / 255.0. I've
   confirmed on 3 real GPUs and also on llvmpipe that the tests
   match on those devices. This would be a good case for fuzzy test
   support in WPT.
 - The other failing test appears to have unreasonable accuracy
   requirements as it also fails on Gecko and Chromium in the same
   way that the test now fails on WR.
2017-02-13 23:46:28 +01:00
Glenn Watson
f1558b1c7b Update WR.
- Subpixel positioning improvements.
- Clipping fixes and optimizations.
- Fix panic when transform can't be inverted.
- Support multiple filters on single stacking context.
- Optimize gradients, support unlimited stops.
- Add external image + texture cache support.
- Support error path on shader compile error.
- Optimize border handling in texture atlas.
- Preliminary work towards clip/scroll root changes.
2017-02-07 17:19:16 +10:00
Anthony Ramine
db3e5be878 Update core-foundation-sys to 0.3 2017-02-07 14:35:30 +10:00