-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ASAN_ILL | WTF::Vector::expandCapacity; WTF::Vector::expandCapacity; …
…WebCore::StyleGradientImage::computeStops https://bugs.webkit.org/show_bug.cgi?id=264639 rdar://114069174 Reviewed by Antti Koivisto. When working with repeating gradients, more care should be put into limiting the amount of stops that can be additionally generated. If the original gradient range is already too small, the extra stops are not generated. Once the number of additional stops is calculated, the generation proceeds only if that number is below some reasonable limit. That generation is also improved slightly by creating a separate Vector of gradient stops that then simply replaces the original one. * LayoutTests/fast/css/repeating-conic-gradient-small-range-expected.txt: Added. * LayoutTests/fast/css/repeating-conic-gradient-small-range.html: Added. * LayoutTests/fast/css/repeating-linear-gradient-small-range-expected.txt: Added. * LayoutTests/fast/css/repeating-linear-gradient-small-range.html: Added. * LayoutTests/fast/css/repeating-radial-gradient-small-range-expected.txt: Added. * LayoutTests/fast/css/repeating-radial-gradient-small-range.html: Added. * LayoutTests/platform/glib/TestExpectations: * Source/WebCore/rendering/style/StyleGradientImage.cpp: (WebCore::StyleGradientImage::computeStops const): Originally-landed-as: 274097.8@webkit-2024.2-embargoed (efd994a148b6). rdar://128090422 Canonical link: https://commits.webkit.org/278883@main
- Loading branch information
1 parent
96f558b
commit 72485b3
Showing
8 changed files
with
148 additions
and
25 deletions.
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
LayoutTests/fast/css/repeating-conic-gradient-small-range-expected.txt
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,4 @@ | ||
This test passess if it doesn't crash. | ||
Repeating Gradient With Many Stops | ||
Repeating Gradient With Many Stops | ||
Repeating Gradient With Many Stops |
19 changes: 19 additions & 0 deletions
19
LayoutTests/fast/css/repeating-conic-gradient-small-range.html
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 @@ | ||
<script> | ||
if (window.testRunner) | ||
testRunner.dumpAsText(); | ||
</script> | ||
<style> | ||
.repeating-gradient-with-suffix-stops { | ||
background: repeating-conic-gradient(from 0deg, red 0%, green 0.0001%); | ||
} | ||
.repeating-gradient-with-prefix-stops { | ||
background: repeating-conic-gradient(from 0deg, red 99.9999%, green 100%); | ||
} | ||
.repeating-gradient-with-prefix-and-suffix-stops { | ||
background: repeating-conic-gradient(from 0deg, red 50%, green 50.0001%); | ||
} | ||
</style> | ||
<div>This test passess if it doesn't crash.</div> | ||
<div class="repeating-gradient-with-suffix-stops">Repeating Gradient With Many Stops</div> | ||
<div class="repeating-gradient-with-prefix-stops">Repeating Gradient With Many Stops</div> | ||
<div class="repeating-gradient-with-prefix-and-suffix-stops">Repeating Gradient With Many Stops</div> |
4 changes: 4 additions & 0 deletions
4
LayoutTests/fast/css/repeating-linear-gradient-small-range-expected.txt
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,4 @@ | ||
This test passess if it doesn't crash. | ||
Repeating Gradient With Many Stops | ||
Repeating Gradient With Many Stops | ||
Repeating Gradient With Many Stops |
19 changes: 19 additions & 0 deletions
19
LayoutTests/fast/css/repeating-linear-gradient-small-range.html
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 @@ | ||
<script> | ||
if (window.testRunner) | ||
testRunner.dumpAsText(); | ||
</script> | ||
<style> | ||
.repeating-gradient-with-suffix-stops { | ||
background: repeating-linear-gradient(to right, red 0%, green 0.0001%); | ||
} | ||
.repeating-gradient-with-prefix-stops { | ||
background: repeating-linear-gradient(to right, red 99.9999%, green 100%); | ||
} | ||
.repeating-gradient-with-prefix-and-suffix-stops { | ||
background: repeating-linear-gradient(to right, red 50%, green 50.0001%); | ||
} | ||
</style> | ||
<div>This test passess if it doesn't crash.</div> | ||
<div class="repeating-gradient-with-suffix-stops">Repeating Gradient With Many Stops</div> | ||
<div class="repeating-gradient-with-prefix-stops">Repeating Gradient With Many Stops</div> | ||
<div class="repeating-gradient-with-prefix-and-suffix-stops">Repeating Gradient With Many Stops</div> |
4 changes: 4 additions & 0 deletions
4
LayoutTests/fast/css/repeating-radial-gradient-small-range-expected.txt
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,4 @@ | ||
This test passess if it doesn't crash. | ||
Repeating Gradient With Many Stops | ||
Repeating Gradient With Many Stops | ||
Repeating Gradient With Many Stops |
19 changes: 19 additions & 0 deletions
19
LayoutTests/fast/css/repeating-radial-gradient-small-range.html
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 @@ | ||
<script> | ||
if (window.testRunner) | ||
testRunner.dumpAsText(); | ||
</script> | ||
<style> | ||
.repeating-gradient-with-suffix-stops { | ||
background: repeating-radial-gradient(circle at center, red 0%, green 0.0001%); | ||
} | ||
.repeating-gradient-with-prefix-stops { | ||
background: repeating-radial-gradient(circle at center, red 99.9999%, green 100%); | ||
} | ||
.repeating-gradient-with-prefix-and-suffix-stops { | ||
background: repeating-radial-gradient(circle at center, red 50%, green 50.0001%); | ||
} | ||
</style> | ||
<div>This test passess if it doesn't crash.</div> | ||
<div class="repeating-gradient-with-suffix-stops">Repeating Gradient With Many Stops</div> | ||
<div class="repeating-gradient-with-prefix-stops">Repeating Gradient With Many Stops</div> | ||
<div class="repeating-gradient-with-prefix-and-suffix-stops">Repeating Gradient With Many Stops</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
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