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: https://svn.webkit.org/repository/webkit/trunk@162588
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+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>
AX: Can't always increment web sliders.
--- /dev/null
+This test makes sure that if "inherit" is specified on the word-spacing element when there is no parent element, there is no crash
--- /dev/null
+<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>
AX: Can't always increment web sliders.
void RenderStyle::setWordSpacing(Length v)
{
float fontWordSpacing;
- if (v.isPercent())
+ switch (v.type()) {
+ case Auto:
+ fontWordSpacing = 0;
+ case Percent:
fontWordSpacing = v.getFloatValue() * font().spaceWidth() / 100;
- else {
- ASSERT(v.isFixed());
+ break;
+ case Fixed:
fontWordSpacing = v.getFloatValue();
+ break;
+ default:
+ ASSERT_NOT_REACHED();
+ fontWordSpacing = 0;
+ break;
}
inherited.access()->font.setWordSpacing(fontWordSpacing);
rareInheritedData.access()->wordSpacing = std::move(v);