Commit fa9c81b1 authored by Chris Nardi's avatar Chris Nardi Committed by Commit Bot

Support calc() in webkit-line-clamp

When parsing webkit-line-clamp, it was explicitly checked if the token
was a number token, which excluded calc() values. Remove that check so
calc() values are supported.

Bug: 397061
Change-Id: Idc8602f6ebeed22d1d849bdd6d6bb9be7064e5d2
Reviewed-on: https://chromium-review.googlesource.com/1034386Reviewed-by: default avatarRune Lillesveen <futhark@chromium.org>
Commit-Queue: Chris Nardi <cnardi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#554823}
parent 0a445800
<!doctype html>
<meta charset="utf-8">
<title>CSS Test: calc() function in webkit-line-clamp</title>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<style>
#test {
-webkit-line-clamp: calc(2);
}
</style>
<div id="test"></div>
<script>
const div = document.querySelector("#test");
test(function() {
assert_equals(getComputedStyle(div).webkitLineClamp, "2");
}, "calc() in webkit-line-clamp");
</script>
......@@ -14,9 +14,6 @@ const CSSValue* WebkitLineClamp::ParseSingleValue(
CSSParserTokenRange& range,
const CSSParserContext& context,
const CSSParserLocalContext&) const {
if (range.Peek().GetType() != kNumberToken)
return nullptr;
// When specifying number of lines, don't allow 0 as a valid value.
return CSSPropertyParserHelpers::ConsumePositiveInteger(range);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment