ASSERTION FAILED: type() == Percent in WebCore::Length::percent
authorzandobersek@gmail.com <zandobersek@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 13 Aug 2013 06:26:45 +0000 (06:26 +0000)
committerzandobersek@gmail.com <zandobersek@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 13 Aug 2013 06:26:45 +0000 (06:26 +0000)
commitee942e59ddf74054bc5e48f54833c7c4210f9b4c
treebbd96258de7f25f841807425a0dc37657f931e6b
parent2ae4a27149356e6cb1dc4c4ed12de2d1fcfd8820
ASSERTION FAILED: type() == Percent in WebCore::Length::percent
https://bugs.webkit.org/show_bug.cgi?id=116715

Reviewed by Darin Adler.

Source/WebCore:

Allow the Calculated type in the Length::percent method that returns the Length's
float value. This reflects the changes in r110148 that adjusted the Length::isPercent
method to return true for Length objects of either Percent or Calculated type.

Test: fast/css/calculated-length-as-percent-crash.html

* platform/Length.h:
(WebCore::Length::percent): Assert that Length::isPercent is true when Length::percent
is called, ensuring the Length's type is either Percent or Calculated.

LayoutTests:

Add the test case, as produced by the Fuzzinator, that was causing assertions
in Length::percent due to Length objects of the Calculated type not being treated
as holding a proper percent value in that method, despite Length::isPercent
returning true for Length objects of either Percent or the Calculated type.

* fast/css/calculated-length-as-percent-crash-expected.txt: Added.
* fast/css/calculated-length-as-percent-crash.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@153981 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/css/calculated-length-as-percent-crash-expected.txt [new file with mode: 0644]
LayoutTests/fast/css/calculated-length-as-percent-crash.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/platform/Length.h