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

border-image-repeat:round output doesn't match other browsers #11668

Conversation

brentfulgham
Copy link
Contributor

@brentfulgham brentfulgham commented Mar 18, 2023

255da9f

border-image-repeat:round output doesn't match other browsers
https://bugs.webkit.org/show_bug.cgi?id=155955
<rdar://problem/28213711>

Reviewed by Tim Nguyen.

The RoundTile and SpaceTile didn't take the scale factors computed in NinePieceImage,
so would arrive at incorrect counts. This caused the logic to scale images when it
should have left them unscaled, and simply tiled (or spaced) the elements.

This change progresses four WPT tests:
(1) border-image-repeat-round.html
(2) border-image-round-and-stretch.html
(3) border-image-slice-percentage-test.html
(4) border-image-space-001.html

* Source/WebCore/platform/graphics/Image.cpp:
(WebCore::Image::drawTiled):

Canonical link: https://commits.webkit.org/261903@main

c64f115

Misc iOS, tvOS & watchOS macOS Linux Windows
βœ… πŸ§ͺ style βœ… πŸ›  ios βœ… πŸ›  mac βœ… πŸ›  wpe   πŸ›  wincairo
βœ… πŸ§ͺ bindings βœ… πŸ›  ios-sim   πŸ›  mac-AS-debug   πŸ§ͺ wpe-wk2
βœ… πŸ§ͺ webkitperl   πŸ§ͺ ios-wk2   πŸ§ͺ api-mac βœ… πŸ›  gtk
  πŸ§ͺ api-ios   πŸ§ͺ mac-wk1   πŸ§ͺ gtk-wk2
βœ… πŸ›  tv   πŸ§ͺ mac-wk2   πŸ§ͺ api-gtk
  πŸ›  tv-sim   πŸ§ͺ mac-AS-debug-wk2
  πŸ›  watch   πŸ§ͺ mac-wk2-stress
❌ πŸ›  πŸ§ͺ merge βœ… πŸ›  watch-sim

@brentfulgham brentfulgham self-assigned this Mar 18, 2023
@brentfulgham brentfulgham added the Layout and Rendering For bugs with layout and rendering of Web pages. label Mar 18, 2023
@nt1m nt1m requested a review from smfr March 18, 2023 00:01
Copy link
Member

@nt1m nt1m left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we see the WPT progressions in this patch?

@brentfulgham
Copy link
Contributor Author

Can we see the WPT progressions in this patch?

I'll update the test expectations shortly. I wanted to see if EWS found any other issues.

@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Mar 18, 2023
Copy link
Contributor

@smfr smfr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this implement this part of the spec?

"The middle image's width is scaled by the same factor as the top image unless that factor is zero or infinity, in which case the scaling factor of the bottom is substituted, and failing that, the width is not scaled. The height of the middle image is scaled by the same factor as the left image unless that factor is zero or infinity, in which case the scaling factor of the right image is substituted, and failing that, the height is not scaled."

@brentfulgham
Copy link
Contributor Author

Does this implement this part of the spec?

"The middle image's width is scaled by the same factor ... failing that, the height is not scaled."

I believe this logic is implemented in NinePieceImage::computeMiddleTileScale, with the possible exception that while zero width (and height) are accounted for, I'm not sure if it recognizes infinity.

@brentfulgham brentfulgham removed the merging-blocked Applied to prevent a change from being merged label Mar 20, 2023
@brentfulgham brentfulgham force-pushed the eng/border-image-repeatround-output-doesnt-match-other-browsers branch from 2637927 to 40ea80c Compare March 20, 2023 18:06
Copy link
Member

@nt1m nt1m left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r=me but please export to WPT

@@ -6,6 +6,7 @@
<link rel="help" href="http://www.w3.org/TR/css3-background/#border-images">
<link rel="match" href="reference/border-image-repeat-round-ref.html">
<meta name="assert" content="diamonds in corners should be red, and other diamonds should be orange, it should be 4 orange diamonds on each side.">
<meta name="fuzzy" content="0-92;0-3435">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use the longhand form for clarity, here and below.

Suggested change
<meta name="fuzzy" content="0-92;0-3435">
<meta name="fuzzy" content="maxDifference=0-92;totalPixels=0-3435">

@brentfulgham brentfulgham force-pushed the eng/border-image-repeatround-output-doesnt-match-other-browsers branch from 40ea80c to cc788d7 Compare March 20, 2023 20:37
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Mar 20, 2023
@brentfulgham brentfulgham removed the merging-blocked Applied to prevent a change from being merged label Mar 20, 2023
@brentfulgham brentfulgham force-pushed the eng/border-image-repeatround-output-doesnt-match-other-browsers branch from cc788d7 to c64f115 Compare March 20, 2023 23:44
@brentfulgham brentfulgham added the merge-queue Applied to send a pull request to merge-queue label Mar 20, 2023
@webkit-commit-queue webkit-commit-queue force-pushed the eng/border-image-repeatround-output-doesnt-match-other-browsers branch from c64f115 to 78a59f4 Compare March 21, 2023 01:20
https://bugs.webkit.org/show_bug.cgi?id=155955
<rdar://problem/28213711>

Reviewed by Tim Nguyen.

The RoundTile and SpaceTile didn't take the scale factors computed in NinePieceImage,
so would arrive at incorrect counts. This caused the logic to scale images when it
should have left them unscaled, and simply tiled (or spaced) the elements.

This change progresses four WPT tests:
(1) border-image-repeat-round.html
(2) border-image-round-and-stretch.html
(3) border-image-slice-percentage-test.html
(4) border-image-space-001.html

* Source/WebCore/platform/graphics/Image.cpp:
(WebCore::Image::drawTiled):

Canonical link: https://commits.webkit.org/261903@main
@webkit-commit-queue webkit-commit-queue force-pushed the eng/border-image-repeatround-output-doesnt-match-other-browsers branch from 78a59f4 to 255da9f Compare March 21, 2023 01:24
@webkit-commit-queue webkit-commit-queue merged commit 255da9f into WebKit:main Mar 21, 2023
@webkit-commit-queue
Copy link
Collaborator

Committed 261903@main (255da9f): https://commits.webkit.org/261903@main

Reviewed commits have been landed. Closing PR #11668 and removing active labels.

@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Mar 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Layout and Rendering For bugs with layout and rendering of Web pages.
Projects
None yet
6 participants