Commit 494da149 authored by mmaxfield@apple.com's avatar mmaxfield@apple.com

ASSERTION FAILED: v.isFixed() in WebCore::RenderStyle::setWordSpacing

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

Reviewed by Simon Fraser.

When "inherit" is specified and there is no parent, Length values have an "Auto" type

Source/WebCore:

Test: fast/css3-text/css3-word-spacing-percentage/word-spacing-crash.html

* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::setWordSpacing):

LayoutTests:

* fast/css3-text/css3-word-spacing-percentage/word-spacing-crash-expected.txt: Added.
* fast/css3-text/css3-word-spacing-percentage/word-spacing-crash.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@162588 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 24dac231
2014-01-22 Myles C. Maxfield <mmaxfield@apple.com>
ASSERTION FAILED: v.isFixed() in WebCore::RenderStyle::setWordSpacing
https://bugs.webkit.org/show_bug.cgi?id=126987
Reviewed by Simon Fraser.
When "inherit" is specified and there is no parent, Length values have an "Auto" type
* fast/css3-text/css3-word-spacing-percentage/word-spacing-crash-expected.txt: Added.
* fast/css3-text/css3-word-spacing-percentage/word-spacing-crash.html: Added.
2014-01-22 Samuel White <samuel_white@apple.com> 2014-01-22 Samuel White <samuel_white@apple.com>
AX: Can't always increment web sliders. AX: Can't always increment web sliders.
This test makes sure that if "inherit" is specified on the word-spacing element when there is no parent element, there is no crash
<svg xmlns="http://www.w3.org/2000/svg" word-spacing="inherit"></svg>
This test makes sure that if "inherit" is specified on the word-spacing element when there is no parent element, there is no crash
<script>
if (window.testRunner) {
testRunner.dumpAsText();
}
</script>
2014-01-22 Myles C. Maxfield <mmaxfield@apple.com>
ASSERTION FAILED: v.isFixed() in WebCore::RenderStyle::setWordSpacing
https://bugs.webkit.org/show_bug.cgi?id=126987
Reviewed by Simon Fraser.
When "inherit" is specified and there is no parent, Length values have an "Auto" type
Test: fast/css3-text/css3-word-spacing-percentage/word-spacing-crash.html
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::setWordSpacing):
2014-01-22 Samuel White <samuel_white@apple.com> 2014-01-22 Samuel White <samuel_white@apple.com>
AX: Can't always increment web sliders. AX: Can't always increment web sliders.
...@@ -1453,11 +1453,19 @@ int RenderStyle::computedLineHeight(RenderView* renderView) const ...@@ -1453,11 +1453,19 @@ int RenderStyle::computedLineHeight(RenderView* renderView) const
void RenderStyle::setWordSpacing(Length v) void RenderStyle::setWordSpacing(Length v)
{ {
float fontWordSpacing; float fontWordSpacing;
if (v.isPercent()) switch (v.type()) {
case Auto:
fontWordSpacing = 0;
case Percent:
fontWordSpacing = v.getFloatValue() * font().spaceWidth() / 100; fontWordSpacing = v.getFloatValue() * font().spaceWidth() / 100;
else { break;
ASSERT(v.isFixed()); case Fixed:
fontWordSpacing = v.getFloatValue(); fontWordSpacing = v.getFloatValue();
break;
default:
ASSERT_NOT_REACHED();
fontWordSpacing = 0;
break;
} }
inherited.access()->font.setWordSpacing(fontWordSpacing); inherited.access()->font.setWordSpacing(fontWordSpacing);
rareInheritedData.access()->wordSpacing = std::move(v); rareInheritedData.access()->wordSpacing = std::move(v);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment