haikuwebkit/LayoutTests/css3/infinite-word-spacing.html

37 lines
732 B
HTML
Raw Permalink Normal View History

Clamp wordSpacing percentage value. https://bugs.webkit.org/show_bug.cgi?id=129350. Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2014-10-24 Reviewed by Zalan Bujtas. Source/WebCore: When the CSS wordSpacing property is percentage, its value has to be within the pre-defined min/max values for the CSS length type. This is done the same way the wordSpacing of type <length> is handled. Tests: css3/infinite-word-spacing.html. Move the definitions of minValueForCssLength and maxValueForCssLength from the .cpp file to the .h file. * css/CSSPrimitiveValue.cpp: * css/CSSPrimitiveValue.h: Clamp the wordSpacing value to minValueForCssLength and maxValueForCssLength when its type is percentage. * css/DeprecatedStyleBuilder.cpp: (WebCore::ApplyPropertyWordSpacing::applyValue): LayoutTests: Make sure that setting the CSS style wordSpacing property to very huge percentage value and blending this value with other values for animating key frames does not assert or crash. The expectation is to have this huge value to be clamped to the pre-defined min/max values for the CSS length type. So when blending the clamped value with other wordSpacing values, the result can't be NaN. This should be very similar to the case when it is set to a huge <length> value. * css3/infinite-word-spacing-expected.txt: Added. * css3/infinite-word-spacing.html: Added. Canonical link: https://commits.webkit.org/155933@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@175197 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-10-25 02:37:41 +00:00
<!DOCTYPE html>
<html>
<head>
<style>
h1 {
-webkit-animation-name: spacing;
-webkit-animation-duration: 1s;
}
@-webkit-keyframes spacing {
0% {
word-spacing: normal
}
20% {
word-spacing: 11111111111111111111111111111111111111111111111111%
}
40% {
word-spacing: 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111%
}
60% {
word-spacing: 200%
}
80% {
word-spacing: 300%
}
100% { }
}
</style>
</head>
<script>
if (window.testRunner)
testRunner.dumpAsText();
</script>
<body>
<h1>PASS if no assert or crash in debug.</h1>
</body>
</html>