[Webkit-unassigned] [Bug 248638] New: Initial value for -webkit-line-clamp can't be expressed with its grammar
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Thu Dec 1 16:35:35 PST 2022
https://bugs.webkit.org/show_bug.cgi?id=248638
Bug ID: 248638
Summary: Initial value for -webkit-line-clamp can't be
expressed with its grammar
Product: WebKit
Version: WebKit Nightly Build
Hardware: Unspecified
OS: Unspecified
Status: NEW
Severity: Normal
Priority: P2
Component: CSS
Assignee: webkit-unassigned at lists.webkit.org
Reporter: obrufau at igalia.com
-webkit-line-clamp is defined with https://searchfox.org/wubkat/rev/2cf89aa97e32bfcb31d92b41d7b17875e9a5dafd/Source/WebCore/css/CSSProperties.json#7185
"parser-grammar": ["<percentage [0,inf]>", "<integer [1,inf]>"]
With this mappings: https://searchfox.org/wubkat/rev/2cf89aa97e32bfcb31d92b41d7b17875e9a5dafd/Source/WebCore/css/CSSPrimitiveValueMappings.h#130-134
if (primitiveType() == CSSUnitType::CSS_INTEGER)
return LineClampValue(value<int>(), LineClamp::LineCount);
if (primitiveType() == CSSUnitType::CSS_PERCENTAGE)
return LineClampValue(value<int>(), LineClamp::Percentage);
However, the initial value is https://searchfox.org/wubkat/rev/2cf89aa97e32bfcb31d92b41d7b17875e9a5dafd/Source/WebCore/rendering/style/RenderStyle.h#1857
static LineClampValue initialLineClamp() { return LineClampValue(); }
Defined as https://searchfox.org/wubkat/rev/2cf89aa97e32bfcb31d92b41d7b17875e9a5dafd/Source/WebCore/rendering/style/LineClampValue.h#33-35
LineClampValue()
: m_type(LineClamp::LineCount)
, m_value(-1)
So this value can't be represented with a non-negative integer/percentage.
Note that LineClampValue uses isNone() to refer to that https://searchfox.org/wubkat/rev/2cf89aa97e32bfcb31d92b41d7b17875e9a5dafd/Source/WebCore/rendering/style/LineClampValue.h#49
bool isNone() const { return m_value == -1; }
And in getComputedStyle() is serializes as "none": https://searchfox.org/wubkat/rev/2cf89aa97e32bfcb31d92b41d7b17875e9a5dafd/Source/WebCore/css/ComputedStyleExtractor.cpp#3348-3349
if (style.lineClamp().isNone())
return cssValuePool.createIdentifierValue(CSSValueNone);
So I guess -webkit-line-clamp:none should be valid?
Now it's broken:
document.body.style.webkitLineClamp = "initial";
getComputedStyle(document.body).webkitLineClamp; // "none"
CSS.supports("-webkit-line-clamp", "none"); // false
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20221202/31b55cb4/attachment.htm>
More information about the webkit-unassigned
mailing list