REGRESSION (r95502): Assertion failure in CSSPrimitiveValue::computeLengthDouble...
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 2 Oct 2011 08:25:34 +0000 (08:25 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 2 Oct 2011 08:25:34 +0000 (08:25 +0000)
commit0195d3ddab9222403517788c06e2a0cccc61843b
treee577a0f20eb477b47e7cae466c19db9fe23f8139
parentcba3fda98418c66386dfe974e296809681b8d286
REGRESSION (r95502): Assertion failure in CSSPrimitiveValue::computeLengthDouble() when media query specifies unit-less length
https://bugs.webkit.org/show_bug.cgi?id=68760

Reviewed by Antti Koivisto.

Source/WebCore:

Test: fast/media/invalid-lengths.html

Made length-comparison media queries accept only length values. In compatibility mode, numbers
are allowed as well, and they are interpreted as pixels.

* css/MediaQueryEvaluator.cpp:
(WebCore::computeLength): Added this helper function.
(WebCore::device_heightMediaFeatureEval): Changed to use computeLength().
(WebCore::device_widthMediaFeatureEval): Ditto.
(WebCore::heightMediaFeatureEval): Ditto.
(WebCore::widthMediaFeatureEval): Ditto.

LayoutTests:

* fast/media/invalid-lengths-expected.txt: Added.
* fast/media/invalid-lengths.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@96471 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/media/invalid-lengths-expected.txt [new file with mode: 0644]
LayoutTests/fast/media/invalid-lengths.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/css/MediaQueryEvaluator.cpp