Skip to content

Commit

Permalink
Merge r175363 - ASSERTION NOT REACHED because RenderStyle::setWordSpa…
Browse files Browse the repository at this point in the history
…cing() does not handle a Length value of type 'Calculated'.

https://bugs.webkit.org/show_bug.cgi?id=138054.

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2014-10-29
Reviewed by Zalan Bujtas.

Source/WebCore:

A Length of type 'Calculated' can be generated from blending two lengths of
different types. Setting the wordSpacing of the render style should be handled
correctly when the type of the new value is 'Calculated'.

Tests: css3/calculated-word-spacing.html.

Add a case for setting the render style wordSpacing to a <length> of type 'Calculated'.
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::setWordSpacing):

LayoutTests:

Ensure the render style's wordSpacing can be set correctly when the type of
the new value is 'Calculated'. The 'Calculated' Length value can result from
blending two Length values of different types. And these two Length values
are defined in two consecutive css animation key frames.

* css3/calculated-word-spacing-expected.txt: Added.
* css3/calculated-word-spacing.html: Added.

Canonical link: https://commits.webkit.org/154760.173@webkitgtk/2.6
git-svn-id: https://svn.webkit.org/repository/webkit/releases/WebKitGTK/webkit-2.6@175926 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
Said Abou-Hallawa authored and carlosgcampos committed Nov 11, 2014
1 parent 3b1e460 commit 76963fa
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 0 deletions.
15 changes: 15 additions & 0 deletions LayoutTests/ChangeLog
@@ -1,3 +1,18 @@
2014-10-29 Said Abou-Hallawa <sabouhallawa@apple.com>

ASSERTION NOT REACHED because RenderStyle::setWordSpacing() does not handle a Length value of type 'Calculated'.
https://bugs.webkit.org/show_bug.cgi?id=138054.

Reviewed by Zalan Bujtas.

Ensure the render style's wordSpacing can be set correctly when the type of
the new value is 'Calculated'. The 'Calculated' Length value can result from
blending two Length values of different types. And these two Length values
are defined in two consecutive css animation key frames.

* css3/calculated-word-spacing-expected.txt: Added.
* css3/calculated-word-spacing.html: Added.

2014-10-24 Said Abou-Hallawa <sabouhallawa@apple.com>

Clamp wordSpacing percentage value.
Expand Down
1 change: 1 addition & 0 deletions LayoutTests/css3/calculated-word-spacing-expected.txt
@@ -0,0 +1 @@
PASS if no assert or crash in debug.
36 changes: 36 additions & 0 deletions LayoutTests/css3/calculated-word-spacing.html
@@ -0,0 +1,36 @@
<!DOCTYPE html>
<html>
<head>
<style>
h1 {
-webkit-animation-name: spacing;
-webkit-animation-duration: 1s;
}
@-webkit-keyframes spacing {
0% {
word-spacing: normal
}
20% {
word-spacing: 100px
}
40% {
word-spacing: 200%
}
60% {
word-spacing: 20em
}
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>
17 changes: 17 additions & 0 deletions Source/WebCore/ChangeLog
@@ -1,3 +1,20 @@
2014-10-29 Said Abou-Hallawa <sabouhallawa@apple.com>

ASSERTION NOT REACHED because RenderStyle::setWordSpacing() does not handle a Length value of type 'Calculated'.
https://bugs.webkit.org/show_bug.cgi?id=138054.

Reviewed by Zalan Bujtas.

A Length of type 'Calculated' can be generated from blending two lengths of
different types. Setting the wordSpacing of the render style should be handled
correctly when the type of the new value is 'Calculated'.

Tests: css3/calculated-word-spacing.html.

Add a case for setting the render style wordSpacing to a <length> of type 'Calculated'.
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::setWordSpacing):

2014-10-24 Said Abou-Hallawa <sabouhallawa@apple.com>

Clamp wordSpacing percentage value.
Expand Down
3 changes: 3 additions & 0 deletions Source/WebCore/rendering/style/RenderStyle.cpp
Expand Up @@ -1379,6 +1379,9 @@ void RenderStyle::setWordSpacing(Length value)
case Fixed:
fontWordSpacing = value.value();
break;
case Calculated:
fontWordSpacing = value.nonNanCalculatedValue(maxValueForCssLength);
break;
default:
ASSERT_NOT_REACHED();
fontWordSpacing = 0;
Expand Down

0 comments on commit 76963fa

Please sign in to comment.