Crash when setting '-webkit-line-clamp' CSS property to a calculated value
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 17 Nov 2014 01:18:32 +0000 (01:18 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 17 Nov 2014 01:18:32 +0000 (01:18 +0000)
commitade09bd7ff3ad5635eb4b775807609ab552a38b2
treecf6f77a082cae192eafca66d8d3bdc1bb63a24fd
parentbb6ac30c8f593461ec6432e07f73fea049482d69
Crash when setting '-webkit-line-clamp' CSS property to a calculated value
https://bugs.webkit.org/show_bug.cgi?id=138777

Reviewed by Benjamin Poulain.

Source/WebCore:

CSS Calculated values were not handled when converting a CSSPrimitiveValue
to a LineClampValue. As a result, we would hit an ASSERT_NOT_REACHED()
assertion. To address this issue, this patch updates the code to use
primitiveType() / getValue<>() instead of m_primitiveUnitType /
m_value.num, as those getter function properly handle CSS Calculated
values.

Test: fast/css/webkit-line-clamp-calculated-value.html

* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::operator LineClampValue):

LayoutTests:

Add a layout test to check that assigning calculated values to the
'-webkit-line-clamp' CSS property does not crash and behaves as
expected.

* fast/css/webkit-line-clamp-calculated-value-expected.txt: Added.
* fast/css/webkit-line-clamp-calculated-value.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@176165 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/css/webkit-line-clamp-calculated-value-expected.txt [new file with mode: 0644]
LayoutTests/fast/css/webkit-line-clamp-calculated-value.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/css/CSSPrimitiveValueMappings.h