layout: Ensure that background-repeat: round size calculation rounds to nearest natural number#41158
Merged
mrobinson merged 1 commit intoservo:mainfrom Dec 10, 2025
Merged
Conversation
Loirooriol
reviewed
Dec 9, 2025
| ] | ||
| }, | ||
| "background-repeat": { | ||
| "background-repeat-image-larger-than-positioning-area-crash.html": [ |
Contributor
There was a problem hiding this comment.
You forgot to include this file in the PR
0d4e087 to
4a94d27
Compare
Collaborator
|
🤖 Opened new upstream WPT pull request (web-platform-tests/wpt#56595) with upstreamable changes. |
Loirooriol
approved these changes
Dec 10, 2025
| @@ -0,0 +1,5 @@ | |||
| <!DOCTYPE html> | |||
Contributor
There was a problem hiding this comment.
Add <link rel="help" href="https://github.com/servo/servo/issues/41130"> for reference.
| @@ -0,0 +1,5 @@ | |||
| <!DOCTYPE html> | |||
| <style> | |||
| #span {background-repeat: round; background-image: url(data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAIAAABt+uBvAAAAAXNSR0IArs4c6QAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9wDGhYvCNVA1EIAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAjklEQVR42u3QIQEAMAgAsHNNVspTgARY1BZh0ZWP3VcgSJAgQYIECRKEIEGCBAkSJEgQggQJEiRIkCBBCBIkSJAgQYIECUKQIEGCBAkSJAhBggQJEiRIkCAECRIkSJAgQYIEIUiQIEGCBAkShCBBggQJEiRIEIIECRIkSJAgQYIQJEiQIEGCBAlCkCBBdwaeugIthHvZ+AAAAABJRU5E) } | |||
Contributor
There was a problem hiding this comment.
You can use background-image: url("../../support/60x60-green.png"), it's shorter.
…s to nearest natural number The previous code was just rounding to the nearest integrer, while the specification says to round to the nearest natural number. The prevents `inf` and `NaN` values from creeping to the results. This was leading to a crash in WebRender. Signed-off-by: Martin Robinson <[email protected]>
4a94d27 to
c375278
Compare
Member
Author
|
@Loirooriol Thanks for the review! |
Collaborator
|
📝 Transplanted new upstreamable changes to existing upstream WPT pull request (web-platform-tests/wpt#56595). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The previous code was just rounding to the nearest integrer, while the
specification says to round to the nearest natural number. The prevents
infandNaNvalues from creeping to the results. This was leading toa crash in WebRender.
Testing: This change adds a crash test.
Fixes: #41130.