Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
length values in gradients should take effective zoom into account
https://bugs.webkit.org/show_bug.cgi?id=248927 Reviewed by Simon Fraser. If a gradient was using length values (i.e. 50px), it didn't work as expected with zoom property and page zoom. It should take the effective zoom into account. * LayoutTests/fast/gradients/length-and-zoom-expected.html: Added. * LayoutTests/fast/gradients/length-and-zoom.html: Added. * Source/WebCore/rendering/style/StyleGradientImage.cpp: (WebCore::StyleGradientImage::computeStops const): (WebCore::positionFromValue): Canonical link: https://commits.webkit.org/257659@main
- Loading branch information
Showing
3 changed files
with
40 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<!DOCTYPE html> | ||
<style> | ||
div { | ||
display: inline-block; | ||
zoom: 2; | ||
width: 100px; | ||
height: 100px; | ||
} | ||
#x { | ||
background-image: linear-gradient(blue 50%, green 50%); | ||
} | ||
#y { | ||
background-image: radial-gradient(circle at center, blue 50%, green 50%); | ||
} | ||
</style> | ||
You should see two squares. The first has a blue upper half part and a green bottom half part. The second has a blue circle at the center of a green box.<br> | ||
|
||
<div id=x></div> | ||
<div id=y></div> |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<!DOCTYPE html> | ||
<style> | ||
div { | ||
display: inline-block; | ||
zoom: 2; | ||
width: 100px; | ||
height: 100px; | ||
} | ||
#x { | ||
background-image: linear-gradient(blue 50px, green 50px); | ||
} | ||
#y { | ||
background-image: radial-gradient(circle at 50px 50px, blue 50%, green 50%); | ||
} | ||
</style> | ||
You should see two squares. The first has a blue upper half part and a green bottom half part. The second has a blue circle at the center of a green box.<br> | ||
|
||
<div id=x></div> | ||
<div id=y></div> |
This file contains 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