Commit graph

439 commits

Author SHA1 Message Date
Emilio Cobos Álvarez
5e4b5105f9
style: Remove the last of the explicit style fixups.
This one is particularly dumb, I think.
2017-10-01 22:54:12 +02:00
Alan Jeffrey
fbfb9a80b4 Remove sources of panic when laying out an iframe without a nested browsing context. 2017-09-22 09:04:18 -05:00
bors-servo
a5282cabe0 Auto merge of #17862 - asajeffrey:script-paint-worklet-border, r=pcwalton
Implemented paint worklets drawing to a border.

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

Allow paint worklets to draw to a border.

---
<!-- 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 #17451.
- [X] These changes do not require tests because the existing css-paint-api test check this (but annoyingly, all fail for other reasons)

<!-- 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/17862)
<!-- Reviewable:end -->
2017-09-18 16:54:54 -05:00
bors-servo
1da581f49b Auto merge of #18506 - mrobinson:position-sticky-table, r=emilio
Fix issues with the combination of position:sticky and tables

<!-- 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 #18441 (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/18506)
<!-- Reviewable:end -->
2017-09-18 04:18:17 -05:00
Emilio Cobos Álvarez
15a76b01c1
style: simplify -servo-text-decorations-in-effect.
It's stupid.

Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-09-17 04:31:16 +02:00
Mateusz Naściszewski
7429b7dcd9 Avoid creating multiple scroll roots for sticky tables
This should prevent problems when a table has position:sticky and
overflow:scroll.
2017-09-15 16:02:34 +02:00
Martin Robinson
f1596e83a9 Fix panic when tables having position:sticky
We no longer do any stacking context or clip node creation for table
wrappers, instead relying on their TableFlows to do this.
2017-09-15 15:55:56 +02:00
Martin Robinson
73c8947b73 Properly handle stacking context collection for truncated fragments
Before we did not properly descend intro truncated fragments when
collecting stacking contexts. This change makes sure that we descend
properly

Fixes #18254.
Fixes #17072.
2017-09-15 15:33:16 +02:00
bors-servo
b2df99cb65 Auto merge of #18462 - mrobinson:cleanup-building-state, r=emilio
Do some minor cleanups in display list building

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

<!-- Either: -->
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because they should not change behavior.

<!-- 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/18462)
<!-- Reviewable:end -->
2017-09-15 05:30:47 -05:00
Martin Robinson
cedc7ebc53 Rename ScrollRoot to ClipScrollNode
ScrollRoot is an ever increasingly inaccurate name for this thing and
WebRender consistently uses ClipScrollNode nowadays. Stick with the
WebRender terminology to be consistent.
2017-09-15 10:10:22 +02:00
Boris Chiou
b89286e8e7 Use CSSPixelLength in LengthOrPercentage{*}.
Replace Au with CSSPixelLength in LengthOrPercentage,
LengthOrPercentageOrAuto, and LengthOrPercentageOrNone.
2017-09-13 18:10:46 +08:00
Boris Chiou
a949e2a057 Introduce CSSPixelLength and update NonNegativeLength.
First, we define computed::CSSPixelLength which contains a CSSFloat, a
pixel value, and then we replace computed::Length with CSSPixelLength.
Therefore, the |ComputedValue| of NoCalcLength, AbsoluteLength,
FontRelativeLength, ViewportPercentageLength, CharacterWidth, and
PhysicalLength is CSSPixelLength.

Besides, we drop NonNegativeAu, and replace computed::NonNegativeLength
with NonNegative<computed::Length>. (i.e. NonNegative<CSSPixelLength>)
2017-09-13 18:05:14 +08:00
Martin Robinson
ee46bc57ed Separate stacking context collection and display list building state
These are two different passes during layout, but previously they
shared a state object. While some of the members are the same, many are
different so we separate them out into two separate objects. We also
change the HashMaps of these state objects to use the FnvHashMap.
2017-09-12 17:15:06 +02:00
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
Martin Robinson
f1b98393cc Allow overflow:scroll without a stacking context
Fix the long-standing bug where items that are positioned and have
overflow:scroll or overflow:auto automatically create stacking
contexts. In order to do this we need to fix another bug where display
list sorting can put a Clip or ScrollFrame definition after the first
time it is used in a display list.
2017-08-24 08:30:45 +02:00
Clément DAVID
c5fe235112 order derivable traits lists
Ignoring :
 - **generated**.rs
 - python/tidy/servo_tidy_tests/rust_tidy.rs
