Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

layout: support tiled gradients #19554

Merged
merged 1 commit into from Dec 14, 2017
Merged

Conversation

@pyfisch
Copy link
Contributor

pyfisch commented Dec 13, 2017

Use background-size, background-position properties to render
CSS gradients.

Some cleanup in display_list_builder.rs related to gradient
calculations.

Adds two wpt tests for tiled gradients.

Note: For now even gradients with background-repeat: no-repeat
are repeated. Sometimes the gradient is not repeated everywhere.

Resolves partially #19482. (See the mentioned website for example gradients with these features)
See also: #16657 and #10412

Some glitches can be seen in the attached file. I am unsure what the exact intended semantics of push_gradient are and want to ask the webrender team before building in "workarounds" for the missing gradients.
half-rhombes


This change is Reviewable

@highfive
Copy link

highfive commented Dec 13, 2017

Heads up! This PR modifies the following files:

  • @emilio: components/layout/display_list_builder.rs, components/layout/webrender_helpers.rs
@Manishearth
Copy link
Member

Manishearth commented Dec 13, 2017

@highfive highfive assigned mbrubeck and unassigned Manishearth Dec 13, 2017
@pyfisch pyfisch force-pushed the pyfisch:tiled-gradients1 branch from 94e488e to a6a7272 Dec 13, 2017
@emilio
Copy link
Member

emilio commented Dec 13, 2017

@bors-servo
Copy link
Contributor

bors-servo commented Dec 13, 2017

Trying commit a6a7272 with merge 906bd96...

bors-servo added a commit that referenced this pull request Dec 13, 2017
layout: support tiled gradients

Use background-size, background-position properties to render
CSS gradients.

Some cleanup in display_list_builder.rs related to gradient
calculations.

Adds two wpt tests for tiled gradients.

Note: For now even gradients with background-repeat: no-repeat
are repeated. Sometimes the gradient is not repeated everywhere.

Resolves partially #19482. (See the mentioned website for example gradients with these features)
See also: #16657 and #10412

