Avoid CSSPrimitiveValue allocation when parsing sizes
authoryoav@yoav.ws <yoav@yoav.ws@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 12 May 2015 18:40:38 +0000 (18:40 +0000)
committeryoav@yoav.ws <yoav@yoav.ws@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 12 May 2015 18:40:38 +0000 (18:40 +0000)
commit6b5ebbafa567d4b836146cdb2f3a518228b79a51
treef01995c61e8d53faeca76fd7d9fd6dd11814de58
parentf9102a24eb4d2271f2f97764c69baa95d52b5389
Avoid CSSPrimitiveValue allocation when parsing sizes
https://bugs.webkit.org/show_bug.cgi?id=144910

Reviewed by Darin Adler.

Turn non-calc length calculation logic into a static method,
so that it can be called without a CSSPrimitiveValue object.
Then, call that method to calculate the default source-size length.

No new tests, since no functionality change.

* css/CSSPrimitiveValue.cpp:
(WebCore::CSSPrimitiveValue::computeLengthDouble): Split out the logic for everything that's not calc into a static method.
(WebCore::CSSPrimitiveValue::computeNonCalcLengthDouble): Static length computation logic for everything that is not calc.
* css/CSSPrimitiveValue.h:
(WebCore::CSSPrimitiveValue::isFontRelativeLength): Turn into static.
* css/SourceSizeList.cpp:
(WebCore::defaultLength): Use the new static method to compute the length.
(WebCore::computeLength): Use the calc length computation methods directly.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@184208 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/css/CSSPrimitiveValue.cpp
Source/WebCore/css/CSSPrimitiveValue.h
Source/WebCore/css/SourceSizeList.cpp