2017-08-23 21:38:44 +02:00
Xidorn Quan
4e0b1071e7 Use Option<RGBA> for color in shadow 2017-08-19 00:20:24 +10: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
Simon Sapin
b5a4b8d6a0 Upgrade to rustc 1.21.0-nightly (13d94d5fa 2017-08-10) 2017-08-15 14:10:44 +02:00
Martin Robinson
488ffa21e0 Remove an unused DisplayListBuildState member
I'm not sure this member was ever used.
2017-08-10 13:07:54 +02:00
Alan Jeffrey
3f71be7d08 Implemented paint worklets drawing to a border. 2017-08-09 18:01:01 -05:00
bors-servo
a624496cc4 Auto merge of #17845 - asajeffrey:script-paint-worklet-background-size, r=glennw
Use CSS background-size property when computing the size of a paint worklet

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

The size of a paint worklet should be based on the background-size CSS property.

---
<!-- 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 #17676.
- [X] These changes do not require tests because the existing css-paint-api tests catch this.

<!-- 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/17845)
<!-- Reviewable:end -->
2017-08-07 16:54:35 -05: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
Boris Chiou
191c2a282b Bug 1374233 - Part 2: Add NonNegativeAu.
Add values::computed::NonNegativeAu, so BorderSideWith could be computed
to this non-negative Au, for the following properties:
1. outline-width
2. border-{*}-width
3. column-rule-width
4. -webkit-text-stroke-width

MozReview-Commit-ID: ASHaB2F7VtM
2017-08-04 14:21:57 +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
Alan Jeffrey
936dd3ef63 Speculatively evaluate paint functions during style. 2017-07-31 13:02:28 -05:00
Alan Jeffrey
d101f9c945 Implemented paint worklet arguments. 2017-07-29 15:32:13 -05:00
Martin Robinson
537025800f Allow overflow:hidden to scroll via script 2017-07-26 09:58:33 +10:00
Alan Jeffrey
a8da777fd1 Use CSS background-size property when computing the size of a paint worklet. 2017-07-24 17:32:54 -05: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
Alan Jeffrey
2318caf002 Implement drawing an image from a CSS style value into a canvas. 2017-07-21 16:39:11 -05:00
Alan Jeffrey
caa3585219 Fixed scaling artefacts in paint worklets caused by zoom and hidpi. 2017-07-20 17:25:50 -05:00
Glenn Watson
8e979e301a Update WR (text-shadow optimizations). 2017-07-20 13:23:38 +10:00
Glenn Watson
1b354994f6 Update WR (text-shadow improvements, iframe + image clips, depth buffer sharing).
Push multiple text shadows in the order WR expects them.
2017-07-18 15:26:06 +02: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
Manish Goregaokar
808b1f509b stylo: Use ComputedValuesInner instead of ComputedValues when we don't need it 2017-07-17 18:02:25 -07:00
Emilio Cobos Álvarez
310be02ba8
style: Respect calc for percentages. 2017-07-14 13:43:27 +02:00
bors-servo
14d5e4cc55 Auto merge of #17712 - mrobinson:overflow-scroll-clip, r=emilio
Fix the size and position of overflow:scroll clip

The clip for overflow:scroll clip was not including the space for
padding, which could lead to some content being clipped when it
shouldn't. This changes fixes that issue.

A test is skipped because this fix also stops hiding a failure due to
mispositioned text.

Fixes #16576.

<!-- 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 #16576 (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/17712)
<!-- Reviewable:end -->
2017-07-13 11:52:06 -07:00
Martin Robinson
39a98d4ff1 Fix the size and position of overflow:scroll clip
The clip for overflow:scroll clip was not including the space for
padding, which could lead to some content being clipped when it
shouldn't. This changes fixes that issue.

A test is skipped because this fix also stops hiding a failure due to
mispositioned text.

Fixes #16576.
2017-07-13 13:50:03 +02:00
Fernando Jiménez Moreno
6ae4bf6ee8 Implement serialization of linear-gradient the same ways as in Gecko 2017-07-13 12:20:30 +02:00
Martin Robinson
e58e8ab42e Upgrade to the latest version of WebRender 2017-07-13 07:44:08 +10:00
Alan Jeffrey
ef033b8362 Implemented paint worklet properties. 2017-07-11 17:28:56 -05:00
Nazım Can Altınova
d589645ee9 stylo: Implement -moz-prefixed radial gradients 2017-06-30 17:54:01 -07:00
Alan Jeffrey
328fb25a65 Implemented paint worklet rendering context. 2017-06-30 16:41:08 -05:00
Alan Jeffrey
3db4761767 Implemented paint worklets invoking worklet scripts. 2017-06-29 17:32:21 -05:00
Anthony Ramine
201d7e79e7 Make text-shadow and box-shadow use SimpleShadow 2017-06-28 16:28:25 +02:00