Some glitches can be seen in the attached file. I am unsure what the exact intended semantics of [`push_gradient`](https://doc.servo.org/webrender_api/struct.DisplayListBuilder.html#method.push_gradient) are and want to ask the webrender team before building in "workarounds" for the missing gradients.
![half-rhombes](https://user-images.githubusercontent.com/2781017/33958051-b16f964a-e043-11e7-8218-b28388e2cf8d.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/19554)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Dec 13, 2017

💔 Test failed - mac-dev-unit

@pyfisch
Copy link
Contributor Author

pyfisch commented Dec 13, 2017

💔 Test failed - mac-dev-unit

error: error: Connection to server timed out Connection to server timed out

This is clearly unrelated.

@mbrubeck
Copy link
Contributor

mbrubeck commented Dec 13, 2017

Results from the linux-rel-css test:

Ran 9450 tests finished in 697.0 seconds.
  • 9446 ran as expected. 1671 tests skipped.
  • 1 tests failed unexpectedly
  • 1 tests timed out unexpectedly
  • 1 tests passed unexpectedly
  • 1 tests had unexpected subtest results

Tests with unexpected results:
  ▶ PASS [expected FAIL] /css/css-variables/vars-background-shorthand-001.html

  ▶ FAIL [expected PASS] /_mozilla/mozilla/simple_scroll_to_fragment.html
  └   → /_mozilla/mozilla/simple_scroll_to_fragment.html 2d5103c1d79069b6628ffe931d05456e5b9244b2
/_mozilla/mozilla/simple_scroll_to_fragment_ref.html 7949e80732fa0f4afdbae3b1cad96ccd75bb04f6
Testing 2d5103c1d79069b6628ffe931d05456e5b9244b2 == 7949e80732fa0f4afdbae3b1cad96ccd75bb04f6

  ▶ TIMEOUT [expected PASS] /_mozilla/css/iframe/hide_after_load.html
  │ 
  │ VMware, Inc.
  │ softpipe
  └ 3.3 (Core Profile) Mesa 17.3.0-devel

  ▶ Unexpected subtest result in /quirks-mode/hashless-hex-color.html:
  └ PASS [expected FAIL] rgb(calc(100 + 155), 255, 255) (quirks)

  ▶ Unexpected subtest result in /quirks-mode/hashless-hex-color.html:
  └ PASS [expected FAIL] rgb(calc(100 + 155), 255, 255) (almost standards)

  ▶ Unexpected subtest result in /quirks-mode/hashless-hex-color.html:
  └ PASS [expected FAIL] rgb(calc(100 + 155), 255, 255) (standards)

  ▶ Unexpected subtest result in /quirks-mode/hashless-hex-color.html:
  └ PASS [expected FAIL] rgba(calc(100 + 155), 255, 255, 001) (quirks)

  ▶ Unexpected subtest result in /quirks-mode/hashless-hex-color.html:
  └ PASS [expected FAIL] rgba(calc(100 + 155), 255, 255, 001) (almost standards)

  ▶ Unexpected subtest result in /quirks-mode/hashless-hex-color.html:
  └ PASS [expected FAIL] rgba(calc(100 + 155), 255, 255, 001) (standards)

  ▶ Unexpected subtest result in /quirks-mode/hashless-hex-color.html:
  └ PASS [expected FAIL] hsl(calc(050 + 050), 100%, 100%) (quirks)

  ▶ Unexpected subtest result in /quirks-mode/hashless-hex-color.html:
  └ PASS [expected FAIL] hsl(calc(050 + 050), 100%, 100%) (almost standards)

  ▶ Unexpected subtest result in /quirks-mode/hashless-hex-color.html:
  └ PASS [expected FAIL] hsl(calc(050 + 050), 100%, 100%) (standards)

  ▶ Unexpected subtest result in /quirks-mode/hashless-hex-color.html:
  └ PASS [expected FAIL] hsla(calc(050 + 050), 100%, 100%, 001) (quirks)

  ▶ Unexpected subtest result in /quirks-mode/hashless-hex-color.html:
  └ PASS [expected FAIL] hsla(calc(050 + 050), 100%, 100%, 001) (almost standards)

  ▶ Unexpected subtest result in /quirks-mode/hashless-hex-color.html:
  └ PASS [expected FAIL] hsla(calc(050 + 050), 100%, 100%, 001) (standards)

  ▶ Unexpected subtest result in /quirks-mode/hashless-hex-color.html:
  └ PASS [expected FAIL] rgb(calc(/**/100/**/ + /**/155/**/), 255, 255) (quirks)

  ▶ Unexpected subtest result in /quirks-mode/hashless-hex-color.html:
  └ PASS [expected FAIL] rgb(calc(/**/100/**/ + /**/155/**/), 255, 255) (almost standards)

  ▶ Unexpected subtest result in /quirks-mode/hashless-hex-color.html:
  └ PASS [expected FAIL] rgb(calc(/**/100/**/ + /**/155/**/), 255, 255) (standards)

Note: The simple_scroll_to_fragment.html failure is unrelated; see #19268.

@pyfisch
Copy link
Contributor Author

pyfisch commented Dec 13, 2017

Travis just timed out: The job exceeded the maximum time limit for jobs, and has been terminated.

I got really lucky with the CI builders this time. 😖

@pyfisch pyfisch force-pushed the pyfisch:tiled-gradients1 branch from a6a7272 to 18c26e4 Dec 13, 2017
@pyfisch
Copy link
Contributor Author

pyfisch commented Dec 13, 2017

Set one test to PASS that was FAIL before.

@bors-servo retry

Copy link
Contributor

mbrubeck left a comment

Looks great, thanks! r=mbrubeck with one optional suggestion below.

bounds.size.width = bounds.size.width - border.horizontal();
bounds.size.height = bounds.size.height - border.vertical();

let mut tile = bounds.size;
match bg_size {

This comment has been minimized.

@mbrubeck

mbrubeck Dec 13, 2017

Contributor

This might be clearer as let tile = match bg_size { ... };

@KiChjang
Copy link
Member

KiChjang commented Dec 14, 2017

@bors-servo
Copy link
Contributor

bors-servo commented Dec 14, 2017

Trying commit 18c26e4 with merge 73b1803...

bors-servo added a commit that referenced this pull request Dec 14, 2017
layout: support tiled gradients

Use background-size, background-position properties to render
CSS gradients.

Some cleanup in display_list_builder.rs related to gradient
calculations.

Adds two wpt tests for tiled gradients.

Note: For now even gradients with background-repeat: no-repeat
are repeated. Sometimes the gradient is not repeated everywhere.

Resolves partially #19482. (See the mentioned website for example gradients with these features)
See also: #16657 and #10412

Some glitches can be seen in the attached file. I am unsure what the exact intended semantics of [`push_gradient`](https://doc.servo.org/webrender_api/struct.DisplayListBuilder.html#method.push_gradient) are and want to ask the webrender team before building in "workarounds" for the missing gradients.
![half-rhombes](https://user-images.githubusercontent.com/2781017/33958051-b16f964a-e043-11e7-8218-b28388e2cf8d.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/19554)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Dec 14, 2017

@KiChjang
Copy link
Member

KiChjang commented Dec 14, 2017

@bors-servo r=mbrubeck

@bors-servo
Copy link
Contributor

bors-servo commented Dec 14, 2017

📌 Commit 18c26e4 has been approved by mbrubeck

@bors-servo
Copy link
Contributor

bors-servo commented Dec 14, 2017

Testing commit 18c26e4 with merge a4ba0e6...

bors-servo added a commit that referenced this pull request Dec 14, 2017
layout: support tiled gradients

Use background-size, background-position properties to render
CSS gradients.

Some cleanup in display_list_builder.rs related to gradient
calculations.

Adds two wpt tests for tiled gradients.

Note: For now even gradients with background-repeat: no-repeat
are repeated. Sometimes the gradient is not repeated everywhere.

Resolves partially #19482. (See the mentioned website for example gradients with these features)
See also: #16657 and #10412

Some glitches can be seen in the attached file. I am unsure what the exact intended semantics of [`push_gradient`](https://doc.servo.org/webrender_api/struct.DisplayListBuilder.html#method.push_gradient) are and want to ask the webrender team before building in "workarounds" for the missing gradients.
![half-rhombes](https://user-images.githubusercontent.com/2781017/33958051-b16f964a-e043-11e7-8218-b28388e2cf8d.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/19554)
<!-- Reviewable:end -->
@jdm
Copy link
Member

jdm commented Dec 14, 2017

@bors-servo
Copy link
Contributor

bors-servo commented Dec 14, 2017

Testing commit 9502e9f with merge a8a4fd1...

bors-servo added a commit that referenced this pull request Dec 14, 2017
layout: support tiled gradients

Use background-size, background-position properties to render
CSS gradients.

Some cleanup in display_list_builder.rs related to gradient
calculations.

Adds two wpt tests for tiled gradients.

Note: For now even gradients with background-repeat: no-repeat
are repeated. Sometimes the gradient is not repeated everywhere.

Resolves partially #19482. (See the mentioned website for example gradients with these features)
See also: #16657 and #10412

Some glitches can be seen in the attached file. I am unsure what the exact intended semantics of [`push_gradient`](https://doc.servo.org/webrender_api/struct.DisplayListBuilder.html#method.push_gradient) are and want to ask the webrender team before building in "workarounds" for the missing gradients.
![half-rhombes](https://user-images.githubusercontent.com/2781017/33958051-b16f964a-e043-11e7-8218-b28388e2cf8d.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/19554)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Dec 14, 2017

💔 Test failed - android

@jdm
Copy link
Member

jdm commented Dec 14, 2017

@bors-servo
Copy link
Contributor

bors-servo commented Dec 14, 2017

Testing commit 9502e9f with merge 6ee8e6a...

bors-servo added a commit that referenced this pull request Dec 14, 2017
layout: support tiled gradients

Use background-size, background-position properties to render
CSS gradients.

Some cleanup in display_list_builder.rs related to gradient
calculations.

Adds two wpt tests for tiled gradients.

Note: For now even gradients with background-repeat: no-repeat
are repeated. Sometimes the gradient is not repeated everywhere.

Resolves partially #19482. (See the mentioned website for example gradients with these features)
See also: #16657 and #10412

Some glitches can be seen in the attached file. I am unsure what the exact intended semantics of [`push_gradient`](https://doc.servo.org/webrender_api/struct.DisplayListBuilder.html#method.push_gradient) are and want to ask the webrender team before building in "workarounds" for the missing gradients.
![half-rhombes](https://user-images.githubusercontent.com/2781017/33958051-b16f964a-e043-11e7-8218-b28388e2cf8d.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/19554)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Dec 14, 2017

@bors-servo bors-servo merged commit 9502e9f into servo:master Dec 14, 2017
3 checks passed
3 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
@pyfisch pyfisch deleted the pyfisch:tiled-gradients1 branch Dec 14, 2017
@pyfisch pyfisch mentioned this pull request Dec 14, 2017
3 of 3 tasks complete
bors-servo pushed a commit that referenced this pull request Dec 14, 2017
Fixes the glitches mentioned in #19554.
Now gradient tiles are placed in the whole bounding box.
bors-servo added a commit that referenced this pull request Dec 14, 2017
layout: background-origin attribute for gradients

Fixes the glitches mentioned in #19554.
Now gradient tiles are placed in the whole bounding box.

<!-- 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

<!-- Either: -->
- [X] There are tests for these changes

<!-- 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/19568)
<!-- Reviewable:end -->
pyfisch added a commit to pyfisch/servo that referenced this pull request Dec 15, 2017
Fixes the glitches mentioned in servo#19554.
Now gradient tiles are placed in the whole bounding box.
bors-servo added a commit that referenced this pull request Dec 15, 2017
layout: background-origin attribute for gradients

Fixes the glitches mentioned in #19554.
Now gradient tiles are placed in the whole bounding box.

<!-- 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

<!-- Either: -->
- [X] There are tests for these changes

<!-- 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/19568)
<!-- Reviewable:end -->
pyfisch added a commit to pyfisch/servo that referenced this pull request Dec 15, 2017
Fixes the glitches mentioned in servo#19554.
Now gradient tiles are placed in the whole bounding box.
pyfisch added a commit to pyfisch/servo that referenced this pull request Dec 15, 2017
Fixes the glitches mentioned in servo#19554.
Now gradient tiles are placed in the whole bounding box.
bors-servo added a commit that referenced this pull request Dec 15, 2017
layout: background-origin attribute for gradients

Fixes the glitches mentioned in #19554.
Now gradient tiles are placed in the whole bounding box.

<!-- 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

<!-- Either: -->
- [X] There are tests for these changes

<!-- 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/19568)
<!-- Reviewable:end -->
jdm added a commit to web-platform-tests/wpt that referenced this pull request Jan 4, 2018
Use background-size, background-position properties to render
CSS gradients.

Some cleanup in display_list_builder.rs related to gradient
calculations.

Adds two wpt tests for tiled gradients.

Note: For now even gradients with background-repeat: no-repeat
are repeated. Sometimes the gradient is not repeated everywhere.

Enable vars-background-shorthand-001.html CSS test.

Upstreamed from servo/servo#19554 [ci skip]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

8 participants
You can’t perform that action at this time.